2021-06-10 16:59:34 +08:00
|
|
|
<% my_module ||= report_element.my_module %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<% timestamp = my_module.created_at %>
|
2021-06-08 20:21:34 +08:00
|
|
|
<% export_all = defined?(export_all) && export_all %>
|
2021-06-10 16:59:34 +08:00
|
|
|
<div class="report-element report-module-element">
|
2016-02-12 23:52:43 +08:00
|
|
|
<div class="report-element-body">
|
2022-07-21 15:57:28 +08:00
|
|
|
<h4 class="module-name">
|
2022-05-31 20:40:25 +08:00
|
|
|
<%= link_to my_module.name, protocols_my_module_url(my_module), target: :_blank %>
|
|
|
|
<% if my_module.archived? %>
|
|
|
|
<span class="label label-warning"><%= t('search.index.archived') %></span>
|
|
|
|
<% end %>
|
2022-07-21 15:57:28 +08:00
|
|
|
</h4>
|
2022-05-31 20:40:25 +08:00
|
|
|
<div class="user-time">
|
2022-11-29 15:38:08 +08:00
|
|
|
<%= t('projects.reports.elements.module.user_time', code: my_module.code, timestamp: l(timestamp, format: :full)) %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
2020-07-23 20:24:30 +08:00
|
|
|
<p class="module-start-date">
|
|
|
|
<% if my_module.started_on.present? %>
|
|
|
|
<%= t('projects.reports.elements.module.started_on', started_on: l(my_module.started_on, format: :full)) %>
|
|
|
|
<% end %>
|
|
|
|
</p>
|
|
|
|
<p class="module-due-date">
|
|
|
|
<% if my_module.due_date.present? %>
|
2021-06-10 16:59:34 +08:00
|
|
|
<%= t('projects.reports.elements.module.due_date', due_date: l(my_module.due_date, format: :full)) %>
|
2020-07-23 20:24:30 +08:00
|
|
|
<% end %>
|
|
|
|
</p>
|
|
|
|
<p class="module-status">
|
|
|
|
<% status = my_module.my_module_status %>
|
2021-06-10 16:59:34 +08:00
|
|
|
<%= t('projects.reports.elements.module.status') %>
|
2023-08-24 14:31:07 +08:00
|
|
|
<span class="status-block" style="background: <%= status.color %>;
|
2023-08-24 20:52:11 +08:00
|
|
|
<%= 'color: #000000; border: 1px solid #D0D5DD;' if status.light_color? %>">
|
2021-06-10 16:59:34 +08:00
|
|
|
<%= status.name %>
|
|
|
|
</span>
|
2020-09-09 16:46:21 +08:00
|
|
|
<% if my_module.completed? %>
|
|
|
|
<span style="margin-left: 10px;">
|
2021-06-10 16:59:34 +08:00
|
|
|
<%= t('my_modules.states.completed') %>
|
2020-09-09 16:46:21 +08:00
|
|
|
<%= l(my_module.completed_on, format: :full) %>
|
|
|
|
</span>
|
|
|
|
<% end %>
|
2020-07-23 20:24:30 +08:00
|
|
|
</p>
|
2016-02-12 23:52:43 +08:00
|
|
|
<div class="row module-tags">
|
|
|
|
<div class="pull-left">
|
2021-06-10 16:59:34 +08:00
|
|
|
<%= t('projects.reports.elements.module.tags_header') %>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
2022-10-13 19:55:36 +08:00
|
|
|
<% if (tags = my_module.tags.order(:id)).present? %>
|
|
|
|
<% tags.each do |tag| %>
|
2016-02-12 23:52:43 +08:00
|
|
|
<div class="pull-left module-tag" style="background-color: <%= tag.color %>;">
|
|
|
|
<%= tag.name %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2020-07-23 20:24:30 +08:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-12">
|
|
|
|
<% if my_module.description.present? %>
|
2023-10-09 16:41:10 +08:00
|
|
|
<%= custom_auto_link(my_module.prepare_for_report(:description),
|
2020-07-23 20:24:30 +08:00
|
|
|
team: current_team,
|
2020-09-08 22:10:24 +08:00
|
|
|
simple_format: false,
|
2023-10-09 16:41:10 +08:00
|
|
|
base64_encoded_imgs: true) %>
|
2020-07-23 20:24:30 +08:00
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-02-12 23:52:43 +08:00
|
|
|
</div>
|
2021-04-27 16:15:48 +08:00
|
|
|
<div class="report-element-children">
|
2023-10-09 16:41:10 +08:00
|
|
|
<%= render partial: 'reports/elements/my_module_protocol_element', locals: { protocol: my_module.protocol, export_all: true } %>
|
2021-04-27 16:15:48 +08:00
|
|
|
|
|
|
|
<% filter_steps_for_report(my_module.protocol.steps, @settings).order(:position).each do |step| %>
|
2023-06-21 20:13:20 +08:00
|
|
|
<%= render partial: 'reports/elements/my_module_step_element', locals: { step: step, export_all: export_all } %>
|
2021-04-27 16:15:48 +08:00
|
|
|
<% end %>
|
|
|
|
|
2022-06-24 20:34:00 +08:00
|
|
|
|
2023-08-16 20:55:59 +08:00
|
|
|
<% if %w(file_results table_results text_results).any? { |k| @settings.dig('task', k) } %>
|
|
|
|
<div class="results-title-name">
|
|
|
|
<%= t('projects.reports.elements.module.results') %>
|
|
|
|
</div><br>
|
|
|
|
<% end %>
|
2022-07-21 15:57:28 +08:00
|
|
|
|
2021-05-11 16:12:03 +08:00
|
|
|
<% order_results_for_report(my_module.results, @settings.dig('task', 'result_order')).each do |result| %>
|
2023-10-05 19:25:08 +08:00
|
|
|
<div class="result-name">
|
|
|
|
<%= result.name.presence || I18n.t('projects.reports.unnamed') %>
|
|
|
|
<% if result.archived? %>
|
|
|
|
<span class="label label-warning"><%= t('search.index.archived') %></span>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2023-09-14 10:25:38 +08:00
|
|
|
|
|
|
|
<% result.result_orderable_elements.each do |element| %>
|
|
|
|
<% if element.orderable_type == "ResultTable" %>
|
|
|
|
<%= render partial: 'reports/elements/my_module_result_table_element', locals: { result: result, export_all: export_all, element: element} %>
|
|
|
|
<% elsif element.orderable_type == "ResultText" %>
|
2023-10-09 16:41:10 +08:00
|
|
|
<%= render partial: 'reports/elements/my_module_result_text_element', locals: { result: result, export_all: true, element: element } %>
|
2023-09-14 10:25:38 +08:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2023-10-09 16:41:10 +08:00
|
|
|
|
|
|
|
<%= render partial: 'reports/elements/my_module_result_asset_element', locals: { result: result, report: report, export_all: export_all } %>
|
|
|
|
<div class="user-time">
|
|
|
|
<%= t('projects.reports.elements.result.user_time', user: result.user.full_name, timestamp: l(result.created_at, format: :full)) %>
|
|
|
|
</div>
|
|
|
|
|
2023-10-05 19:25:08 +08:00
|
|
|
<div class="report-element-children">
|
|
|
|
<% if @settings.dig('task', 'result_comments') %>
|
|
|
|
<%= render partial: 'reports/elements/result_comments_element', locals: { result: result } %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2021-04-27 16:15:48 +08:00
|
|
|
<% end %>
|
2022-07-21 15:57:28 +08:00
|
|
|
</div><br>
|
2021-05-20 20:16:39 +08:00
|
|
|
|
|
|
|
<% if defined?(children) %>
|
|
|
|
<div class="report-element-children">
|
|
|
|
<%= children %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
2021-05-11 23:09:39 +08:00
|
|
|
<% if @settings.dig('task', 'activities') %>
|
|
|
|
<div class="report-element-children">
|
2023-10-09 16:41:10 +08:00
|
|
|
<%= render partial: 'reports/elements/my_module_activity_element', locals: { my_module: my_module, export_all: true } %>
|
2021-05-11 23:09:39 +08:00
|
|
|
</div>
|
|
|
|
<% end %>
|
2016-07-29 16:42:29 +08:00
|
|
|
</div>
|