scinote-web/app/views/reports/new.html.erb

100 lines
4.5 KiB
Text
Raw Normal View History

2018-07-19 23:56:42 +08:00
<% content_for :head do %>
<meta name="turbolinks-cache-control" content="no-cache">
<meta name="turbolinks-visit-control" content="reload">
<% end %>
<% provide(:head_title, t("projects.reports.new.head_title", project: h(@project.name)).html_safe) %>
2016-02-12 23:52:43 +08:00
<div id="notifications"></div>
2016-02-12 23:52:43 +08:00
<%= render partial: "reports/new/report_navigation" %>
2018-05-12 00:02:17 +08:00
<div class="content-pane" id="report-new">
<div class="report-container">
<div
id="data-holder"
class="hidden"
data-project-modal-title="<%=t "projects.reports.elements.modals.project_contents.head_title" %>"
data-add-project-contents-url="<%= project_contents_modal_project_reports_url(@project) %>"
data-add-experiment-contents-url="<%= experiment_contents_modal_project_reports_url(@project) %>"
data-add-module-contents-url="<%= module_contents_modal_project_reports_url(@project) %>"
data-add-step-contents-url="<%= step_contents_modal_project_reports_url(@project) %>"
data-add-result-contents-url="<%= result_contents_modal_project_reports_url(@project) %>"
2018-05-12 00:02:17 +08:00
data-stylesheet-url="<%= stylesheet_path "application" %>"
data-print-title="<%=t "projects.reports.print_title", project: @project.name %>"
data-project-id="<%= @project.id %>"
data-save-report-url="<%= save_modal_project_reports_url(@project) %>"
2018-05-12 00:02:17 +08:00
data-report-id="<%= @report.present? ? @report.id : "" %>"
data-unsaved-work-text="<%=t "projects.reports.new.unsaved_work" %>"
data-global-sort-text="<%=t "projects.reports.new.global_sort" %>"></div>
2016-02-12 23:52:43 +08:00
2018-05-12 00:02:17 +08:00
<!-- Report "preview" -->
<div id="report-content">
2016-02-12 23:52:43 +08:00
2018-05-12 00:02:17 +08:00
<% if @report.present? %>
<% @report.root_elements.each do |el| %>
<%= render_report_element(el, local_assigns) %>
2018-05-12 00:02:17 +08:00
<%= render_new_element(false) %>
<% end %>
<% else %>
<%= render partial: "reports/elements/project_header_element", locals: { project: @project } %>
<%= render partial: "reports/elements/new_element", locals: { initial: true } %>
<% end %>
</div>
2016-02-12 23:52:43 +08:00
2018-05-12 00:02:17 +08:00
<!-- Add elements modal -->
<div class="modal" id="add-contents-modal" tabindex="-1" role="dialog" aria-labelledby="add-contents-modal-label">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="add-contents-modal-label"></h4>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"><%=t "general.cancel" %></button>
<button type="button" data-action="add" class="btn btn-success"><%=t "projects.reports.elements.modals.add" %></button>
</div>
</div>
2016-02-12 23:52:43 +08:00
</div>
</div>
2018-05-12 00:02:17 +08:00
<!-- Save report modal -->
<div class="modal" id="save-report-modal" tabindex="-1" role="dialog" aria-labelledby="save-report-modal-label">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="save-report-modal-label"><%=t "projects.reports.elements.modals.save_report.head_title" %></h4>
</div>
<div class="modal-body"></div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"><%=t "general.cancel" %></button>
<button type="button" data-action="save" class="btn btn-success"><%=t "projects.reports.elements.modals.save_report.save" %></button>
</div>
2016-02-12 23:52:43 +08:00
</div>
</div>
</div>
2018-05-12 00:02:17 +08:00
</div>
2016-02-12 23:52:43 +08:00
</div>
<%= render partial: 'reports/new/save_PDF_to_inventory_modal' %>
2016-02-12 23:52:43 +08:00
<%= javascript_include_tag "handsontable.full.min" %>
2016-09-05 21:07:35 +08:00
<!-- Libraries for formulas -->
<%= javascript_include_tag "lodash" %>
<%= javascript_include_tag "numeral" %>
<%= javascript_include_tag "numeric" %>
<%= javascript_include_tag "md5" %>
<%= javascript_include_tag "jstat" %>
<%= javascript_include_tag "formula" %>
<%= javascript_include_tag "parser" %>
<%= javascript_include_tag "ruleJS" %>
<%= javascript_include_tag "handsontable.formula" %>
<%= javascript_include_tag "big.min" %>
2016-09-05 21:07:35 +08:00
<%= stylesheet_link_tag "handsontable.formula" %>
<%= javascript_include_tag("reports/new") %>
<%= javascript_include_tag 'reports/save_pdf_to_inventory' %>