diff --git a/Gemfile b/Gemfile index edb2e190b..b52642871 100644 --- a/Gemfile +++ b/Gemfile @@ -30,6 +30,7 @@ gem 'simple_captcha2', require: 'simple_captcha' gem 'ckeditor' gem 'cancancan' gem 'social-share-button' +gem 'initialjs-rails' gem 'unicorn' group :development, :test do @@ -61,4 +62,3 @@ end group :test do gem 'email_spec' end - diff --git a/Gemfile.lock b/Gemfile.lock index a6a269d2e..f95d14855 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -140,6 +140,8 @@ GEM i18n term-ansicolor (>= 1.3.2) terminal-table (>= 1.5.1) + initialjs-rails (0.1.0) + railties (>= 3.1, < 5.0) jquery-rails (4.0.4) rails-dom-testing (~> 1.0) railties (>= 4.2.0) @@ -314,6 +316,7 @@ DEPENDENCIES factory_girl_rails foundation-rails i18n-tasks + initialjs-rails jquery-rails launchy letter_opener_web (~> 1.2.0) diff --git a/app/assets/images/user_default.jpg b/app/assets/images/user_default.jpg deleted file mode 100644 index c67f27f55..000000000 Binary files a/app/assets/images/user_default.jpg and /dev/null differ diff --git a/app/assets/images/user_default_2.jpg b/app/assets/images/user_default_2.jpg deleted file mode 100644 index ed164ab57..000000000 Binary files a/app/assets/images/user_default_2.jpg and /dev/null differ diff --git a/app/assets/images/user_default_big.jpg b/app/assets/images/user_default_big.jpg deleted file mode 100644 index d1c5bcea2..000000000 Binary files a/app/assets/images/user_default_big.jpg and /dev/null differ diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index d6dedd05c..ed87ec326 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -16,17 +16,20 @@ //= require turbolinks //= require ckeditor/init //= require social-share-button +//= require initial //= require app //= require_tree . var initialize_modules = function() { App.Comments.initialize(); + App.Users.initialize(); App.Votes.initialize(); }; $(function(){ $(document).foundation(); - $(document).ready(initialize_modules) - $(document).on('page:load', initialize_modules) + $(document).ready(initialize_modules); + $(document).on('page:load', initialize_modules); + $(document).on('ajax:complete', initialize_modules); }); diff --git a/app/assets/javascripts/comments.js.coffee b/app/assets/javascripts/comments.js.coffee index 0831d8a20..f6243beab 100644 --- a/app/assets/javascripts/comments.js.coffee +++ b/app/assets/javascripts/comments.js.coffee @@ -17,7 +17,17 @@ App.Comments = $("#js-comment-form-#{id}").toggle() initialize: -> - $('body').on 'click', '.js-add-comment-link', -> - id = $(this).data().id - App.Comments.toggle_form(id) - false + # $('body').on 'click', '.js-add-comment-link', -> + # id = $(this).data().id + # App.Comments.toggle_form(id) + # false + # + $('body .js-add-comment-link').each -> + $this = $(this) + + unless $this.data('initialized') is 'yes' + $this.on('click', -> + id = $(this).data().id + App.Comments.toggle_form(id) + false + ).data 'initialized', 'yes' diff --git a/app/assets/javascripts/users.js.coffee b/app/assets/javascripts/users.js.coffee new file mode 100644 index 000000000..9c4fa42b0 --- /dev/null +++ b/app/assets/javascripts/users.js.coffee @@ -0,0 +1,5 @@ +App.Users = + + initialize: -> + $('.initialjs-avatar').initial(); + false diff --git a/app/assets/stylesheets/debates.scss b/app/assets/stylesheets/debates.scss index a97764583..3aaa26b75 100644 --- a/app/assets/stylesheets/debates.scss +++ b/app/assets/stylesheets/debates.scss @@ -371,13 +371,8 @@ } .author-photo { - border-radius: 2px; - display: inline-block; - height: 32px; line-height: $line-height*2; margin-right: $line-height/4; - vertical-align: middle; - width: 32px; } .author { @@ -524,16 +519,6 @@ } } - .user-photo { - border-radius: 2px; - display: inline-block; - height: 32px; - line-height: $line-height*2; - margin-right: rem-calc(6); - vertical-align: top; - width: 32px; - } - .comment-body { margin-left: $line-height*1.6; @@ -569,4 +554,4 @@ } } } -} \ No newline at end of file +} diff --git a/app/assets/stylesheets/participacion.scss b/app/assets/stylesheets/participacion.scss index 60ffc337d..e2fb5f041 100644 --- a/app/assets/stylesheets/participacion.scss +++ b/app/assets/stylesheets/participacion.scss @@ -484,7 +484,7 @@ form { opacity: .5; } - .avatar { + .initialjs-avatar { margin-bottom: $line-height; } @@ -522,4 +522,4 @@ form { } } } -} \ No newline at end of file +} diff --git a/app/views/account/show.html.erb b/app/views/account/show.html.erb index ecfb17209..2cb792dc7 100644 --- a/app/views/account/show.html.erb +++ b/app/views/account/show.html.erb @@ -36,13 +36,15 @@
<%= @debate.title %>