diff --git a/app/assets/stylesheets/themes/scinote.scss b/app/assets/stylesheets/themes/scinote.scss index d6515811f..2141cd55f 100644 --- a/app/assets/stylesheets/themes/scinote.scss +++ b/app/assets/stylesheets/themes/scinote.scss @@ -632,7 +632,6 @@ ul.double-line > li { } #project-show, -#project-show-archive, #module-archive, #result-archive { .panel-default { diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 79c506c29..429b9a51f 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -11,13 +11,13 @@ class ProjectsController < ApplicationController helper_method :current_folder before_action :switch_team_with_param, only: :index - before_action :load_vars, only: %i(show edit update notifications experiment_archive sidebar experiments_cards) - before_action :load_current_folder, only: %i(index cards new show experiment_archive) - before_action :check_view_permissions, only: %i(show notifications experiment_archive sidebar experiments_cards) + before_action :load_vars, only: %i(show edit update notifications sidebar experiments_cards) + before_action :load_current_folder, only: %i(index cards new show) + before_action :check_view_permissions, only: %i(show notifications sidebar experiments_cards) before_action :check_create_permissions, only: %i(new create) before_action :check_manage_permissions, only: :edit before_action :set_inline_name_editing, only: %i(show) - before_action :load_exp_sort_var, only: %i(show experiment_archive) + before_action :load_exp_sort_var, only: %i(show) before_action :reset_invalid_view_state, only: %i(index cards) layout 'fluid' @@ -258,6 +258,9 @@ class ProjectsController < ApplicationController def show # This is the "info" view current_team_switch(@project.team) + + view_state = @project.current_view_state(current_user) + @current_sort = view_state.state.dig('experiments', experiments_view_mode(@project), 'sort') || 'atoz' end def experiments_cards @@ -287,10 +290,6 @@ class ProjectsController < ApplicationController end end - def experiment_archive - current_team_switch(@project.team) - end - def users_filter users = current_team.users.search(false, params[:query]).map do |u| { value: u.id, label: sanitize_input(u.name), params: { avatar_url: avatar_path(u, :icon_small) } } @@ -349,7 +348,6 @@ class ProjectsController < ApplicationController @project.save end @current_sort = @project.experiments_order || 'new' - @current_sort = 'new' if @current_sort.include?('arch') && action_name != 'experiment_archive' end def filters_included? diff --git a/app/helpers/global_activities_helper.rb b/app/helpers/global_activities_helper.rb index 1e95c8afc..dbebb23e5 100644 --- a/app/helpers/global_activities_helper.rb +++ b/app/helpers/global_activities_helper.rb @@ -63,7 +63,7 @@ module GlobalActivitiesHelper when Experiment return current_value unless obj.navigable? - path = obj.archived? ? experiment_archive_project_path(obj.project) : canvas_experiment_path(obj) + path = obj.archived? ? project_path(obj.project, view_mode: :archived) : canvas_experiment_path(obj) when MyModule return current_value unless obj.navigable? diff --git a/app/views/global_activities/references/_experiment.html.erb b/app/views/global_activities/references/_experiment.html.erb index 5c8842700..7f3ac622c 100644 --- a/app/views/global_activities/references/_experiment.html.erb +++ b/app/views/global_activities/references/_experiment.html.erb @@ -3,7 +3,7 @@
<%= image_tag 'icon_small/experiment.svg' %> <% if subject&.navigable? %> - <% path = subject.archived? ? experiment_archive_project_path(subject.project) : canvas_experiment_path(subject) %> + <% path = subject.archived? ? project_path(subject.project, view_mode: :archived) : canvas_experiment_path(subject) %> <%= route_to_other_team(path, team, subject.name&.truncate(Constants::NAME_TRUNCATION_LENGTH), diff --git a/app/views/projects/experiment_archive.html.erb b/app/views/projects/experiment_archive.html.erb deleted file mode 100644 index 423e6f608..000000000 --- a/app/views/projects/experiment_archive.html.erb +++ /dev/null @@ -1,26 +0,0 @@ -<% provide(:head_title, t("projects.experiment_archive.head_title", project: h(@project.name)).html_safe) %> -<% provide(:sidebar_title, t("sidebar.experiments.sidebar_title_archived")) %> -<% provide(:sidebar_url, project_sidebar_path(@project)) %> -<% provide(:container_class, 'no-second-nav-container') %> -<%= content_for :sidebar do %> - <%= render partial: 'shared/sidebar/experiments.html.erb', locals: { project: @project, archived: true } %> -<% end %> - -
- <%= render partial: 'projects/show/header' %> - <% if @project.archived_experiments.count > 0 %> -
- <% @project.sorted_experiments(@current_sort, true).each_with_index do |experiment, i| %> - <%= render partial: "projects/show/experiment.html.erb", locals: { experiment: experiment} %> - <% end %> -
- <% else %> -
-
- <%=t "projects.experiment_archive.no_archived_experiments" %> -
-
- <% end %> -
- -<%= javascript_include_tag("projects/show") %> diff --git a/app/views/projects/index/_project_card.html.erb b/app/views/projects/index/_project_card.html.erb index 6d0b12381..e4a3b0efe 100644 --- a/app/views/projects/index/_project_card.html.erb +++ b/app/views/projects/index/_project_card.html.erb @@ -13,7 +13,7 @@
<% if project.archived? %> - <%= link_to project_url(project, archived: :true) do %> + <%= link_to project_url(project, view_mode: :archived) do %>

<%= project.name %>

diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index a9f73b310..8693148fa 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -1,5 +1,5 @@ <% provide(:head_title, t("projects.show.head_title", project: h(@project.name)).html_safe) %> -<% provide(:sidebar_title, t("sidebar.experiments.sidebar_title")) %> +<% provide(:sidebar_title, experiments_view_mode(@project) == 'archived' ? t("sidebar.experiments.sidebar_title_archived") : t("sidebar.experiments.sidebar_title")) %> <% provide(:sidebar_url, sidebar_project_path(@project)) %> <% provide(:container_class, 'no-second-nav-container') %> diff --git a/app/views/shared/sidebar/_archived_my_modules.html.erb b/app/views/shared/sidebar/_archived_my_modules.html.erb index d0c98307a..9e63b5e8e 100644 --- a/app/views/shared/sidebar/_archived_my_modules.html.erb +++ b/app/views/shared/sidebar/_archived_my_modules.html.erb @@ -1,7 +1,7 @@