mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 01:35:34 +08:00
code logic cleanup
This commit is contained in:
parent
c9a6af8de4
commit
477066f85e
2 changed files with 7 additions and 10 deletions
|
@ -94,8 +94,11 @@ class ExperimentsController < ApplicationController
|
|||
@current_sort = view_state.state.dig('my_modules', view_mode, 'sort') || 'atoz'
|
||||
|
||||
@project = @experiment.project
|
||||
@archived_modules = @experiment.my_modules.archived.order(:name)
|
||||
@active_modules = @experiment.my_modules.active.order(:name)
|
||||
if params[:view_mode] == 'archived'
|
||||
@my_modules = @experiment.my_modules.archived.order(:name)
|
||||
else
|
||||
@my_modules = @experiment.my_modules.active.order(:name)
|
||||
end
|
||||
end
|
||||
|
||||
def load_table
|
||||
|
|
|
@ -3,14 +3,8 @@
|
|||
<% provide(:sidebar_url, sidebar_experiment_path(@experiment)) %>
|
||||
<% provide(:container_class, 'no-second-nav-container') %>
|
||||
|
||||
<% if params[:view_mode] == "archived" %>
|
||||
<%= content_for :sidebar do %>
|
||||
<%= render partial: 'shared/sidebar/archived_my_modules.html.erb', locals: { experiment: @experiment, my_modules: @archived_modules } %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= content_for :sidebar do %>
|
||||
<%= render partial: 'shared/sidebar/my_modules.html.erb', locals: { experiment: @experiment, my_modules: @active_modules } %>
|
||||
<% end %>
|
||||
<%= content_for :sidebar do %>
|
||||
<%= render partial: 'shared/sidebar/my_modules.html.erb', locals: { experiment: @experiment, my_modules: @my_modules } %>
|
||||
<% end %>
|
||||
|
||||
<div class="content-pane flexible experiment-new-my_module <%= params[:view_mode] %>" id="experimentTable">
|
||||
|
|
Loading…
Reference in a new issue