scinote-web/app/views/samples/_info_sample_modal.html.erb

94 lines
3.7 KiB
Text
Raw Normal View History

2016-09-23 23:45:02 +08:00
<div class="modal fade" id="modal-info-sample" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<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>
2016-10-03 15:28:58 +08:00
<h4 class="modal-title"><%= t('samples.modal_info.head_title', sample: @sample.name) %></h4>
2016-09-23 23:45:02 +08:00
</div>
2016-09-28 21:46:41 +08:00
<div class="modal-body">
<p>
<span>
<%= t "samples.modal_info.sample_type" %>
<% if @sample.sample_type.present? %>
<%= @sample.sample_type.name %>
<% else %>
<em><%= t "samples.modal_info.no_type" %></em>
<% end %>
</span>
<br>
<span>
<%= t "samples.modal_info.sample_group" %>
<span class="glyphicon glyphicon-asterisk" style="<%= "color: #{@sample.sample_group.color}" if @sample.sample_group.present? %>"></span>
<% if @sample.sample_group.present? %>
<%= @sample.sample_group.name %>
<% else %>
<em><%= t "samples.modal_info.no_group" %></em>
<% end %>
</span>
<br>
<span>
<%= t "samples.modal_info.added_on" %>
<%= l @sample.created_at, format: :full %>
</span>
<br>
<span>
<%= t "samples.modal_info.added_by" %>
<%= @sample.user.full_name %>
</span>
<% @sample.sample_custom_fields.each do |sample_custom_field| %>
<br>
<span>
<%= t "samples.modal_info.custom_field", cf: sample_custom_field.custom_field.name %>
<%= custom_auto_link(sample_custom_field.value, simple_format: false, team: @team) %>
</span>
<% end %>
</p>
2016-09-28 21:46:41 +08:00
<% if @sample.my_modules.count > 0 %>
2016-10-03 15:28:58 +08:00
<div>
2016-10-03 22:33:58 +08:00
<%= t("samples.modal_info.title", nr: @sample.my_modules.count) %>
2016-10-03 15:28:58 +08:00
</div>
2016-09-28 21:46:41 +08:00
<div class="linked-children-datatable">
<table id="sample-info-table" class="table dataTable no-footer" role="grid">
<tbody>
<% @sample.my_modules.each_with_index do |mod, i| %>
<tr role="row">
<td class="sorting_1">
<ol class='breadcrumb'>
<li><span class='glyphicon glyphicon-blackboard'></span>&nbsp;
<%= render partial: 'search/results/partials/project_text.html.erb',
locals: { project: mod.experiment.project } %>
</li>
<li><i class='fa fa-flask'></i>&nbsp;
<%= render partial: 'search/results/partials/experiment_text.html.erb',
locals: { experiment: mod.experiment } %>
</li>
<li><span class='glyphicon glyphicon-credit-card'></span>&nbsp;
<%= render partial: 'search/results/partials/my_module_text.html.erb',
locals: { my_module: mod, link_to_page: :samples } %>
</li>
</ol>
</td>
</tr>
<% end %>
</tbody>
<thead>
<tr>
<th></th>
</tr>
</thead>
</table>
2016-09-23 23:45:02 +08:00
</div>
2016-09-28 21:46:41 +08:00
<% else %>
2016-10-03 15:28:58 +08:00
<em><%=t "samples.modal_info.no_tasks" %></em>
2016-09-28 21:46:41 +08:00
<% end %>
2016-09-23 23:45:02 +08:00
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal"><%= t("general.close")%></button>
</div>
</div>
</div>
</div>