9426: tags display
[arvados.git] / apps / workbench / app / views / collections / _show_tags.html.erb
1 <%
2   object = @object unless object
3 %>
4
5   <div class="collection-tags-container" style="padding-left:2em;padding-right:2em;">
6     <% if object.editable? %>
7       <p title="Edit tags" id="edit-collection-tags">
8         <button type="button" class="btn btn-primary edit-collection-tags">Edit</button>
9       </p>
10     <% end %>
11
12     <table class="table table-condensed table-fixedlayout collection-tags-table" border="1">
13       <colgroup>
14         <col width="5%" />
15         <col width="25%" />
16         <col width="70%" />
17       </colgroup>
18
19       <thead>
20         <tr>
21           <th></th>
22           <th>Key</th>
23           <th>Value</th>
24         </tr>
25       </thead>
26
27       <tbody class="collection-tag-rows">
28         <%= render partial: 'show_tag_rows', locals: {object: object} %>
29       </tbody>
30     </table>
31     <div>
32       <% if object.editable? %>
33         <div class="pull-left">
34           <button class="btn btn-primary btn-sm collection-tag-add hide"><i class="glyphicon glyphicon-plus"></i> Add new tag </button>
35         </div>
36         <div class="pull-right">
37           <%= link_to(save_tags_collection_path, {class: 'btn btn-sm btn-primary collection-tag-save hide', :remote => true, method: 'post', return_to: request.url}) do %>
38             Save
39           <% end %>
40           <%= link_to(tags_collection_path, {class: 'btn btn-sm btn-primary collection-tag-cancel hide', :remote => true, method: 'post', return_to: request.url}) do %>
41             Cancel
42           <% end %>
43         </div>
44
45         <div><div class="collection-tags-status"/></div></div>
46       <% end %>
47     </div>
48   </div>