]> git.openstreetmap.org Git - rails.git/commitdiff
Eliminate duplication of tag printing logic.
authorTom Hughes <tom@compton.nu>
Wed, 8 Apr 2009 23:19:41 +0000 (23:19 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 8 Apr 2009 23:19:41 +0000 (23:19 +0000)
app/views/browse/_changeset_details.rhtml
app/views/browse/_common_details.rhtml
app/views/browse/_tag_details.rhtml [new file with mode: 0644]

index 07f076e21e13bdb15695d23392fc08e90ea5bf88..baeb44508763dbb1a76a77ed3e2bdbe4cec084e2 100644 (file)
     </tr>
   <% end %>
   
     </tr>
   <% end %>
   
-  <% unless changeset_details.tags_as_hash.empty? %>
-    <tr valign="top">
-      <th>Tags:</th>
-      <td>
-        <table padding="0">
-          <%= render :partial => "tag", :collection => changeset_details.tags_as_hash %>
-        </table>
-      </td>
-    </tr>
-  <% else %>
-    <tr>
-      <th>Tags</th>
-      <td>There are no tags for this changeset</td>
-    </tr>
-  <% end %>
+  <%= render :partial => "tag_details", :object => changeset_details %>
 
   <tr>
     <th>Bounding box:</th>
 
   <tr>
     <th>Bounding box:</th>
index 71a9dd3145726476b610e3e3f044136c034e0506..09cf4cf2da24cf66cc5b9d48aa879f92942a02b5 100644 (file)
   <td><%= link_to common_details.changeset_id, :action => :changeset, :id => common_details.changeset_id %></td>
 </tr>
 
   <td><%= link_to common_details.changeset_id, :action => :changeset, :id => common_details.changeset_id %></td>
 </tr>
 
-<% unless common_details.tags_as_hash.empty? %>
-  <tr valign="top">
-    <th>Tags:</th>
-    <td>
-      <table padding="0">
-        <%= render :partial => "tag", :collection => common_details.tags_as_hash %>
-      </table>
-    </td>
-  </tr>      
-<% end %>
+<%= render :partial => "tag_details", :object => common_details %>
diff --git a/app/views/browse/_tag_details.rhtml b/app/views/browse/_tag_details.rhtml
new file mode 100644 (file)
index 0000000..dab3626
--- /dev/null
@@ -0,0 +1,10 @@
+<% unless tag_details.tags_as_hash.empty? %>
+  <tr valign="top">
+    <th>Tags:</th>
+    <td>
+      <table padding="0">
+        <%= render :partial => "tag", :collection => tag_details.tags_as_hash %>
+      </table>
+    </td>
+  </tr>      
+<% end %>