Extract method in admin header component

This commit is contained in:
Javi Martín
2023-01-05 14:25:48 +01:00
parent 86fd14f8f0
commit ca28a31ee5
2 changed files with 14 additions and 15 deletions

View File

@@ -17,21 +17,12 @@
<div class="top-bar">
<div class="top-bar-left">
<% if namespace == "officing" %>
<h1>
<%= link_to "#" do %>
<%= link_to namespace_path do %>
<%= setting["org_name"] %>
<br><small><%= namespaced_header_title %></small>
<% end %>
</h1>
<% else %>
<h1>
<%= link_to namespaced_root_path do %>
<%= setting["org_name"] %>
<br><small><%= namespaced_header_title %></small>
<% end %>
</h1>
<% end %>
</div>
<% if show_admin_menu?(user) || namespace != "management" %>

View File

@@ -17,4 +17,12 @@ class Layout::AdminHeaderComponent < ApplicationComponent
t("#{namespace}.header.title")
end
end
def namespace_path
if namespace == "officing"
"#"
else
namespaced_root_path
end
end
end