This commit is contained in:
Nicolas Bally 2012-06-19 10:26:36 +02:00
parent 73ef89979b
commit 7a88e9f553
6 changed files with 35 additions and 6 deletions

View File

@ -8,7 +8,7 @@ class Public::CommentsController < ApplicationController
if @comment.save if @comment.save
commentable = @comment.commentable commentable = @comment.commentable
@comment_id = @comment.id
@comment = Comment.new @comment = Comment.new
@comment.commentable = commentable @comment.commentable = commentable

View File

@ -53,7 +53,7 @@
%footer %footer
Sauf mention contraire, textes & photos créés par Sauf mentions contraires, textes & photos créés par
=link_to "Nicolas Bally", "mailto:info@nicolasbally.com" =link_to "Nicolas Bally", "mailto:info@nicolasbally.com"
sous sous
=link_to "license Creative Commons (BY-NC-ND)", "http://creativecommons.org/licenses/by-nc-nd/3.0/fr/", :target => "_blank" =link_to "license Creative Commons (BY-NC-ND)", "http://creativecommons.org/licenses/by-nc-nd/3.0/fr/", :target => "_blank"

View File

@ -12,11 +12,21 @@
Nicolas Bally Nicolas Bally
%time.updated{:datetime => Time.now, :pubdate => true} %time.updated{:datetime => Time.now, :pubdate => true}
publié publié
="le "+l(article.published_at, :format => :human_date) ="le "+l(article.published_at, :format => :human_date)
%p{:style => "margin-top:1em;"}
-if article.comments.count == 0
=link_to "Pas de commentaires", article_path(:slug => article.slug, :anchor => "comments")
-elsif article.comments.count == 1
=link_to "1 commentaire", article_path(:slug => article.slug, :anchor => "comments")
-else
=link_to "#{article.comments.count} commentaires", article_path(:slug => article.slug, :anchor => "comments")
%h1=link_to article.title, article_path(:slug => article.slug), :title => "Blog de Nicolas Bally "+article.title.to_s %h1=link_to article.title, article_path(:slug => article.slug), :title => "Blog de Nicolas Bally "+article.title.to_s

View File

@ -16,6 +16,16 @@
publié publié
="le "+l(article.published_at, :format => :human_date) ="le "+l(article.published_at, :format => :human_date)
%p{:style => "margin-top:1em;"}
-if article.comments.count == 0
=link_to "Pas de commentaires", article_path(:slug => article.slug, :anchor => "comments")
-elsif article.comments.count == 1
=link_to "1 commentaire", article_path(:slug => article.slug, :anchor => "comments")
-else
=link_to "#{article.comments.count} commentaires", article_path(:slug => article.slug, :anchor => "comments")
%h1=link_to article.title, article_path(:slug => article.slug), :title => "blog conseil en image : "+article.title.to_s %h1=link_to article.title, article_path(:slug => article.slug), :title => "blog conseil en image : "+article.title.to_s

View File

@ -1,9 +1,9 @@
.comment .comment#comment{:class => ("author" if comment.email == "info@nicolasbally.com"), :id => comment.id}
%aside=gravatar_image_tag(comment.email? ? comment.email : comment.pseudo, :gravatar => {:default => :identicon}) %aside=gravatar_image_tag(comment.email? ? comment.email : comment.pseudo, :gravatar => {:default => "http://#{HOSTNAME}/assets/front/default_avatar.jpg"})
%p.header %p.header
=gravatar_image_tag(comment.email? ? comment.email : comment.pseudo, :gravatar => {:default => :identicon})
Commentaire de Commentaire de
%strong %strong

View File

@ -1,3 +1,12 @@
$("#comment_form").html("<%= escape_javascript(render(:partial => "form")) %>"); $("#comment_form").html("<%= escape_javascript(render(:partial => "form")) %>");
$("#comments").html("<%= escape_javascript(render(@comment.commentable.comments.recents)) %>"); $("#comments").html("<%= escape_javascript(render(@comment.commentable.comments.recents)) %>");
$(document.body).animate({
'scrollTop': ( $("#comment_<%= @comment_id %>").offset().top - 150)
}, 700);