diff --git a/app/models/user.rb b/app/models/user.rb index 2430a1b..58470ec 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,8 +1,8 @@ class User include Mongoid::Document - devise :database_authenticatable, :registerable, - :recoverable, :rememberable, :trackable, + devise :database_authenticatable, + :recoverable, :rememberable, :trackable, :validatable, :token_authenticatable field :name diff --git a/app/views/devise/confirmations/new.html.haml b/app/views/devise/confirmations/new.html.haml deleted file mode 100644 index 810b8ca..0000000 --- a/app/views/devise/confirmations/new.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -%h2 Resend confirmation instructions -= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| - = devise_error_messages! - %p - = f.label :email - %br/ - = f.text_field :email - %p= f.submit "Resend confirmation instructions" -= render :partial => "devise/shared/links" diff --git a/app/views/devise/mailer/confirmation_instructions.html.haml b/app/views/devise/mailer/confirmation_instructions.html.haml deleted file mode 100644 index 7840b9c..0000000 --- a/app/views/devise/mailer/confirmation_instructions.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -%p - Welcome #{@resource.email}! -%p You can confirm your account through the link below: -%p= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) diff --git a/app/views/devise/mailer/reset_password_instructions.html.haml b/app/views/devise/mailer/reset_password_instructions.html.haml deleted file mode 100644 index 4fc4743..0000000 --- a/app/views/devise/mailer/reset_password_instructions.html.haml +++ /dev/null @@ -1,6 +0,0 @@ -%p - Hello #{@resource.email}! -%p Someone has requested a link to change your password, and you can do this through the link below. -%p= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) -%p If you didn't request this, please ignore this email. -%p Your password won't change until you access the link above and create a new one. diff --git a/app/views/devise/mailer/reset_password_instructions.text.erb b/app/views/devise/mailer/reset_password_instructions.text.erb new file mode 100644 index 0000000..19a19cb --- /dev/null +++ b/app/views/devise/mailer/reset_password_instructions.text.erb @@ -0,0 +1,9 @@ +Hello, + +We hear you'd link to change your password. You can do that by visiting the link below. + + <%= edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %> + +If you didn't request this, please ignore this email. Your password won't change unless you access the link above and create a new one. + +<%= render 'mailer/signature' %> \ No newline at end of file diff --git a/app/views/devise/mailer/unlock_instructions.html.haml b/app/views/devise/mailer/unlock_instructions.html.haml deleted file mode 100644 index 34b0e9e..0000000 --- a/app/views/devise/mailer/unlock_instructions.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -%p - Hello #{@resource.email}! -%p Your account has been locked due to an excessive amount of unsuccessful sign in attempts. -%p Click the link below to unlock your account: -%p= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml index 543d47e..4bb32e4 100644 --- a/app/views/devise/passwords/edit.html.haml +++ b/app/views/devise/passwords/edit.html.haml @@ -1,14 +1,12 @@ -%h2 Change your password +- content_for :title, "Change your password" + = form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| = devise_error_messages! = f.hidden_field :reset_password_token - %p - = f.label :password - %br/ + .required + = f.label :password, 'New password' = f.password_field :password - %p - = f.label :password_confirmation - %br/ + .required + = f.label :password_confirmation, 'One more time' = f.password_field :password_confirmation - %p= f.submit "Change my password" -= render :partial => "devise/shared/links" + %div= f.submit "Change my password" \ No newline at end of file diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml index de2274f..8e22f03 100644 --- a/app/views/devise/passwords/new.html.haml +++ b/app/views/devise/passwords/new.html.haml @@ -1,9 +1,8 @@ -%h2 Forgot your password? +- content_for :title, "Forget your password?" = form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| = devise_error_messages! - %p + .required = f.label :email - %br/ = f.text_field :email - %p= f.submit "Send me reset password instructions" -= render :partial => "devise/shared/links" + + %div= f.submit "Send me reset password instructions" \ No newline at end of file diff --git a/app/views/devise/registrations/edit.html.haml b/app/views/devise/registrations/edit.html.haml deleted file mode 100644 index d252d9a..0000000 --- a/app/views/devise/registrations/edit.html.haml +++ /dev/null @@ -1,27 +0,0 @@ -%h2 - Edit #{resource_name.to_s.humanize} -= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| - = devise_error_messages! - %p - = f.label :email - %br/ - = f.text_field :email - %p - = f.label :password - %i (leave blank if you don't want to change it) - %br/ - = f.password_field :password - %p - = f.label :password_confirmation - %br/ - = f.password_field :password_confirmation - %p - = f.label :current_password - %i (we need your current password to confirm your changes) - %br/ - = f.password_field :current_password - %p= f.submit "Update" -%h3 Cancel my account -%p - Unhappy? #{link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete}. -= link_to "Back", :back diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml deleted file mode 100644 index ba1e2ac..0000000 --- a/app/views/devise/registrations/new.html.haml +++ /dev/null @@ -1,20 +0,0 @@ -%h2 Sign up -= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| - = devise_error_messages! - %p - = f.label :name - = f.text_field :name - %p - = f.label :email - %br/ - = f.text_field :email - %p - = f.label :password - %br/ - = f.password_field :password - %p - = f.label :password_confirmation - %br/ - = f.password_field :password_confirmation - %p= f.submit "Sign up" -= render :partial => "devise/shared/links" diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 43cd659..ad71fe1 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -1,16 +1,17 @@ -%h2 Sign in +- content_for :title, 'Sign in' + = form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| - %p + .required = f.label :email - %br/ = f.text_field :email - %p + .required + = link_to 'forget it?', new_password_path(resource_name), :class => 'float-right' = f.label :password - %br/ = f.password_field :password + - if devise_mapping.rememberable? - %p + %div.checkbox = f.check_box :remember_me = f.label :remember_me - %p= f.submit "Sign in" -= render :partial => "devise/shared/links" + + %div= f.submit "Sign in" \ No newline at end of file diff --git a/app/views/devise/shared/_links.haml b/app/views/devise/shared/_links.haml deleted file mode 100644 index a754735..0000000 --- a/app/views/devise/shared/_links.haml +++ /dev/null @@ -1,15 +0,0 @@ -- if controller_name != 'sessions' - = link_to "Sign in", new_session_path(resource_name) - %br/ -- if devise_mapping.registerable? && controller_name != 'registrations' - = link_to "Sign up", new_registration_path(resource_name) - %br/ -- if devise_mapping.recoverable? && controller_name != 'passwords' - = link_to "Forgot your password?", new_password_path(resource_name) - %br/ -- if devise_mapping.confirmable? && controller_name != 'confirmations' - = link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) - %br/ -- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' - = link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) - %br/ diff --git a/app/views/devise/unlocks/new.html.haml b/app/views/devise/unlocks/new.html.haml deleted file mode 100644 index afb0daa..0000000 --- a/app/views/devise/unlocks/new.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -%h2 Resend unlock instructions -= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| - = devise_error_messages! - %p - = f.label :email - %br/ - = f.text_field :email - %p= f.submit "Resend unlock instructions" -= render :partial => "devise/shared/links" diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 0d860f1..77a5bce 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -13,8 +13,9 @@ #header %div = link_to 'Errbit', root_path, :id => 'site-name' + = render 'shared/session' - = render :partial => 'shared/navigation' + = render 'shared/navigation' if current_user #content-wrapper #content-title @@ -26,6 +27,5 @@ #content = render :partial => 'shared/flash_messages' = yield - #footer - Powered by Errbit. + #footer= "Powered by #{link_to 'Errbit', 'http://github.com/jdpace/errbit', :target => '_blank'}: the open source Hoptoad server.".html_safe = yield :scripts \ No newline at end of file diff --git a/app/views/shared/_session.html.haml b/app/views/shared/_session.html.haml new file mode 100644 index 0000000..364fbdf --- /dev/null +++ b/app/views/shared/_session.html.haml @@ -0,0 +1,3 @@ +- if current_user + %ul#session-links + %li= link_to 'Sign out', destroy_session_path(:user), :id => 'sign-out' \ No newline at end of file diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 613a8b7..b072484 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -58,9 +58,36 @@ a.action { float: right; font-size: 0.9em;} text-indent: -5000em; } #header #session-links { - position: absolute; top: 15px; right: 0; + position: absolute; top: 18px; right: 0; font-size: 0.9em; } +#header #session-links li { + float: right; + color: #FFF; + background-color: #000; + border-radius: 6px; + -moz-border-radius: 6px; + -webkit-border-radius: 6px; + border: 1px solid #484B4F; + font-size: 14px; + font-weight: bold; +} +#header #session-links li:hover { + box-shadow: 0 0 3px #69c; + -moz-box-shadow: 0 0 3px #69c; + -webkit-box-shadow: 0 0 3px #69c; +} +#header #session-links a { + color: #FFF; + padding: 0 10px 0 30px; + line-height: 37px; +} +#header #session-links a:hover { + text-decoration: none; +} +#header #session-links #sign-out { + background: transparent url(images/icons/bullet-red-sm.png) 12px 50% no-repeat; +} /* Navigation */ #nav-bar { -- libgit2 0.21.2