Skip to content

Commit

Permalink
Merge pull request seek4science#1764 from ELIXIR-Belgium/make_single_…
Browse files Browse the repository at this point in the history
…pages_name_variable

Make View names variable + fix upload feature from default view
  • Loading branch information
kdp-cloud authored Feb 29, 2024
2 parents 5e7c61a + 5c1326a commit fb7fa84
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 45 deletions.
8 changes: 4 additions & 4 deletions app/views/assays/_buttons.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
<% if Seek::Config.project_single_page_enabled %>
<% if !displaying_single_page? %>
<span>
<%= button_link_to("Single Page", 'sop', single_page_path(id: item.projects.first.id, item_type: 'assay', item_id: item.id)) -%>
<span title="<%= t("info_text.single_page") %>">
<%= button_link_to(t('single_page'), 'sop', single_page_path(id: item.projects.first.id, item_type: 'assay', item_id: item.id)) -%>
</span>
<% else %>
<span>
<%= button_link_to("Default View", 'sop', assay_path(item.id)) -%>
<span title="<%= t('info_text.default_view') %>">
<%= button_link_to(t('default_view'), 'sop', assay_path(item.id)) -%>
</span>
<% end %>
<% end -%>
Expand Down
16 changes: 10 additions & 6 deletions app/views/assays/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,18 @@
<% if Seek::Config.isa_json_compliance_enabled && @assay.is_isa_json_compliant? %>
<%= tab_pane('assay_design') do %>
<%= render :partial=>"isa_assays/assay_design", locals: { assay: @assay} -%>
<%= render partial: 'single_pages/change_batch_persmission_modal' %>
<%= render partial: 'single_pages/upload_excel_modal' %>
<% end %>
<% end %>
</div>
<script>
const isIsaCompliant = <%= @assay.is_isa_json_compliant? %>
if (isIsaCompliant) {
var id = <%= @assay.id %>;
var pid = <%= @assay.projects.first.id %>;
var dynamicTableDataPath = '<%= Seek::Util.routes.dynamic_table_data_single_page_path(@assay.projects.first.id) %>';
}
const projectDefaultPolicy = '<%= @assay.projects.first.default_policy_id %>';
const isIsaCompliant =
<%= @assay.is_isa_json_compliant? %>
if (isIsaCompliant) {
var id = <%= @assay.id %>;
var pid = <%= @assay.projects.first.id %>;
var dynamicTableDataPath = '<%= Seek::Util.routes.dynamic_table_data_single_page_path(@assay.projects.first.id) %>';
}
</script>
8 changes: 4 additions & 4 deletions app/views/investigations/_buttons.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<% if Seek::Config.project_single_page_enabled %>
<% if !displaying_single_page? %>
<span>
<%= button_link_to("Single Page", 'sop', single_page_path(id: item.projects.first.id, item_type: 'investigation', item_id: item.id)) -%>
<span title="<%= t("info_text.single_page") %>">
<%= button_link_to(t('single_page'), 'sop', single_page_path(id: item.projects.first.id, item_type: 'investigation', item_id: item.id)) -%>
</span>
<% else %>
<span>
<%= button_link_to("Default View", 'sop', investigation_path(item.id)) -%>
<span title="<%= t('info_text.default_view') %>">
<%= button_link_to(t('default_view'), 'sop', investigation_path(item.id)) -%>
</span>
<% end %>
<% end -%>
Expand Down
8 changes: 4 additions & 4 deletions app/views/projects/_buttons.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<% if Seek::Config.project_single_page_enabled %>
<% if !displaying_single_page? %>
<span>
<%= button_link_to("Single Page", 'sop', single_page_path(item.id)) -%>
<span title="<%= t("info_text.single_page") %>">
<%= button_link_to(t("single_page"), 'sop', single_page_path(item.id)) -%>
</span>
<% else %>
<span>
<%= button_link_to("Default View", 'sop', project_path(item.id)) -%>
<span title="<%= t('info_text.default_view') %>">
<%= button_link_to(t('default_view'), 'sop', project_path(item.id)) -%>
</span>
<% end %>
<% end -%>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<%= modal(id: 'change-batch-permission-modal', size: 'xl') do %>
<%= modal_header("Batch permission changes") %>
<%= modal_body do %>
<div id="change-batch-permission">
hello
</div>
<% end %>
<% end %>
6 changes: 6 additions & 0 deletions app/views/single_pages/_upload_excel_modal.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<%= modal(id: 'upload-excel-modal', size: 'xl') do %>
<%= modal_header("Upload from spreadsheet") %>
<%= modal_body do %>
<div id="upload-excel">...</div>
<% end %>
<% end %>
18 changes: 2 additions & 16 deletions app/views/single_pages/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,8 @@

