Added link to gitea commit to sidebar
This commit is contained in:
@@ -27,7 +27,7 @@
|
|||||||
<span class="collapse-text ml-3 transition-all duration-300 ease-in-out max-w-[180px] opacity-100 overflow-hidden whitespace-nowrap">Kategorien</span>
|
<span class="collapse-text ml-3 transition-all duration-300 ease-in-out max-w-[180px] opacity-100 overflow-hidden whitespace-nowrap">Kategorien</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<!-- 5. NEU: RÄUME & STANDORTE -->
|
<!-- 5. RÄUME & STANDORTE -->
|
||||||
<%= link_to rooms_path, class: nav_link_class("rooms") do %>
|
<%= link_to rooms_path, class: nav_link_class("rooms") do %>
|
||||||
<svg class="h-5 w-5 shrink-0 ml-0.5" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
<svg class="h-5 w-5 shrink-0 ml-0.5" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
|
<path stroke-linecap="round" stroke-linejoin="round" d="M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
|
||||||
|
|||||||
@@ -86,6 +86,31 @@
|
|||||||
Ausloggen
|
Ausloggen
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<%
|
||||||
|
repo_url = "https://gitea.daboh.ipv64.de/daboh/vault171/"
|
||||||
|
commit_url = CURRENT_COMMIT.present? ? "#{repo_url}/commit/#{CURRENT_COMMIT}" : repo_url
|
||||||
|
%>
|
||||||
|
<%= link_to commit_url, target: "_blank",
|
||||||
|
class: "group flex items-center justify-center px-3 py-1 text-[11px] rounded-md text-gray-400 hover:text-gray-700 hover:bg-gray-50/50 transition w-full",
|
||||||
|
title: "Aktuelle Git-Revision anzeigen" do %>
|
||||||
|
|
||||||
|
<!-- Das Icon bleibt klein und zentriert -->
|
||||||
|
<svg class="h-3.5 w-3.5 shrink-0 text-gray-400 group-hover:text-gray-700 transition-colors" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5" />
|
||||||
|
</svg>
|
||||||
|
|
||||||
|
<!-- Durch 'w-0 group-data-[collapsed]:w-0' oder ähnliche Selektoren blockiert der Text beim Einklappen 0 Pixel Platz -->
|
||||||
|
<span class="collapse-text ml-1.5 transition-all duration-300 ease-in-out max-w-[180px] opacity-100 overflow-hidden whitespace-nowrap font-mono tracking-wider origin-left">
|
||||||
|
<% if CURRENT_COMMIT.present? %>
|
||||||
|
<%= CURRENT_COMMIT %>
|
||||||
|
<% else %>
|
||||||
|
repository
|
||||||
|
<% end %>
|
||||||
|
</span>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</aside>
|
</aside>
|
||||||
|
|||||||
11
config/initializers/git_revision.rb
Normal file
11
config/initializers/git_revision.rb
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# config/initializers/git_revision.rb
|
||||||
|
|
||||||
|
# 1. Versuch: Über eine Umgebungsvariable (Standard bei Docker/Render/Heroku)
|
||||||
|
CURRENT_COMMIT = ENV["GIT_COMMIT_SHA"] ||
|
||||||
|
ENV["RENDER_GIT_COMMIT"] ||
|
||||||
|
# 2. Versuch: Direkt aus dem lokalen .git Ordner auslesen
|
||||||
|
begin
|
||||||
|
`git rev-parse --short HEAD`.strip
|
||||||
|
rescue
|
||||||
|
nil
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user