scinote-web/app/views/my_modules/results.html.erb

101 lines
5.8 KiB
Text
Raw Normal View History

<% provide(:head_title, t("my_modules.results.head_title", project: h(@project.name), module: h(@my_module.name)).html_safe) %>
<% provide(:sidebar_title, t("sidebar.my_module.sidebar_title")) %>
<%= content_for :sidebar do %>
<%= render partial: "shared/sidebar/#{@my_module.archived_branch? ? 'archived_my_module' : 'my_module'}.html.erb",
2021-06-18 22:52:19 +08:00
locals: {
my_modules: @experiment_my_modules,
experiment: @my_module.experiment,
current_my_module: @my_module
}
%>
<% end %>
<%= render partial: 'shared/drag_n_drop_overlay' %>
2019-03-18 02:23:17 +08:00
<%= render partial: 'assets/wopi/create_wopi_file_modal' %>
2023-05-15 20:17:41 +08:00
<% provide(:container_class, 'no-second-nav-container') %>
2016-02-12 23:52:43 +08:00
2023-05-15 20:17:41 +08:00
<div class="content-pane flexible">
<%= render partial: 'my_modules/header' %>
<div class="mt-5" id="results-toolbar">
<% if can_manage_my_module?(@my_module) %>
2020-07-28 21:39:29 +08:00
<div class="add-result-dropdown dropdown sci-dropdown">
<a href="#" id="add-result-button" class="btn btn-secondary" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
2023-06-08 14:33:37 +08:00
<span class="sn-icon sn-icon-new-task"></span>
2020-07-28 21:39:29 +08:00
<span><%= t("my_modules.results.add_label") %></span>
<span class="caret pull-right"></span>
</a>
<ul class="dropdown-menu add-result-dropdown" aria-labelledby="add-result-button">
<li id="new-result-text" data-href="<%= new_my_module_result_text_path(my_module_id: @my_module.id, page: params[:page], order: params[:order]) %>">
<i class="fas fa-font"></i><%= t("my_modules.results.new_text_result") %>
</li>
<li id="new-result-table" data-href="<%= new_my_module_result_table_path(my_module_id: @my_module.id, page: params[:page], order: params[:order]) %>">
2023-06-08 14:33:37 +08:00
<i class="sn-icon sn-icon-tables"></i><%= t("my_modules.results.new_table_result") %>
2020-07-28 21:39:29 +08:00
</li>
<li id="new-result-asset" data-href="<%= new_my_module_result_asset_path(my_module_id: @my_module.id, page: params[:page], order: params[:order]) %>">
2023-06-08 14:33:37 +08:00
<i class="sn-icon sn-icon-files"></i><%= t("my_modules.results.new_asset_result") %>
2020-07-28 21:39:29 +08:00
</li>
<%= render partial: '/assets/marvinjs/create_marvin_sketch_li',
2020-03-23 00:47:13 +08:00
locals: { element_id: @my_module.id, element_type: 'Result', sketch_container: "#results[data-module-id=#{@my_module.id}]" } %>
<%= render partial: '/assets/bio_eddie/create_bio_eddie_li.html.erb',
locals: { element_id: @my_module.id, element_type: 'Result', assets_container:"#results[data-module-id=#{@my_module.id}]" } %>
2020-07-28 21:39:29 +08:00
<%= render partial: "assets/wopi/create_wopi_file_li",
2020-03-23 00:47:13 +08:00
locals: { element_id: @my_module.id, element_type: 'Result' } %>
2020-07-28 21:39:29 +08:00
</ul>
</div>
<% end %>
<div class="sci-btn-group collapse-expand-result">
2020-07-28 21:39:29 +08:00
<button class="btn btn-light" id="results-collapse-btn">
2023-06-08 14:33:37 +08:00
<span class="sn-icon sn-icon-open-show"></span>
2020-07-28 21:39:29 +08:00
<span class="hidden-xs-custom"><%= t'my_modules.results.collapse_label' %></span>
</button>
<button class="btn btn-light" id="results-expand-btn">
2023-06-09 00:12:28 +08:00
<span class="sn-icon sn-icon-down"></span>
2020-07-28 21:39:29 +08:00
<span class="hidden-xs-custom"><%= t'my_modules.results.expand_label' %></span>
</button>
</div>
<div class="sort-result-dropdown dropdown">
<button id="sort-result-button" class="btn btn-light icon-btn" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
2023-06-08 14:33:37 +08:00
<i class="sn-icon sn-icon-sort-up"></i>
2020-07-28 21:39:29 +08:00
</button>
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="sort-result-button">
<li><%= link_to t('general.sort_new.atoz'), results_my_module_path(@my_module, page: params[:page], order: 'atoz'), class: (@results_order == 'atoz' ? 'selected' : '') %></li>
<li><%= link_to t('general.sort_new.ztoa'), results_my_module_path(@my_module, page: params[:page], order: 'ztoa'), class: (@results_order == 'ztoa' ? 'selected' : '') %></li>
<li><%= link_to t('general.sort_new.old'), results_my_module_path(@my_module, page: params[:page], order: 'old'), class: (@results_order == 'old' ? 'selected' : '') %></li>
<li><%= link_to t('general.sort_new.new'), results_my_module_path(@my_module, page: params[:page], order: 'new'), class: (@results_order == 'new' ? 'selected' : '') %></li>
<li><%= link_to t('general.sort_new.old_updated'), results_my_module_path(@my_module, page: params[:page], order: 'old_updated'), class: (@results_order == 'old_updated' ? 'selected' : '') %></li>
<li><%= link_to t('general.sort_new.new_updated'), results_my_module_path(@my_module, page: params[:page], order: 'new_updated'), class: (@results_order == 'new_updated' ? 'selected' : '') %></li>
2020-07-28 21:39:29 +08:00
</ul>
</div>
</div>
2016-02-12 23:52:43 +08:00
<div style="height: 15px;"></div>
2016-02-12 23:52:43 +08:00
<div id="results" data-module-id="<%= @my_module.id %>" data-task-id="<%= @my_module.id %>">
2020-07-16 21:42:52 +08:00
<% @results.each do |result| %>
<%= render partial: "result", locals: { result: result } %>
<% end %>
</div>
2020-07-16 21:42:52 +08:00
<div class="kaminari-pagination">
<%= paginate @results, outer_window: 1, window: 1 %>
</div>
2016-02-12 23:52:43 +08:00
</div>
<%= render partial: "shared/bio_eddie_modal.html.erb" %>
<%= javascript_include_tag "handsontable.full" %>
2016-09-05 19:54:20 +08:00
<!-- Libraries for formulas -->
<%= render partial: "shared/formulas_libraries.html.erb" %>
<%= javascript_include_tag "assets/wopi/create_wopi_file", nonce: true %>
<%= javascript_include_tag "my_modules/results", nonce: true %>
<%= javascript_include_tag "results/result_texts", nonce: true %>
<%= javascript_include_tag "results/result_tables", nonce: true %>
<%= javascript_include_tag "results/result_assets", nonce: true %>
<%= javascript_include_tag 'pdf_js', nonce: true %>
<%= stylesheet_link_tag 'pdf_js_styles' %>
2022-09-09 21:42:53 +08:00
<%= render 'shared/tiny_mce_packs' %>
<%= render partial: 'label_printers/label_printer_modal' %>