diff --git a/Gemfile b/Gemfile --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem 'rails', '3.2.19' +gem 'rails', '3.2.21' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' @@ -10,13 +10,13 @@ # Gems used only for assets and not required # in production environments by default. group :assets do - gem 'sass-rails', '~> 3.2.3' - gem 'coffee-rails', '~> 3.2.1' + gem 'sass-rails', '~> 3.2.6' + gem 'coffee-rails', '~> 3.2.2' # See https://github.com/sstephenson/execjs#readme for more supported runtimes # gem 'therubyracer', :platforms => :ruby - gem 'uglifier', '>= 1.0.3' + gem 'uglifier' end gem 'prototype-rails' @@ -36,15 +36,15 @@ # To use debugger # gem 'debugger' -gem "haml" -gem "mail" -gem "rdiscount" -gem "test-unit" -gem 'will_paginate', '~> 3.0.0' +gem 'haml' +gem 'mail' +gem 'rdiscount' +gem 'test-unit' +gem 'will_paginate', '~> 3.0.7' gem 'dynamic_form' gem 'in_place_editing' -gem 'verification', :git => 'git://github.com/sikachu/verification.git' +gem 'verification', :git => 'https://github.com/sikachu/verification.git' group :test, :development do - gem "rspec-rails", "~> 2.0" + gem 'rspec-rails', '~> 2.99.0' end diff --git a/Gemfile.lock b/Gemfile.lock --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,5 +1,5 @@ GIT - remote: git://github.com/sikachu/verification.git + remote: https://github.com/sikachu/verification.git revision: 76eaf51b13276ecae54bd9cd115832595d2ff56d specs: verification (1.0.3) @@ -9,12 +9,12 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (3.2.19) - actionpack (= 3.2.19) + actionmailer (3.2.21) + actionpack (= 3.2.21) mail (~> 2.5.4) - actionpack (3.2.19) - activemodel (= 3.2.19) - activesupport (= 3.2.19) + actionpack (3.2.21) + activemodel (= 3.2.21) + activesupport (= 3.2.21) builder (~> 3.0.0) erubis (~> 2.7.0) journey (~> 1.0.4) @@ -22,18 +22,18 @@ rack-cache (~> 1.2) rack-test (~> 0.6.1) sprockets (~> 2.2.1) - activemodel (3.2.19) - activesupport (= 3.2.19) + activemodel (3.2.21) + activesupport (= 3.2.21) builder (~> 3.0.0) - activerecord (3.2.19) - activemodel (= 3.2.19) - activesupport (= 3.2.19) + activerecord (3.2.21) + activemodel (= 3.2.21) + activesupport (= 3.2.21) arel (~> 3.0.2) tzinfo (~> 0.3.29) - activeresource (3.2.19) - activemodel (= 3.2.19) - activesupport (= 3.2.19) - activesupport (3.2.19) + activeresource (3.2.21) + activemodel (= 3.2.21) + activesupport (= 3.2.21) + activesupport (3.2.21) i18n (~> 0.6, >= 0.6.4) multi_json (~> 1.0) arel (3.0.3) @@ -44,15 +44,15 @@ coffee-script (2.3.0) coffee-script-source execjs - coffee-script-source (1.7.1) + coffee-script-source (1.8.0) diff-lcs (1.2.5) dynamic_form (1.1.4) erubis (2.7.0) - execjs (2.2.1) - haml (4.0.5) + execjs (2.2.2) + haml (4.0.6) tilt hike (1.2.3) - i18n (0.6.11) + i18n (0.7.0) in_place_editing (1.2.0) journey (1.0.4) json (1.8.1) @@ -61,9 +61,9 @@ treetop (~> 1.4.8) mime-types (1.25.1) multi_json (1.10.1) - mysql2 (0.3.16) + mysql2 (0.3.17) polyglot (0.3.5) - power_assert (0.1.3) + power_assert (0.2.2) prototype-rails (3.2.1) rails (~> 3.2) rack (1.4.5) @@ -73,26 +73,26 @@ rack rack-test (0.6.2) rack (>= 1.0) - rails (3.2.19) - actionmailer (= 3.2.19) - actionpack (= 3.2.19) - activerecord (= 3.2.19) - activeresource (= 3.2.19) - activesupport (= 3.2.19) + rails (3.2.21) + actionmailer (= 3.2.21) + actionpack (= 3.2.21) + activerecord (= 3.2.21) + activeresource (= 3.2.21) + activesupport (= 3.2.21) bundler (~> 1.0) - railties (= 3.2.19) - railties (3.2.19) - actionpack (= 3.2.19) - activesupport (= 3.2.19) + railties (= 3.2.21) + railties (3.2.21) + actionpack (= 3.2.21) + activesupport (= 3.2.21) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) - rake (10.3.2) + rake (10.4.2) rdiscount (2.1.7.1) rdoc (3.12.2) json (~> 1.4) - rspec-collection_matchers (1.0.0) + rspec-collection_matchers (1.1.2) rspec-expectations (>= 2.99.0.beta1) rspec-core (2.99.2) rspec-expectations (2.99.2) @@ -107,25 +107,25 @@ rspec-core (~> 2.99.0) rspec-expectations (~> 2.99.0) rspec-mocks (~> 2.99.0) - sass (3.4.1) + sass (3.4.9) sass-rails (3.2.6) railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) - sprockets (2.2.2) + sprockets (2.2.3) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - test-unit (3.0.1) + test-unit (3.0.9) power_assert thor (0.19.1) tilt (1.4.1) treetop (1.4.15) polyglot polyglot (>= 0.3.1) - tzinfo (0.3.41) - uglifier (2.5.3) + tzinfo (0.3.42) + uglifier (2.6.0) execjs (>= 0.3.0) json (>= 1.8.0) will_paginate (3.0.7) @@ -134,18 +134,18 @@ ruby DEPENDENCIES - coffee-rails (~> 3.2.1) + coffee-rails (~> 3.2.2) dynamic_form haml in_place_editing mail mysql2 prototype-rails - rails (= 3.2.19) + rails (= 3.2.21) rdiscount - rspec-rails (~> 2.0) - sass-rails (~> 3.2.3) + rspec-rails (~> 2.99.0) + sass-rails (~> 3.2.6) test-unit - uglifier (>= 1.0.3) + uglifier verification! - will_paginate (~> 3.0.0) + will_paginate (~> 3.0.7) diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -31,20 +31,21 @@ user = User.find(session[:user_id]) @message = Message.new(params[:message]) @message.sender = user - if !@message.save - render :action => 'list' and return + if @message.body == '' or !@message.save + flash[:notice] = 'An error occurred' else flash[:notice] = 'New message posted' - redirect_to :action => 'list' end + redirect_to :action => 'list' end def reply user = User.find(session[:user_id]) @message = Message.new(params[:r_message]) @message.sender = user - if !@message.save - render :action => 'show' and return + if @message.body == '' or !@message.save + flash[:notice] = 'An error occurred' + redirect_to :action => 'show', :id => @message.replying_message_id else flash[:notice] = 'Message replied' rep_msg = @message.replying_message @@ -58,7 +59,7 @@ message = Message.find(params[:id]) message.replied = true message.save - flash[:notice] = 'Message hided (just marked replied)' + flash[:notice] = 'Message hidden (just marked replied)' redirect_to :action => 'console' end diff --git a/app/views/main/_compiler_message.html.erb b/app/views/main/_compiler_message.html.erb --- a/app/views/main/_compiler_message.html.erb +++ b/app/views/main/_compiler_message.html.erb @@ -1,5 +1,5 @@ -<% if compiler_message==nil or compiler_message=='' %> +<% if compiler_message == nil or compiler_message.chomp == '' %> No message <% else %>


