Extract method in admin header component
This commit is contained in:
@@ -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" %>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user