From 464f8af62d5a640b406f9ae8c1a560418fe8983d Mon Sep 17 00:00:00 2001 From: Daniela Soares Feitosa Date: Sat, 23 May 2009 12:21:08 -0300 Subject: [PATCH] ActionItem1042: enhancing comments --- app/views/content_viewer/_comment.rhtml | 35 ++++++++++++++++++++++------------- public/stylesheets/article.css | 31 ++++++++++++++++++++++++------- 2 files changed, 46 insertions(+), 20 deletions(-) diff --git a/app/views/content_viewer/_comment.rhtml b/app/views/content_viewer/_comment.rhtml index b2cac8b..900b00a 100644 --- a/app/views/content_viewer/_comment.rhtml +++ b/app/views/content_viewer/_comment.rhtml @@ -8,27 +8,36 @@ <% end %> <% if comment.author %> - <%= link_to content_tag( 'span', comment.author.name() ), comment.author.url, + <%= link_to content_tag( 'span', comment.author.short_name, :class => 'comment-info' ), comment.author.url, :class => 'comment-picture', :style => 'background-image:url(%s)' % profile_icon(comment.author, :minor) %> <% else %> <%# unauthenticated user: display gravatar icon %> - <%= content_tag 'span', ' ', + <%= content_tag 'span', content_tag('span', comment.name + '
'+ _('(unauthenticated user)'), :class => 'comment-info'), :class => 'comment-picture', :style => 'background-image:url(%s)' % str_gravatar_url_for( comment.email, :size => 50 ) %> <% end %> -

<%= comment.title %>

-
- <%= _('By %{author} on %{date}') % { - :author => comment.author ? link_to(comment.author.name, comment.author.url) : content_tag('u', comment.name), - :date => show_time(comment.created_at) } %> - <%= _('(unauthenticated user)') if ! comment.author %> -
-
-

- <%= txt2html comment.body %> -

+
+
+
+
+
+
+
+
+
+
+ <%= show_time(comment.created_at) %> +
+

<%= comment.title %>

+
+

+ <%= txt2html comment.body %> +

+
+
+
diff --git a/public/stylesheets/article.css b/public/stylesheets/article.css index 61c313d..5bb0f6a 100644 --- a/public/stylesheets/article.css +++ b/public/stylesheets/article.css @@ -60,13 +60,11 @@ .article-comment { position: relative; - border: 1px solid #B8CFE7; margin-bottom: 10px; padding: 4px; } .comment-from-owner { - border: 1px solid #3465A4; background: #B8CFE7; } @@ -79,22 +77,41 @@ .comment-picture { position: relative; display: block; - width: 50px; + width: 70px; height: 50px; background-repeat: no-repeat; - background-position: 50% 50%; + background-position: 0% 50%; margin: 0px 4px 4px 4px; - float: right; + float: left; } + .comment-picture span { - display: none; + top: 50px; + position: absolute; + width: 100%; + overflow: hidden; +} + +a.comment-picture { + text-decoration: none; } -.comment-info { +.comment-created-at { + float: right; + margin-left: 5px; +} + +.comment-info, +.comment-created-at { font-size: 10px; color: #999; display: inline; } + +.comment-details { + margin-left: 100px; +} + .comment-from-owner .comment-info { color: #729FCF; } -- libgit2 0.21.2