diff --git a/app/assets/stylesheets/bootstrap_overrides.css.scss b/app/assets/stylesheets/bootstrap_overrides.css.scss index 070b256..7d8d35f 100644 --- a/app/assets/stylesheets/bootstrap_overrides.css.scss +++ b/app/assets/stylesheets/bootstrap_overrides.css.scss @@ -51,6 +51,9 @@ color: #333333; } +.well { + overflow: auto; +} /* Fix menu */ @media (max-width: 767px) { diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5807f8e..6cc8f42 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -3,6 +3,8 @@ class ApplicationController < ActionController::Base # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception + before_action :configure_permitted_parameters, if: :devise_controller? + protected def check_vlibras_api_status unless ApiClient.check_status @@ -11,4 +13,8 @@ protected end end + def configure_permitted_parameters + devise_parameter_sanitizer.for(:sign_up) << [ :name, :address, :zipcode, :phone ] + end + end diff --git a/app/models/user.rb b/app/models/user.rb index 11668f2..6ab73ac 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -16,6 +16,9 @@ # last_sign_in_ip :string(255) # created_at :datetime # updated_at :datetime +# address :text +# zipcode :string(255) +# phone :string(255) # # Indexes # @@ -29,8 +32,11 @@ class User < ActiveRecord::Base has_many :requests, :class => VLibras::Request, :foreign_key => :owner_id has_many :videos, :through => :requests, :class => VLibras::Video + validates :name, :presence => true + # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable, - :recoverable, :rememberable, :trackable, :validatable + :recoverable, :rememberable, :trackable, :validatable, + :registerable end diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml index 82ba0bd..c7e3a95 100644 --- a/app/views/devise/registrations/new.html.haml +++ b/app/views/devise/registrations/new.html.haml @@ -1,10 +1,26 @@ -%h2 Sign up -= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => {:class => 'form-vertical' }) do |f| - = f.error_notification - = display_base_errors resource - = f.input :name, :autofocus => true - = f.input :email, :required => true - = f.input :password, :required => true - = f.input :password_confirmation, :required => true - = f.button :submit, 'Sign up', :class => 'btn-primary' -= render "devise/shared/links" +.breadcrumb + %h2 Cadastrar Usuário + +.row-fluid + .span6.well.offset3 + = html5_video_tag("/video.mp4", 'cadastro-video', 'video-instructions') + +.row-fluid + .well + %h2 Dados do Usuário + + = simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| + = f.error_notification + .span3 + = f.input :name, :label => "Nome", :required => true, :autofocus => true + = f.input :email, :required => true + = f.input :password, :required => true, :label => "Senha" + = f.input :password_confirmation, :required => true, :label => "Confirmar Senha" + .span3 + = f.input :address, :label => "Endereço", :input_html => { :rows => 4 } + = f.input :zipcode,:label => "CEP" + = f.input :phone, :label => "Telefone" + .span3 + %center + %p= f.button :submit, "Cadastrar", :class => "btn btn-large btn-primary" + = render :partial => "devise/shared/links" \ No newline at end of file diff --git a/app/views/v_libras/requests/rapid.haml b/app/views/v_libras/requests/rapid.haml index 119b166..f1ae4bb 100644 --- a/app/views/v_libras/requests/rapid.haml +++ b/app/views/v_libras/requests/rapid.haml @@ -48,7 +48,7 @@ 'superior-esquerdo'], [t('videos.top_right'), 'superior-direito'], [t('videos.bottom_right'),'inferior-direito'], [t('videos.bottom_left'), 'inferior-esquerdo']]) - .field + .field.hide = label_tag 'params[transparencia]', t('videos.transparency'), :class => "bold" = select_tag 'params[transparencia]', options_for_select([['Opaco', 'opaco'], ['Transparente', 'transparente']]) = submit_tag "Confirmar", :class => "btn btn-primary actions" diff --git a/db/migrate/20140604112510_add_fields_to_user.rb b/db/migrate/20140604112510_add_fields_to_user.rb new file mode 100644 index 0000000..21825a4 --- /dev/null +++ b/db/migrate/20140604112510_add_fields_to_user.rb @@ -0,0 +1,7 @@ +class AddFieldsToUser < ActiveRecord::Migration + def change + add_column :users, :address, :text + add_column :users, :zipcode, :string + add_column :users, :phone, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 57ce386..3adfe96 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140529122416) do +ActiveRecord::Schema.define(version: 20140604112510) do create_table "delayed_jobs", force: true do |t| t.integer "priority", default: 0, null: false @@ -54,6 +54,9 @@ ActiveRecord::Schema.define(version: 20140529122416) do t.string "last_sign_in_ip" t.datetime "created_at" t.datetime "updated_at" + t.text "address" + t.string "zipcode" + t.string "phone" end add_index "users", ["email"], name: "index_users_on_email", unique: true -- libgit2 0.21.2