refactoring

This commit is contained in:
mlorb 2018-04-19 15:12:26 +02:00
parent c08d72be36
commit c149b3cc2a
2 changed files with 10 additions and 8 deletions

View file

@ -55,4 +55,14 @@ module SecondaryNavigationHelper
def is_module_archive?
action_name == 'archive'
end
def title_element
if project_page?
@project
elsif experiment_page?
@experiment
elsif module_page?
@my_module
end
end
end

View file

@ -161,14 +161,6 @@
</ul>
<!-- Secondary navigation title -->
<% if project_page? %>
<% title_element = @project %>
<% elsif experiment_page? %>
<% title_element = @experiment %>
<% elsif module_page? %>
<% title_element = @my_module %>
<% end %>
<div class="nav-name">
<%= truncate(title_element.name,
length: Constants::NAME_TRUNCATION_LENGTH) %>