Commit e7edcb8f8f58ddca0018a125fabd9173b3821b64
1 parent
b598154c
Exists in
master
and in
1 other branch
Set static gravatar size, made gravatar enabled by default, changed comment desi…
…gn to show delete 'X' at right, and gravatar at left
Showing
6 changed files
with
22 additions
and
18 deletions
Show diff stats
app/assets/stylesheets/errbit.css
| ... | ... | @@ -841,18 +841,30 @@ table.comment tbody th { |
| 841 | 841 | height: 20px; |
| 842 | 842 | line-height: 0.5em; |
| 843 | 843 | } |
| 844 | -table.comment tbody th img { | |
| 845 | - float: right; | |
| 844 | +table.comment th span, table.comment th img { | |
| 845 | + vertical-align: middle; | |
| 846 | +} | |
| 847 | +table.comment th span.comment-info { | |
| 848 | + line-height: 21px; | |
| 846 | 849 | } |
| 850 | +table.comment img.gravatar { | |
| 851 | + margin-right: 7px; | |
| 852 | +} | |
| 853 | + | |
| 847 | 854 | table.comment tbody td { |
| 848 | 855 | background-color: #F9F9F9; |
| 849 | 856 | } |
| 850 | 857 | #content-comments a.destroy-comment { |
| 851 | 858 | color: #EE0000; |
| 852 | 859 | margin-right: 5px; |
| 860 | + margin-top: 2px; | |
| 861 | + font-size: 21px; | |
| 862 | + line-height: 1; | |
| 863 | + float: right; | |
| 853 | 864 | } |
| 854 | 865 | #content-comments a.destroy-comment:hover { |
| 855 | 866 | text-decoration: none; |
| 867 | + color: #AA0000; | |
| 856 | 868 | } |
| 857 | 869 | #content-comments #comment_submit { |
| 858 | 870 | margin-top: 15px; | ... | ... |
app/helpers/errs_helper.rb
| ... | ... | @@ -16,9 +16,9 @@ module ErrsHelper |
| 16 | 16 | |
| 17 | 17 | def gravatar_tag(email, options = {}) |
| 18 | 18 | default_options = { |
| 19 | - :s => Errbit::Config.gravatar_size, | |
| 20 | 19 | :d => Errbit::Config.gravatar_default, |
| 21 | - :alt => email | |
| 20 | + :alt => email, | |
| 21 | + :class => 'gravatar' | |
| 22 | 22 | } |
| 23 | 23 | options.reverse_merge! default_options |
| 24 | 24 | params = options.extract!(:s, :d).delete_if { |k, v| v.blank? } | ... | ... |
app/views/errs/show.html.haml
| ... | ... | @@ -28,11 +28,12 @@ |
| 28 | 28 | %table.comment |
| 29 | 29 | %tr |
| 30 | 30 | %th |
| 31 | - %span= link_to '✘'.html_safe, app_err_comment_path(@app, @problem, comment), :method => :delete, :data => { :confirm => "Are sure you don't need this comment?" }, :class => "destroy-comment" | |
| 32 | - = time_ago_in_words(comment.created_at, true) << " ago by " | |
| 33 | - = link_to comment.user.email, user_path(comment.user) | |
| 34 | 31 | - if Errbit::Config.use_gravatar |
| 35 | - = gravatar_tag comment.user.email | |
| 32 | + = gravatar_tag comment.user.email, :s => 24 | |
| 33 | + %span.comment-info | |
| 34 | + = time_ago_in_words(comment.created_at, true) << " ago by " | |
| 35 | + = link_to comment.user.email, user_path(comment.user) | |
| 36 | + %span.delete= link_to '✘'.html_safe, app_err_comment_path(@app, @problem, comment), :method => :delete, :data => { :confirm => "Are sure you don't need this comment?" }, :class => "destroy-comment" | |
| 36 | 37 | %tr |
| 37 | 38 | %td= comment.body.gsub("\n", "<br>").html_safe |
| 38 | 39 | - if Errbit::Config.allow_comments_with_issue_tracker || !@app.issue_tracker_configured? | ... | ... |
config/config.example.yml
| ... | ... | @@ -40,9 +40,7 @@ user_has_username: false |
| 40 | 40 | allow_comments_with_issue_tracker: true |
| 41 | 41 | |
| 42 | 42 | # Enable Gravatar. |
| 43 | -use_gravatar: false | |
| 44 | -# Default Gravatar size. | |
| 45 | -gravatar_size: 40 | |
| 43 | +use_gravatar: true | |
| 46 | 44 | # Default Gravatar image, can be: mm, identicon, monsterid, wavatar, retro. |
| 47 | 45 | gravatar_default: identicon |
| 48 | 46 | ... | ... |
config/initializers/_load_config.rb
| ... | ... | @@ -15,7 +15,6 @@ unless defined?(Errbit::Config) |
| 15 | 15 | Errbit::Config.allow_comments_with_issue_tracker = ENV['ERRBIT_ALLOW_COMMENTS_WITH_ISSUE_TRACKER'] |
| 16 | 16 | |
| 17 | 17 | Errbit::Config.use_gravatar = ENV['ERRBIT_USE_GRAVATAR'] |
| 18 | - Errbit::Config.gravatar_size = ENV['ERRBIT_GRAVATAR_SIZE'] | |
| 19 | 18 | Errbit::Config.gravatar_default = ENV['ERRBIT_GRAVATAR_DEFAULT'] |
| 20 | 19 | |
| 21 | 20 | Errbit::Config.github_authentication = ENV['GITHUB_AUTHENTICATION'] | ... | ... |
spec/helpers/errs_helper_spec.rb
| ... | ... | @@ -18,7 +18,6 @@ describe ErrsHelper do |
| 18 | 18 | context "default config" do |
| 19 | 19 | before do |
| 20 | 20 | Errbit::Config.stub(:use_gravatar).and_return(true) |
| 21 | - Errbit::Config.stub(:gravatar_size).and_return(48) | |
| 22 | 21 | Errbit::Config.stub(:gravatar_default).and_return('identicon') |
| 23 | 22 | end |
| 24 | 23 | |
| ... | ... | @@ -27,11 +26,6 @@ describe ErrsHelper do |
| 27 | 26 | helper.gravatar_tag(email).should eq(expected) |
| 28 | 27 | end |
| 29 | 28 | |
| 30 | - it "should override :s" do | |
| 31 | - expected = "<img alt=\"#{email}\" src=\"#{base_url}?d=identicon&s=64\" />" | |
| 32 | - helper.gravatar_tag(email, :s => 64).should eq(expected) | |
| 33 | - end | |
| 34 | - | |
| 35 | 29 | it "should override :d" do |
| 36 | 30 | expected = "<img alt=\"#{email}\" src=\"#{base_url}?d=retro&s=48\" />" |
| 37 | 31 | helper.gravatar_tag(email, :d => 'retro').should eq(expected) | ... | ... |