main
erb 34 lines 1.73 KB
Raw
1 <% content_for :title, "#{@commit[:short_sha]} · #{@repository.full_name}" %>
2
3 <div class="border-b border-surface-600 bg-surface-800">
4 <div class="max-w-6xl mx-auto px-4 sm:px-6 pt-6 pb-4">
5 <div class="flex items-center gap-2 text-sm mb-4">
6 <%= link_to "@#{@owner.username}", user_profile_path(@owner.username), class: "text-brand-500 hover:underline font-medium" %>
7 <span class="text-gray-500">/</span>
8 <%= link_to @repository.name, repository_path(@owner.username, @repository.name), class: "text-brand-500 hover:underline font-semibold" %>
9 <span class="text-gray-500">/</span>
10 <%= link_to "commits", repository_commits_path(@owner.username, @repository.name, @repository.default_branch), class: "text-gray-400 hover:text-gray-200 transition-colors" %>
11 <span class="text-gray-500">/</span>
12 <span class="font-mono text-gray-400"><%= @commit[:short_sha] %></span>
13 </div>
14
15 <h1 class="text-xl font-semibold text-gray-100 mb-1"><%= @commit[:subject] %></h1>
16
17 <% body = @commit[:body].to_s.delete_prefix(@commit[:subject]).strip %>
18 <% if body.present? %>
19 <p class="text-sm text-gray-400 whitespace-pre-line mt-2 mb-3"><%= body %></p>
20 <% end %>
21
22 <div class="flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-gray-400 mt-3">
23 <span><strong class="text-gray-300"><%= @commit[:author_name] %></strong> committed</span>
24 <% if @commit[:authored_date] %>
25 <span><%= @commit[:authored_date].strftime("%b %-d, %Y at %H:%M UTC") %></span>
26 <% end %>
27 <span class="font-mono badge-gray select-all"><%= @commit[:sha] %></span>
28 </div>
29 </div>
30 </div>
31
32 <div class="max-w-6xl mx-auto px-4 sm:px-6 py-6 space-y-3">
33 <%= render "shared/diff", diff: @commit[:diff] %>
34 </div>