<div id="provide-metadata-content"></div>

<%= modal(id: 'change-batch-permission-modal', size: 'xl') do %>
<%= modal_header("Batch permission changes") %>
<%= modal_body do %>
<div id="change-batch-permission">
hello
</div>
<% end %>
<% end %>
<%= modal(id: 'upload-excel-modal', size: 'xl') do %>
<%= modal_header("Upload from spreadsheet") %>
<%= modal_body do %>
<div id="upload-excel">...</div>
<% end %>
<% end %>

<%= render partial: 'change_batch_persmission_modal' %>
<%= render partial: 'upload_excel_modal' %>
</div>

<script type="text/javascript">
Expand Down
8 changes: 4 additions & 4 deletions app/views/studies/_buttons.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<% if Seek::Config.project_single_page_enabled %>
<% if !displaying_single_page? %>
<span>
<%= button_link_to("Single Page", 'sop', single_page_path(id: item.projects.first.id, item_type: 'study', item_id: item.id)) -%>
<span title="<%= t("info_text.single_page") %>">
<%= button_link_to(t("single_page"), 'sop', single_page_path(id: item.projects.first.id, item_type: 'study', item_id: item.id)) -%>
</span>
<% else %>
<span>
<%= button_link_to("Default View", 'sop', study_path(item.id)) -%>
<span title="<%= t('info_text.default_view') %>">
<%= button_link_to(t('default_view'), 'sop', study_path(item.id)) -%>
</span>
<% end %>
<% end -%>
Expand Down
18 changes: 11 additions & 7 deletions app/views/studies/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,19 @@
<% if Seek::Config.isa_json_compliance_enabled && @study.is_isa_json_compliant?%>
<%= tab_pane('study_design') do %>
<%= render :partial=>"isa_studies/study_design", locals: { study: @study} -%>
<% end %>
<%= render partial: 'single_pages/change_batch_persmission_modal' %>
<%= render partial: 'single_pages/upload_excel_modal' %>
<% end %>
<% end %>

</div>
<script>
const isIsaCompliant = <%= @study.is_isa_json_compliant? %>
if (isIsaCompliant) {
var id = <%= @study.id %>;
var pid = <%= @study.projects.first.id %>;
var dynamicTableDataPath = '<%= Seek::Util.routes.dynamic_table_data_single_page_path(@study.projects.first.id) %>';
}
const projectDefaultPolicy = '<%= @study.projects.first.default_policy_id %>';
const isIsaCompliant =
<%= @study.is_isa_json_compliant? %>
if (isIsaCompliant) {
var id = <%= @study.id %>;
var pid = <%= @study.projects.first.id %>;
var dynamicTableDataPath = '<%= Seek::Util.routes.dynamic_table_data_single_page_path(@study.projects.first.id) %>';
}
</script>
4 changes: 4 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ en:
ldap: 'LDAP'
github: 'GitHub'

single_page: "Single Page"
default_view: "Default View"
investigation: &investigation "Investigation"
study: &study "Study"
assay: &assay "Assay"
Expand Down Expand Up @@ -292,6 +294,8 @@ you can choose to have a %{project} linked to a site managed %{programme} instea
<p>'

info_text:
default_view: "The default view used to visualize your experiments."
single_page: "A view specifically designed to visualize and interact with your experiments."
institution: "An Institution in SEEK is where someone is employed or works or a person's affiliation."
#person: "A Person (People) in SEEK is a registered user or a Profile of a person that has not registered with SEEK. A Person is someone who participates directly or indirectly in the scientific research described within SEEK."
programme: "A Programme is an umbrella to group one or more Projects."
Expand Down

0 comments on commit fb7fa84

Please sign in to comment.