added back to comments; avatar.

This commit is contained in:
danielvincent 2011-02-06 09:26:24 -08:00
parent b26e214001
commit 42993de739
4 changed files with 55 additions and 53 deletions

View file

@ -3,14 +3,11 @@
-# the COPYRIGHT file. -# the COPYRIGHT file.
= form_tag( comments_path, :id => "new_comment_on_#{post_id}", :class => 'new_comment', :remote => true) do = form_tag( comments_path, :id => "new_comment_on_#{post_id}", :class => 'new_comment', :remote => true) do
= owner_image_tag
%p %p
= label_tag "comment_text_on_#{post_id}", t('.comment') = label_tag "comment_text_on_#{post_id}", t('.comment')
= text_area_tag :text, nil, :rows => 2, :class => "comment_box",:id => "comment_text_on_#{post_id}" = text_area_tag :text, nil, :rows => 2, :class => "comment_box",:id => "comment_text_on_#{post_id}"
= hidden_field_tag :post_id, post_id, :id => "post_id_on_#{post_id}" = hidden_field_tag :post_id, post_id, :id => "post_id_on_#{post_id}"
= submit_tag t('.comment'), :id => "comment_submit_#{post_id}", :class => "comment_submit button", :disable_with => t('.commenting') .submit_button
= submit_tag t('.comment'), :id => "comment_submit_#{post_id}", :class => "comment_submit button", :disable_with => t('.commenting')
.submit_instructions.hidden
= t('.press')
%b= t('.enter')
= t('.to_comment')

View file

@ -266,9 +266,6 @@ en:
new_comment: new_comment:
comment: "Comment" comment: "Comment"
commenting: "Commenting..." commenting: "Commenting..."
press: "press"
enter: "enter"
to_comment: "to comment"
photos: photos:
show: show:
delete_photo: "Delete Photo" delete_photo: "Delete Photo"

View file

@ -16,22 +16,12 @@ var Stream = {
Stream.focusNewComment($(this), e); Stream.focusNewComment($(this), e);
}); });
// comment submit action
$stream.delegate("textarea.comment_box", "keydown", function(e){
if (e.keyCode === 13) {
if(!e.shiftKey) {
$(this).blur();
$(this).closest("form").submit();
}
}
});
$stream.delegate("textarea.comment_box", "focus", function(evt) { $stream.delegate("textarea.comment_box", "focus", function(evt) {
var commentBox = $(this); var commentBox = $(this);
commentBox commentBox
.attr('rows',2) .attr('rows',2)
.addClass('force_open') .parent().parent()
.closest("li").find(".submit_instructions").removeClass('hidden'); .addClass('open');
}); });
$stream.delegate("textarea.comment_box", "blur", function(evt) { $stream.delegate("textarea.comment_box", "blur", function(evt) {
@ -39,9 +29,9 @@ var Stream = {
if (!commentBox.val()) { if (!commentBox.val()) {
commentBox commentBox
.attr('rows',1) .attr('rows',1)
.removeClass('force_open')
.css('height','1.4em') .css('height','1.4em')
.closest("li").find(".submit_instructions").addClass('hidden'); .parent().parent()
.removeClass('open');
} }
}); });

View file

@ -521,31 +521,20 @@ header
:right 1em :right 1em
.stream.show .stream.show
ul.comments
:display block
:margin
:top 0
> li
:border none
:padding 0
:word-wrap break-word
&:hover &:hover
> li > li
:background none :background none
:border none :border none
ul.comments
textarea
:width 425px
:max-width 97%
.stream ul.comments .stream ul.comments
.avatar .avatar
:width 30px :width 30px
:height 30px :height 30px
input.comment_submit .submit_button
:display none :text
:align right
ul.comments, ul.comments,
ul.show_comments ul.show_comments
@ -559,13 +548,10 @@ ul.show_comments
:width 100% :width 100%
:height 1.4em :height 1.4em
.force_open
:min-height 2.4em
li li
:list :list
:style none :style none
:padding 0.5em :padding 0.4em
:border :border
:bottom 1px solid #ddd :bottom 1px solid #ddd
:top 1px solid #fff :top 1px solid #fff
@ -587,7 +573,7 @@ ul.show_comments
:top 0px :top 0px
:bottom -2px :bottom -2px
:padding :padding
:left 38px :left 37px
:right 20px :right 20px
.from .from
a a
@ -599,23 +585,54 @@ ul.show_comments
form form
:margin :margin
:top -5px :top -5px
:bottom 0.2em :bottom -4px
:font :font
:size 1em :size 1em
.submit_button
:display none
input
:margin
:right 0
textarea textarea
:font :font
:size 1em :size 1em
:width 478px :margin
:bottom -3px
:width 482px
.submit_instructions .avatar
:text-align center :display none
:font
:size smaller form.open
:color #999 .submit_button
:margin :display block
:bottom -0.8em :margin
:top -0.7em :bottom 2px
:padding 0 :right 2px
textarea
:min-height 2.4em
:width 445px
p
:position relative
:left 36px
.avatar
:position absolute
:display inline
.stream.show
ul.comments
li
:padding
:right 135px
textarea
:margin
:bottom 2px
.profile_photo .profile_photo
img img
@ -625,6 +642,7 @@ ul.show_comments
:-webkit-box-shadow 0 2px 2px #333 :-webkit-box-shadow 0 2px 2px #333
:-moz-box-shadow 0 2px 2px #333 :-moz-box-shadow 0 2px 2px #333
:box-shadow 0 2px 2px #333 :box-shadow 0 2px 2px #333
#profile #profile
h3 h3
:margin :margin