mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-04 19:53:19 +08:00
Fix archived forms view [SCI-11417]
This commit is contained in:
parent
c572c85eec
commit
d680f28f81
5 changed files with 15 additions and 18 deletions
|
@ -184,7 +184,7 @@ class FormsController < ApplicationController
|
|||
private
|
||||
|
||||
def set_breadcrumbs_items
|
||||
archived = params[:view_mode] || (@form&.archived? && 'archived')
|
||||
archived = params[:view_mode] == 'archived' || @form&.archived?
|
||||
|
||||
@breadcrumbs_items = []
|
||||
@breadcrumbs_items.push({ label: t('breadcrumbs.templates') })
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module ProtocolsHelper
|
||||
def templates_view_mode_archived?(type: nil, protocol: nil)
|
||||
type == :archived || protocol&.archived?
|
||||
end
|
||||
end
|
|
@ -2,8 +2,12 @@
|
|||
<div class="content-header sticky-header">
|
||||
<div class="title-row">
|
||||
<h1>
|
||||
<%= t('forms.index.head_title') %>
|
||||
</h1>
|
||||
<% if params[:view_mode] == 'archived' %>
|
||||
<%= t('labels.archived')%>
|
||||
<%= t('forms.index.head_title_archived') %>
|
||||
<% else %>
|
||||
<%= t('forms.index.head_title') %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<div id="formsTable" class="fixed-content-body"
|
||||
|
|
|
@ -14,14 +14,14 @@
|
|||
<div class="content-pane flexible protocols-index <%= @type %>">
|
||||
<div class="content-header sticky-header">
|
||||
<div class="title-row" data-e2e="e2e-TX-protocolTemplates-title">
|
||||
<% if templates_view_mode_archived?(type: @type) %>
|
||||
<h1>
|
||||
<span><%= t('labels.archived')%></span>
|
||||
<h1>
|
||||
<% if params[:view_mode] == 'archived' %>
|
||||
<%= t('labels.archived')%>
|
||||
<%= t('protocols.index.head_title_archived') %>
|
||||
</h1>
|
||||
<% else %>
|
||||
<h1><%= t('protocols.index.head_title') %></h1>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= t('protocols.index.head_title') %>
|
||||
<% end %>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="protocols-container" data-e2e="e2e-CO-protocolTemplates">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<ul class="sidebar-branch">
|
||||
<% if templates_view_mode_archived?(type: @type, protocol: @protocol) %>
|
||||
<% if params[:view_mode] == 'archived' %>
|
||||
<li class="sidebar-leaf">
|
||||
<%= link_to protocols_path, class: "sidebar-link back-button" do %>
|
||||
<%= t("protocols.index.back_to_active_protocols") %>
|
||||
|
|
Loading…
Reference in a new issue