mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-08 12:56:27 +08:00
refactoring
This commit is contained in:
parent
c08d72be36
commit
c149b3cc2a
2 changed files with 10 additions and 8 deletions
|
@ -55,4 +55,14 @@ module SecondaryNavigationHelper
|
||||||
def is_module_archive?
|
def is_module_archive?
|
||||||
action_name == 'archive'
|
action_name == 'archive'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def title_element
|
||||||
|
if project_page?
|
||||||
|
@project
|
||||||
|
elsif experiment_page?
|
||||||
|
@experiment
|
||||||
|
elsif module_page?
|
||||||
|
@my_module
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -161,14 +161,6 @@
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<!-- Secondary navigation title -->
|
<!-- 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">
|
<div class="nav-name">
|
||||||
<%= truncate(title_element.name,
|
<%= truncate(title_element.name,
|
||||||
length: Constants::NAME_TRUNCATION_LENGTH) %>
|
length: Constants::NAME_TRUNCATION_LENGTH) %>
|
||||||
|
|
Loading…
Add table
Reference in a new issue