main
erb 69 lines 3.73 KB
Raw
1 <header class="border-b border-surface-600 bg-surface-800 sticky top-0 z-50">
2 <nav class="max-w-6xl mx-auto px-4 sm:px-6 h-14 flex items-center justify-between gap-6">
3
4 <div class="flex items-center gap-6">
5 <%= link_to root_path, class: "flex items-center gap-2 text-gray-100 hover:text-brand-500 transition-colors" do %>
6 <img src="/icon.png" alt="siGit" class="h-6 w-auto">
7 <span class="font-semibold text-base tracking-tight">Code &amp; Deploy</span>
8 <% end %>
9
10 <div class="hidden sm:flex items-center gap-1">
11 <%= link_to "Code", code_path, class: "nav-link px-2 py-1 rounded hover:bg-surface-600" %>
12 <%= link_to "Models", models_path, class: "nav-link px-2 py-1 rounded hover:bg-surface-600" %>
13 <%= link_to "Repos", repos_path, class: "nav-link px-2 py-1 rounded hover:bg-surface-600" %>
14 </div>
15 </div>
16
17 <div class="flex items-center gap-3">
18 <% if signed_in? %>
19 <%= link_to new_repository_path, class: "btn-secondary text-xs py-1.5 px-3 hidden sm:inline-flex" do %>
20 <svg class="w-3.5 h-3.5" viewBox="0 0 16 16" fill="currentColor">
21 <path d="M7.75 2a.75.75 0 0 1 .75.75V7h4.25a.75.75 0 0 1 0 1.5H8.5v4.25a.75.75 0 0 1-1.5 0V8.5H2.75a.75.75 0 0 1 0-1.5H7V2.75A.75.75 0 0 1 7.75 2Z"/>
22 </svg>
23 New
24 <% end %>
25
26 <div class="relative group">
27 <button class="flex items-center gap-2 hover:opacity-80 transition-opacity">
28 <img src="<%= current_user.avatar_url_or_default %>"
29 alt="<%= current_user.display_name_or_username %>"
30 class="w-7 h-7 rounded-full border border-surface-500">
31 <span class="text-sm font-medium text-gray-300 hidden sm:block"><%= current_user.username %></span>
32 <svg class="w-3.5 h-3.5 text-gray-500" fill="none" viewBox="0 0 16 16"
33 stroke="currentColor" stroke-width="2">
34 <path stroke-linecap="round" stroke-linejoin="round" d="M4 6l4 4 4-4"/>
35 </svg>
36 </button>
37
38 <div class="absolute right-0 top-full mt-1 w-48 bg-surface-700 border border-surface-500
39 rounded shadow-lg py-1 opacity-0 invisible
40 group-hover:opacity-100 group-hover:visible
41 transition-all duration-150 z-50">
42 <div class="px-3 py-2 border-b border-surface-600">
43 <p class="text-xs font-medium text-gray-100"><%= current_user.display_name_or_username %></p>
44 <p class="text-xs text-gray-400"><%= current_user.email %></p>
45 </div>
46 <%= link_to user_profile_path(current_user.username),
47 class: "block px-3 py-1.5 text-sm text-gray-300 hover:bg-surface-600" do %>Your repositories<% end %>
48 <%= link_to new_import_path,
49 class: "block px-3 py-1.5 text-sm text-gray-300 hover:bg-surface-600" do %>Import from GitHub<% end %>
50 <%= link_to settings_path,
51 class: "block px-3 py-1.5 text-sm text-gray-300 hover:bg-surface-600" do %>Settings<% end %>
52 <% if current_user_admin? %>
53 <%= link_to admin_root_path,
54 class: "block px-3 py-1.5 text-sm text-brand-400 hover:bg-surface-600" do %>Admin console<% end %>
55 <% end %>
56 <div class="border-t border-surface-600 mt-1">
57 <%= button_to signout_path, method: :delete,
58 class: "block w-full text-left px-3 py-1.5 text-sm text-red-400 hover:bg-red-900/30 transition-colors" do %>
59 Sign out
60 <% end %>
61 </div>
62 </div>
63 </div>
64 <% else %>
65 <%= link_to "Sign in", signin_path, class: "btn-primary text-xs py-1.5 px-4" %>
66 <% end %>
67 </div>
68 </nav>
69 </header>