9426: test Tags tab
[arvados.git] / apps / workbench / app / views / collections / _show_tag_rows.html.erb
index da699256e9f818c44456ea9fc8e4303447dafd0d..eceec1057beb05d55c8088fab6b694b4170feea0 100644 (file)
@@ -1,26 +1,31 @@
 <%
   tags = object.properties[:tags]
 %>
-
-        <% tags.andand.each do |k, v| %>
+      <% if tags.andand.is_a?(Hash) %>
+        <% tags.each do |k, v| %>
           <tr class="collection-tag-<%=k%>">
             <td>
-              <i class="glyphicon glyphicon-remove collection-tag-remove hide" style="cursor: pointer;"></i>
+              <% if object.editable? %>
+                <i class="glyphicon glyphicon-remove collection-tag-remove hide" style="cursor: pointer;"></i>
+              <% end %>
             </td>
-            <td class="collection-tag-field">
+            <td class="collection-tag-field collection-tag-field-key">
               <%= k %>
             </td>
-            <td class="collection-tag-field">
+            <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"></td>
-          <td class="collection-tag-field"></td>
+          <td class="collection-tag-field collection-tag-field-key"></td>
+          <td class="collection-tag-field collection-tag-field-value"></td>
         </tr>
+      <% end %>