main
erb 74 lines 3.74 KB
Raw
1 <% content_for :title, "Dashboard" %>
2
3 <div class="max-w-6xl mx-auto px-4 sm:px-6 py-8">
4 <div class="grid grid-cols-1 lg:grid-cols-4 gap-8">
5
6 <aside class="lg:col-span-1">
7 <div class="text-center sm:text-left">
8 <img src="<%= current_user.avatar_url_or_default %>"
9 alt="<%= current_user.display_name_or_username %>"
10 class="w-20 h-20 rounded-full border border-surface-600 mx-auto sm:mx-0 mb-4">
11 <h2 class="font-semibold text-gray-100 text-base"><%= current_user.display_name_or_username %></h2>
12 <p class="text-sm text-gray-400"><%= current_user.username %></p>
13 </div>
14 <div class="mt-6">
15 <%= link_to new_repository_path, class: "btn-secondary w-full justify-center" do %>
16 <svg class="w-4 h-4" viewBox="0 0 16 16" fill="currentColor">
17 <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"/>
18 </svg>
19 New repository
20 <% end %>
21 </div>
22 </aside>
23
24 <main class="lg:col-span-3">
25 <div class="flex items-center justify-between mb-4">
26 <h1 class="text-base font-semibold text-gray-100">Your repositories</h1>
27 <%= link_to user_profile_path(current_user.username),
28 class: "text-xs text-brand-500 hover:underline" do %>View all<% end %>
29 </div>
30
31 <% if @repositories.any? %>
32 <div class="card divide-y divide-surface-600">
33 <% @repositories.each do |repo| %>
34 <div class="px-4 py-3 hover:bg-surface-600 transition-colors">
35 <div class="flex items-start justify-between gap-4">
36 <div class="min-w-0 flex-1">
37 <%= link_to repository_path(current_user.username, repo.name),
38 class: "font-medium text-brand-500 hover:underline text-sm" do %><%= repo.name %><% end %>
39 <% if repo.description.present? %>
40 <p class="text-xs text-gray-400 mt-0.5 truncate"><%= repo.description %></p>
41 <% end %>
42 </div>
43 <div class="flex items-center gap-3 text-xs text-gray-500 shrink-0">
44 <% if repo.is_private %>
45 <span class="badge-gray">Private</span>
46 <% end %>
47 <span><%= time_ago_in_words(repo.updated_at) %> ago</span>
48 </div>
49 </div>
50 </div>
51 <% end %>
52 </div>
53 <% else %>
54 <div class="card px-6 py-12 text-center">
55 <svg class="w-12 h-12 mx-auto text-gray-600 mb-4" viewBox="0 0 24 24"
56 fill="none" stroke="currentColor" stroke-width="1">
57 <path stroke-linecap="round" stroke-linejoin="round"
58 d="M3.75 9.776c.112-.017.227-.026.344-.026h15.812c.117 0 .232.009.344.026m-16.5 0a2.25 2.25 0 0 0-1.883 2.542l.857 6a2.25 2.25 0 0 0 2.227 1.932H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-1.883-2.542m-16.5 0V6A2.25 2.25 0 0 1 6 3.75h3.879a1.5 1.5 0 0 1 1.06.44l2.122 2.12a1.5 1.5 0 0 0 1.06.44H18A2.25 2.25 0 0 1 20.25 9v.776"/>
59 </svg>
60 <p class="text-sm text-gray-100 font-medium mb-1">Import your first repo from GitHub</p>
61 <p class="text-sm text-gray-400 mb-5 max-w-sm mx-auto">
62 Bring your code over with its full history — or mirror it read-only and keep
63 GitHub as upstream to try siGit risk-free.
64 </p>
65 <div class="flex items-center justify-center gap-3">
66 <%= link_to new_import_path, class: "btn-primary" do %>Import from GitHub<% end %>
67 <%= link_to new_repository_path, class: "btn-ghost" do %>Start from scratch<% end %>
68 </div>
69 </div>
70 <% end %>
71 </main>
72
73 </div>
74 </div>