-<%= text_field 'user', 'email' %>

+<%= email_field 'user', 'email' %>


<%= text_field 'user', 'alias' %>

diff --git a/app/views/user_admin/list.html.erb b/app/views/user_admin/list.html.erb --- a/app/views/user_admin/list.html.erb +++ b/app/views/user_admin/list.html.erb @@ -16,7 +16,7 @@ <%= text_field 'user', 'full_name', :size => 30 %> <%= password_field 'user', 'password', :size => 10 %> <%= password_field 'user', 'password_confirmation', :size => 10 %> - <%= text_field 'user', 'email', :size => 15 %> + <%= email_field 'user', 'email', :size => 15 %> <%= submit_tag "Create" %> diff --git a/app/views/users/forget.html.haml b/app/views/users/forget.html.haml --- a/app/views/users/forget.html.haml +++ b/app/views/users/forget.html.haml @@ -11,7 +11,8 @@ = form_tag :action => 'retrieve_password' do =t 'registration.password_retrieval.instructions' - = text_field 'email', nil, :size => 20 + %br/ + = email_field 'email', nil, :size => 20 %br/ = submit_tag(t 'registration.password_retrieval.button_label') diff --git a/app/views/users/new.html.haml b/app/views/users/new.html.haml --- a/app/views/users/new.html.haml +++ b/app/views/users/new.html.haml @@ -25,12 +25,12 @@ %tr %td{:align => "right"} = "#{t 'email_label'}:" - %td= f.text_field :email + %td= f.email_field :email %tr %td %td %small - =t 'registration.email_guide' + =t('registration.email_guide').html_safe %tr %td/ %td diff --git a/config/environments/development.rb b/config/environments/development.rb --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -34,4 +34,7 @@ # Expands the lines which load the assets config.assets.debug = true + + # Prevents assets from rendering twice + config.serve_static_assets = false end diff --git a/config/locales/en.yml b/config/locales/en.yml --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -9,8 +9,8 @@ email_label: 'E-mail' password_label: 'Password' - go_ahead_to: "Go ahead to" - go_back_to: "Go back to" + go_ahead_to: "Go ahead to " + go_back_to: "Go back to " login_page: "login page" home_page: "home page"