From b02c873c0e892b4bd0b0e511020caaf86337b1de Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 8 Apr 2009 23:19:41 +0000 Subject: [PATCH] Eliminate duplication of tag printing logic. --- app/views/browse/_changeset_details.rhtml | 16 +--------------- app/views/browse/_common_details.rhtml | 11 +---------- app/views/browse/_tag_details.rhtml | 10 ++++++++++ 3 files changed, 12 insertions(+), 25 deletions(-) create mode 100644 app/views/browse/_tag_details.rhtml diff --git a/app/views/browse/_changeset_details.rhtml b/app/views/browse/_changeset_details.rhtml index 07f076e21..baeb44508 100644 --- a/app/views/browse/_changeset_details.rhtml +++ b/app/views/browse/_changeset_details.rhtml @@ -17,21 +17,7 @@ <% end %> - <% unless changeset_details.tags_as_hash.empty? %> - - Tags: - - - <%= render :partial => "tag", :collection => changeset_details.tags_as_hash %> -
- - - <% else %> - - Tags - There are no tags for this changeset - - <% end %> + <%= render :partial => "tag_details", :object => changeset_details %> Bounding box: diff --git a/app/views/browse/_common_details.rhtml b/app/views/browse/_common_details.rhtml index 71a9dd314..09cf4cf2d 100644 --- a/app/views/browse/_common_details.rhtml +++ b/app/views/browse/_common_details.rhtml @@ -20,13 +20,4 @@ <%= link_to common_details.changeset_id, :action => :changeset, :id => common_details.changeset_id %> -<% unless common_details.tags_as_hash.empty? %> - - Tags: - - - <%= render :partial => "tag", :collection => common_details.tags_as_hash %> -
- - -<% 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 index 000000000..dab36266b --- /dev/null +++ b/app/views/browse/_tag_details.rhtml @@ -0,0 +1,10 @@ +<% unless tag_details.tags_as_hash.empty? %> + + Tags: + + + <%= render :partial => "tag", :collection => tag_details.tags_as_hash %> +
+ + +<% end %> -- 2.43.2