mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 23:16:15 +08:00
Update reports for new RTE [SCI-3263] (#1691)
* Update reports for new RTE
This commit is contained in:
parent
0cf688be39
commit
1a860037f7
|
@ -180,7 +180,7 @@ function initializeNewElement(newEl) {
|
|||
switch (parent.data("type")) {
|
||||
case "experiment":
|
||||
url = dh.data("add-experiment-contents-url"); break;
|
||||
case "my_module":
|
||||
case 'my_module' || 'protocol':
|
||||
url = dh.data("add-module-contents-url"); break;
|
||||
case "step":
|
||||
url = dh.data("add-step-contents-url"); break;
|
||||
|
|
|
@ -258,6 +258,7 @@ label {
|
|||
.module-name {
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
.module-tags {
|
||||
margin-left: 0;
|
||||
margin-top: 10px;
|
||||
|
@ -275,6 +276,12 @@ label {
|
|||
}
|
||||
}
|
||||
|
||||
.module-protocol-description {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
&:hover > .report-element-body .module-name {
|
||||
color: $brand-primary;
|
||||
}
|
||||
|
|
|
@ -69,6 +69,14 @@ module ReportActions
|
|||
|
||||
def generate_module_contents_json(my_module)
|
||||
res = []
|
||||
|
||||
res << generate_new_el(false)
|
||||
el = generate_el(
|
||||
'reports/elements/my_module_protocol_element.html.erb',
|
||||
protocol: my_module.protocol
|
||||
)
|
||||
res << el
|
||||
|
||||
ReportExtends::MODULE_CONTENTS.each do |contents|
|
||||
elements = []
|
||||
contents.values.each do |element|
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<% if my_module.description.present? %>
|
||||
<%= custom_auto_link(my_module.tinymce_render(:description), team: current_team) %>
|
||||
<%= custom_auto_link(my_module.prepare_for_report(:description), team: current_team) %>
|
||||
<% else %>
|
||||
<em><%=t "projects.reports.elements.module.no_description" %></em>
|
||||
<% end %>
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
<div class="report-element report-module-protocol-element" data-ts="<%= protocol.created_at %>" data-type="protocol" data-id='{ "protocol_id": <%= protocol.id %> }' data-scroll-id="<%= protocol.id %>">
|
||||
<div class="report-element-header">
|
||||
<div class="row">
|
||||
<div class="pull-left user-time">
|
||||
<%=t "projects.reports.elements.module.protocol.user_time", timestamp: l(protocol.created_at, format: :full) %>
|
||||
</div>
|
||||
<div class="pull-right controls">
|
||||
<%= render partial: "reports/elements/element_controls.html.erb", locals: { show_sort: true } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="report-element-body">
|
||||
<div class="row module-protocol-description">
|
||||
<% if protocol.description.present? %>
|
||||
<%= custom_auto_link(protocol.prepare_for_report(:description), team: current_team) %>
|
||||
<% else %>
|
||||
<em><%= t('my_modules.protocols.protocol_status_bar.no_description') %></em>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
|
@ -476,6 +476,8 @@ en:
|
|||
no_description: "No description"
|
||||
tags_header: "Task tags:"
|
||||
no_tags: "No tags"
|
||||
protocol:
|
||||
user_time: "Protocol created on %{timestamp}."
|
||||
experiment:
|
||||
user_time: "Experiment created on %{timestamp}."
|
||||
no_description: "No description"
|
||||
|
|
Loading…
Reference in a new issue