Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

User's picture is displayed on each comment. #7

Merged
merged 1 commit into from

2 participants

@kazunori-kawauchi

I have made a commit to display a thumbnail (resized to 48 x 48) on each comment.

@maedana maedana merged commit 2b883ee into openskip:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 15, 2012
  1. @kazunori-kawauchi
This page is out of date. Refresh to see the latest.
View
20 app/views/board_entries/_board_entry_comment.html.erb
@@ -4,19 +4,27 @@
<div class="<%= comment_class %> ui-corner-all" id="comment_<%= comment.id %>_<%= level %>">
<div class="header">
- <span class="<%= comment_title_class @current_user, comment, checked_on %>">
- <%= user_link_to(comment.user) %><span class="thankyou_link"><%= thankyou_link_to comment.user %></span>
- <span class="date"><%= "[ #{comment.created_on.to_s(:standard)} ]" %></span>
+ <div class="comment_thumbnail">
+ <%= show_picture(comment.user, :width => 48, :height => 48) %>
+ </div>
+
+ <div class="<%= comment_title_class @current_user, comment, checked_on %>">
+ <%= user_link_to(comment.user) %>
+ <span class="thankyou_link"><%= thankyou_link_to comment.user %></span><br>
+ <span class="date"><%= "#{comment.created_on.to_s(:standard)}" %></span>
<%= icon_with_information(@current_user, comment, checked_on) %>
- </span>
- <span class="buttons">
+ </div>
+
+ <div class="buttons">
<%= dummy_link_to(icon_tag('comment_edit', { :alt => _("Edit"), :title => _("Edit") }) + _("Edit"), :id => "comment_edit_link_#{comment.id}", :class => "comment_edit_link") if writer?(comment, session[:user_id]) %>
<%= link_to(icon_tag('comment_delete', { :alt => _("Delete"), :title => _("Delete") }) + _("Delete"), {:controller => "board_entries", :action => "destroy_comment", :id => comment.id}, :confirm => _('Are you sure to delete?'), :method => :post) if (comment_writer?(comment, session[:user_id]) && comment.children.size == 0) %>
<% if level <= BoardEntryComment.limit_level -%>
<span class="link_nest_comment" id='link_nest_comment_<%= comment.id %>'><%= dummy_link_to(icon_tag("comment_add", { :alt => _("Reply to this comment"), :title => _("Reply to this comment")}) + _("Reply"), :id => "comment_nest_link_#{comment.id}_#{level}", :class => "comment_nest_link") %></span>
<% end -%>
- </span>
+ </div>
+
</div><!-- header -->
+ <div style='clear: both'></div>
<div id='comment_contents_<%= comment.id %>' >
<%= render(:partial => 'board_entries/comment_contents', :locals => { :comment => comment }) %>
View
2  public/stylesheets/application.css
1 addition, 1 deletion not shown
View
23 public/stylesheets/sass/application.sass
@@ -1384,23 +1384,32 @@ div#board_entry_comments
:margin-bottom 5px
:_width 100%
div.header
+ !tn_size = 48px
+ !tn_padding = 3px
:border-bottom 1px dotted #aaa
:position relative
- :height 1.8em
+ height = !tn_size + (!tn_padding * 2)
:padding 1px 5px
:vertical-align text-bottom
:_width 100%
- span.title, span.buttons
- :position absolute
- :bottom 3px
- span.title
+ div.title
+ :float left
+ margin = !tn_padding
+ padding = !tn_padding
+ :line-height 1.8em
:width 50%
- :left 2px
span.date
:font-size 0.8em
&.current_user
:background-color #ffefcc
- span.buttons
+ div.comment_thumbnail
+ width = !tn_size
+ height = !tn_size
+ padding = !tn_padding
+ :float left
+ div.buttons
+ :position absolute
+ :bottom 3px
:right 2px
div#hide_action
Something went wrong with that request. Please try again.