Skip to content
Extraits de code Groupes Projets
Valider 8f50c622 rédigé par Raphael Sofaer's avatar Raphael Sofaer
Parcourir les fichiers

Fix contentUpdater spec, adjust migration and fix a couple of the js viwes

parent a7d8535d
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -4,7 +4,7 @@
class SessionsController < Devise::SessionsController
after_filter :enqueue_update, :only => :create
#after_filter :enqueue_update, :only => :create
protected
def enqueue_update
......
......@@ -5,7 +5,7 @@
- unless comments_expanded
%ul.show_comments{:class => ("hidden" if post.comments.size <= 3)}
%li
%b= comment_toggle( post)
= comment_toggle( post)
%ul.comments{:id => post.id, :class => ('loaded' if post.comments.size <= 3)}
-if post.comments.size > 3 && !comments_expanded
......@@ -14,5 +14,5 @@
= render :partial => 'comments/comment', :collection => post.comments, :locals => {:post => post}
- unless @commenting_disabled
.new_comment_form_wrapper{:class => ( 'hidden' if post.comments.size == 0)}
.new_comment_form_wrapper{:class => ('hidden' if post.comments.size == 0)}
= new_comment_form(post.id, current_user)
......@@ -5,7 +5,10 @@
.likes_container
- if likes_count > 0
= image_tag('icons/heart.svg')
= link_to t('likes.likes.people_like_this', :count => likes_count), post_likes_path(target_id), :class => "expand_likes"
- if defined?(likes_index_link) && likes_index_link
= link_to t('likes.likes.people_like_this', :count => likes_count), post_likes_path(target_id), :class => "expand_likes"
- else
= t('likes.likes.people_like_this', :count => likes_count)
%span.hidden.likes_list
/= render 'likes/likes', :likes => likes
var target = $(".stream_element[data-guid=<%= escape_javascript(@post.id.to_s) %>]")
var target = $("#<%= @post.guid %>")
target.find(".sm_body").toggleClass("hidden");
target.find(".undo_text").toggleClass("hidden");
var target = $(".stream_element[data-guid=<%= escape_javascript(@post.id.to_s) %>]")
var target = $("#<%= @post.guid %>")
target.hide('blind', { direction: 'vertical' }, 300, function(){ target.remove() });
......@@ -55,7 +55,7 @@
·
= link_to t('comments.new_comment.comment'), '#', :class => 'focus_comment_textarea'
.likes
= render "likes/likes_container", :target_id => post.id, :likes_count => post.likes_count, :current_user => current_user
.likes.on_post
= render "likes/likes_container", :target_id => post.id, :likes_count => post.likes_count, :current_user => current_user, :likes_index_link => true
= render "comments/comments", :post => post, :current_user => current_user, :commenting_disabled => (defined?(@commenting_disabled) && @commenting_disabled)
......@@ -3,7 +3,7 @@ class LikesOnComments < ActiveRecord::Migration
def self.up
remove_foreign_key :likes, :posts
add_column :likes, :target_type, :string, :null => false
add_column :likes, :target_type, :string, :limit => 60, :null => false
rename_column :likes, :post_id, :target_id
add_column :comments, :likes_count, :integer, :default => 0, :null => false
......
......@@ -110,7 +110,7 @@ ActiveRecord::Schema.define(:version => 20110707234802) do
add_index "invitations", ["sender_id"], :name => "index_invitations_on_sender_id"
create_table "likes", :force => true do |t|
t.boolean "positive", :default => true
t.boolean "positive", :default => true
t.integer "target_id"
t.integer "author_id"
t.string "guid"
......@@ -118,7 +118,7 @@ ActiveRecord::Schema.define(:version => 20110707234802) do
t.text "parent_author_signature"
t.datetime "created_at"
t.datetime "updated_at"
t.string "target_type", :null => false
t.string "target_type", :limit => 60, :null => false
end
add_index "likes", ["author_id"], :name => "likes_author_id_fk"
......
......@@ -6,7 +6,7 @@
var ContentUpdater = {
addPostToStream: function(html) {
var streamElement = $(html);
var postGUID = streamElement.id;
var postGUID = $(streamElement).attr('id');
if($("#"+postGUID).length === 0) {
if($("#no_posts").length) {
......@@ -31,5 +31,5 @@ var ContentUpdater = {
.html(html)
.fadeIn("fast");
}
};
......@@ -667,6 +667,7 @@ form.new_comment
:display inline-block
.comment
.likes,
.likes_container
:display inline
......@@ -2221,6 +2222,11 @@ ul.show_comments
:border
:top 1px dotted #aaa
ul.show_comments,
.likes_container
a
:color #999
.likes_container
:margin
:bottom -4px
......@@ -2228,10 +2234,6 @@ ul.show_comments
ul.show_comments,
.likes_container
a
:font
:weight bold
img
:position relative
:top 2px
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter