From a988ad6f515495233ddd8bf4e866a4da78e8e273 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 16 Sep 2020 17:50:07 +0200 Subject: [PATCH] Style changeset descriptions with italics on browse pages Alternative to #580 This reworks changeset descriptions to use italics instead of header elements, in order to make them more like quotes. Care has been taken to make sure that there is still a header element as the first element of the common details partial, in order to make the history pages look right (where the partial appears multiple times). --- app/views/browse/_common_details.html.erb | 14 +++++++------- app/views/browse/changeset.html.erb | 4 +++- app/views/changesets/_changeset.html.erb | 4 ++-- app/views/users/_contact.html.erb | 6 +++--- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/app/views/browse/_common_details.html.erb b/app/views/browse/_common_details.html.erb index 351ec4c6a..3748f2f65 100644 --- a/app/views/browse/_common_details.html.erb +++ b/app/views/browse/_common_details.html.erb @@ -1,21 +1,21 @@ -

+

+ <%= t "browse.version" %> + #<%= common_details.version %> +

+ +

<% if common_details.changeset.tags['comment'].present? %> <%= linkify(common_details.changeset.tags["comment"]) %> <% else %> <%= t "browse.no_comment" %> <% end %> - +

<%= t "browse.#{common_details.visible? ? :edited : :deleted}_by_html", :time => time_ago_in_words(common_details.timestamp, :scope => :'datetime.distance_in_words_ago'), :user => changeset_user_link(common_details.changeset), :title => l(common_details.timestamp) %> -
- -
- <%= t "browse.version" %> - #<%= common_details.version %> · <%= t "browse.in_changeset" %> #<%= link_to common_details.changeset_id, :action => :changeset, :id => common_details.changeset_id %> diff --git a/app/views/browse/changeset.html.erb b/app/views/browse/changeset.html.erb index c15e1f8c6..1217c03be 100644 --- a/app/views/browse/changeset.html.erb +++ b/app/views/browse/changeset.html.erb @@ -6,7 +6,9 @@
-
<%= linkify(@changeset.tags["comment"].to_s.presence || t("browse.no_comment")) %>
+

+ <%= linkify(@changeset.tags["comment"].to_s.presence || t("browse.no_comment")) %> +

<%= changeset_details(@changeset) %>
<%= render :partial => "tag_details", :object => @changeset.tags.except("comment") %> diff --git a/app/views/changesets/_changeset.html.erb b/app/views/changesets/_changeset.html.erb index e3febb1c5..267bdb555 100644 --- a/app/views/changesets/_changeset.html.erb +++ b/app/views/changesets/_changeset.html.erb @@ -11,11 +11,11 @@ end %> <%= tag.li :id => "changeset_#{changeset.id}", :data => { :changeset => changeset_data }, :class => "list-group-item" do %> -
+

<%= changeset.tags["comment"].to_s.presence || t("browse.no_comment") %> -

+

<%= changeset.comments.length %> diff --git a/app/views/users/_contact.html.erb b/app/views/users/_contact.html.erb index 4446c519d..d46a61984 100644 --- a/app/views/users/_contact.html.erb +++ b/app/views/users/_contact.html.erb @@ -23,9 +23,9 @@ <% if changeset %> <%= t("users.show.latest edit", :ago => time_ago_in_words(changeset.created_at, :scope => :'datetime.distance_in_words_ago')) %> <% comment = changeset.tags["comment"].to_s != "" ? changeset.tags["comment"] : t("browse.no_comment") %> - "<%= link_to(comment, - { :controller => "browse", :action => "changeset", :id => changeset.id }, - { :title => t("changesets.changeset.view_changeset_details") }) %>" + <%= link_to(comment, + { :controller => "browse", :action => "changeset", :id => changeset.id }, + { :title => t("changesets.changeset.view_changeset_details") }) %> <% else %> <%= t "changesets.changeset.no_edits" %> <% end %> -- 2.39.5