scinote-web/app/views/steps/attachments/_list.html.erb

47 lines
1.9 KiB
Plaintext
Raw Normal View History

<% assets = ordered_assets step %>
<hr>
<div class="col-xs-12">
<h4>
2019-04-09 18:28:42 +08:00
<%= t('protocols.steps.files', count: assets.count) %>
</h4>
</div>
<div class="col-xs-12 attachments-actions">
<div class="col-md-4 drag_n_drop_label">
</div>
2019-04-27 02:33:20 +08:00
<div class="col-xl-8 col-md-12">
<div class="attachemnts-header pull-right">
2019-04-27 00:24:21 +08:00
<%= render partial: '/assets/marvinjs/create_marvin_sketch_button.html.erb',
locals: { element_id: step.id, element_type: 'Step' } %>
2019-04-09 18:28:42 +08:00
<%= render partial: '/assets/wopi/create_wopi_file_button.html.erb',
locals: { element_id: step.id, element_type: 'Step' } %>
<div class="dropdown attachments-order" id="dd-att-step-<%= step.id %>">
<button class="btn btn-default dropdown-toggle" type="button" id="sortMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
<span id="dd-att-step-<%= step.id %>-label"><%= t('protocols.steps.attachments.sort_new').html_safe %></span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="sortMenu">
2019-04-09 18:28:42 +08:00
<% ['new', 'old', 'atoz', 'ztoa'].each do |sort| %>
<li>
<a data-order="<%= sort %>" onClick="reorderAttachments('<%= step.id %>', '<%= sort %>')">
<%= t('protocols.steps.attachments.sort_' + sort ).html_safe %></a>
</li>
<% end %>
</ul>
</div>
</div>
</div>
</div>
<div class="col-xs-12 attacments" id="att-<%= step.id %>">
<% assets.each_with_index do |asset, i| %>
2019-04-09 18:28:42 +08:00
<%= render partial: 'steps/attachments/item.html.erb',
locals: { asset: asset, i: i, assets_count: assets.count, step: step } %>
<% end %>
2019-04-27 04:59:38 +08:00
<% step.marvin_js_assets.each_with_index do |sketch, i| %>
<%= render partial: 'assets/marvinjs/marvin_sketch_card.html.erb',
locals: { sketch: sketch} %>
<% end %>
</div>
<hr>