-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ismail Akbudak
committed
Jun 21, 2016
1 parent
b1b0386
commit c4536a9
Showing
39 changed files
with
332 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class Hq::PasswordsController < Devise::PasswordsController | ||
layout 'hq/login' | ||
|
||
private | ||
|
||
def after_resetting_password_path_for(resource) | ||
hq_root_path | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class Hq::RegistrationsController < Devise::RegistrationsController | ||
layout 'hq/application' | ||
before_action :authenticate_admin! | ||
before_action :redirect_admin, only: [:new, :create, :destroy] | ||
add_breadcrumb I18n.t('activerecord.models.admin'), :hq_root_path | ||
|
||
def edit | ||
end | ||
|
||
private | ||
|
||
def redirect_admin | ||
redirect_to hq_root_path | ||
end | ||
|
||
def after_update_path_for(resource) | ||
hq_root_path | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class User::DashboardController < User::UserApplicationController | ||
|
||
add_breadcrumb I18n.t('dock.dashboard'), :user_dashboard_index_path | ||
|
||
def index | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class User::PasswordsController < Devise::PasswordsController | ||
layout 'user/login' | ||
|
||
private | ||
|
||
def after_resetting_password_path_for(resource) | ||
user_root_path | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
class User::ProfilesController < User::UserApplicationController | ||
|
||
before_action :set_profile, only: [:show, :edit, :update] | ||
add_breadcrumb I18n.t('dock.profile'), :user_profile_path | ||
|
||
def show | ||
add_breadcrumb @profile.full_name, user_profile_path | ||
respond_with([:user, @profile]) | ||
end | ||
|
||
def edit | ||
add_breadcrumb t('tooltips.edit'), edit_user_profile_path | ||
end | ||
|
||
def update | ||
@profile.update(profile_params) | ||
respond_with([:user, @profile], location: user_profile_path) | ||
end | ||
|
||
private | ||
|
||
def set_profile | ||
@profile = current_user | ||
end | ||
|
||
def profile_params | ||
params.require(:user) | ||
.permit( | ||
:name, | ||
:surname, | ||
:timezone | ||
) | ||
end | ||
end |
20 changes: 20 additions & 0 deletions
20
templates/app/controllers/user/registrations_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class User::RegistrationsController < Devise::RegistrationsController | ||
layout 'user/application' | ||
before_action :authenticate_user! | ||
before_action :redirect_user, only: [:new, :create, :destroy] | ||
add_breadcrumb I18n.t('activerecord.models.user'), :user_root_path | ||
|
||
def edit | ||
end | ||
|
||
private | ||
|
||
def redirect_user | ||
redirect_to user_root_path | ||
end | ||
|
||
def after_update_path_for(resource) | ||
user_root_path | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
class User::SessionsController < Devise::SessionsController | ||
layout 'user/login' | ||
|
||
private | ||
|
||
# Overwriting the sign_out redirect path method | ||
def after_sign_in_path_for(resource_or_scope) | ||
user_root_path | ||
end | ||
|
||
# Overwriting the sign_out redirect path method | ||
def after_sign_out_path_for(resource_or_scope) | ||
new_user_session_path | ||
end | ||
|
||
end |
8 changes: 8 additions & 0 deletions
8
templates/app/controllers/user/user_application_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require 'application_responder' | ||
|
||
class User::UserApplicationController < ActionController::Base | ||
layout 'user/application' | ||
before_action :authenticate_user! | ||
self.responder = ApplicationResponder | ||
respond_to :html, :json | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
%h2 Resend confirmation instructions | ||
= simple_form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| | ||
%h2 | ||
= t('devise.confirmation.new.title') | ||
= simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| | ||
= f.error_notification | ||
= f.full_error :confirmation_token | ||
.form-inputs | ||
= f.input :email, :required => true, :autofocus => true | ||
= f.input :email, required: true, autofocus: true | ||
.form-actions | ||
= f.button :submit, "Resend confirmation instructions" | ||
= render "devise/shared/links" | ||
= f.button :submit, t('devise.confirmation.btn.resend'), class: 'btn btn-primary' | ||
= render 'devise/shared/links' |
8 changes: 5 additions & 3 deletions
8
templates/app/views/devise/mailer/confirmation_instructions.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
%p | ||
Welcome #{@email}! | ||
%p You can confirm your account email through the link below: | ||
%p= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) | ||
= t( 'email.salut', user: @resource.email ) | ||
%p | ||
= "#{t( 'email.devise.confirmation_instruction.desc1')} :" | ||
%p | ||
= link_to t( 'email.devise.confirmation_instruction.btn_confirm'), confirmation_url(@resource, confirmation_token: @token) |
4 changes: 2 additions & 2 deletions
4
templates/app/views/devise/mailer/reset_password_instructions.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
%h2= t('devise.password.edit.title') | ||
= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| | ||
= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| | ||
= f.error_notification | ||
= f.input :reset_password_token, :as => :hidden | ||
= f.input :reset_password_token, as: :hidden | ||
= f.full_error :reset_password_token | ||
.form-inputs | ||
= f.input :password, label: t('devise.password.edit.new_password'), required: true, autofocus: true | ||
= f.input :password_confirmation, label: t('devise.password.edit.confirmation'), required: true | ||
.form-actions | ||
= f.button :submit, t('devise.password.edit.button'), class: 'btn btn-primary' | ||
= render "devise/shared/links" | ||
= render 'devise/shared/links' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
%h2= t('devise.password.reset.title') | ||
= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| | ||
= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| | ||
= f.error_notification | ||
.form-inputs | ||
= f.input :email, :required => true, :autofocus => true | ||
= f.input :email, required: true, autofocus: true | ||
.form-actions | ||
= f.button :submit, t('devise.password.reset.instructions'), class: 'btn btn-primary' | ||
%br | ||
= render "devise/shared/links" | ||
= render 'devise/shared/links' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,12 @@ | ||
%h2 | ||
= t('devise.registration.title', model: resource.class.model_name.human ) | ||
= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| | ||
= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| | ||
= f.error_notification | ||
.form-inputs | ||
= f.input :email, :required => true, :autofocus => true | ||
- if devise_mapping.confirmable? && resource.pending_reconfirmation? | ||
%p | ||
Currently waiting confirmation for: #{resource.unconfirmed_email} | ||
= f.input :password, :autocomplete => "off", hint: t('devise.registration.hint_password'), :required => false | ||
= f.input :password_confirmation, :required => false | ||
= f.input :current_password, hint: t('devise.registration.hint_current_password'), :required => true | ||
= f.input :email, required: true, autofocus: true | ||
= f.input :password, autocomplete: 'off', hint: t('devise.registration.hint_password'), required: false | ||
= f.input :password_confirmation, required: false | ||
= f.input :current_password, hint: t('devise.registration.hint_current_password'), required: true | ||
.form-actions | ||
= f.button :submit, t('btn.update'), class: 'btn btn-primary' | ||
%h3 Cancel my account | ||
%p | ||
Unhappy? #{link_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete} | ||
= link_to t('btn.back'), :back |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
%h2 | ||
= t('devise.registration.new.title', model: resource.class.model_name.human) | ||
= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| | ||
%hr/ | ||
- if devise_mapping.omniauthable? | ||
- resource_class.omniauth_providers.each do |provider| | ||
= link_to omniauth_authorize_path(resource_name, provider), class: 'btn btn-lg btn-primary btn-block' do | ||
%i.fa.fa-facebook | ||
= t('devise.shared.links.signup_with', name: provider.to_s.titleize) | ||
%hr/ | ||
%h3.text-center | ||
= t('view.or') | ||
%hr/ | ||
= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| | ||
= f.error_notification | ||
.form-inputs | ||
= f.input :name, :autofocus => true | ||
= f.input :email, :required => true | ||
= f.input :password, :required => true | ||
= f.input :password_confirmation, :required => true | ||
= f.input :email, required: true | ||
= f.input :password, required: true | ||
= f.input :password_confirmation, required: true | ||
= f.input :name, required: true | ||
= f.input :surname, required: true | ||
= f.input :time_zone, input_html: { class: 'chosen-select'}, include_blank: t('view.select'), required: true | ||
.form-actions | ||
= f.button :submit, t('devise.registration.new.button'), class: 'btn btn-primary' | ||
= render "devise/shared/links" | ||
= render 'devise/shared/links' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
%h2 Resend unlock instructions | ||
= simple_form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| | ||
= simple_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| | ||
= f.error_notification | ||
= f.full_error :unlock_token | ||
.form-inputs | ||
= f.input :email, :required => true, :autofocus => true | ||
= f.input :email, required: true, autofocus: true | ||
.form-actions | ||
= f.button :submit, "Resend unlock instructions" | ||
= render "devise/shared/links" | ||
= f.button :submit, 'Resend unlock instructions' | ||
= render 'devise/shared/links' |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
%h2= t('devise.password.edit.title') | ||
= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| | ||
= f.error_notification | ||
= f.input :reset_password_token, as: :hidden | ||
= f.full_error :reset_password_token | ||
.form-inputs | ||
= f.input :password, required: true, autofocus: true | ||
= f.input :password_confirmation, required: true | ||
.form-actions | ||
= f.button :submit, t('devise.password.edit.button') , class: 'btn btn-primary' | ||
%hr | ||
= render 'devise/shared/links' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
%h2= t('devise.password.new.title') | ||
= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| | ||
= f.error_notification | ||
.form-inputs | ||
= f.input :email, required: true, autofocus: true | ||
.form-actions | ||
= f.button :submit, t('devise.password.reset.instructions'), class: 'btn btn-primary' | ||
|
||
%hr | ||
= render 'devise/shared/links' |
Oops, something went wrong.