Merge branch 'master' into 11840-unique-constraint-untrash-coll
[arvados.git] / apps / workbench / app / views / collections / _show_tag_rows.html.erb
diff --git a/apps/workbench/app/views/collections/_show_tag_rows.html.erb b/apps/workbench/app/views/collections/_show_tag_rows.html.erb
new file mode 100644 (file)
index 0000000..eceec10
--- /dev/null
@@ -0,0 +1,31 @@
+<%
+  tags = object.properties[:tags]
+%>
+      <% if tags.andand.is_a?(Hash) %>
+        <% tags.each do |k, v| %>
+          <tr class="collection-tag-<%=k%>">
+            <td>
+              <% if object.editable? %>
+                <i class="glyphicon glyphicon-remove collection-tag-remove hide" style="cursor: pointer;"></i>
+              <% end %>
+            </td>
+            <td class="collection-tag-field collection-tag-field-key">
+              <%= k %>
+            </td>
+            <td class="collection-tag-field collection-tag-field-value">
+              <%= v %>
+            </td>
+          </tr>
+        <% end %>
+      <% end %>
+
+      <% if @object.editable? %>
+        <!-- A hidden row to add new tag -->
+        <tr class="collection-tag-hidden hide">
+          <td>
+            <i class="glyphicon glyphicon-remove collection-tag-remove hide" style="cursor: pointer"></i>
+          </td>
+          <td class="collection-tag-field collection-tag-field-key"></td>
+          <td class="collection-tag-field collection-tag-field-value"></td>
+        </tr>
+      <% end %>