Merge branch 'fix_supporter_page_issues'
This commit is contained in:
commit
a0afd0f6a3
5 changed files with 48 additions and 6 deletions
|
|
@ -11,7 +11,7 @@ class Admin::SupportersController < ApplicationController
|
|||
def create
|
||||
params[:supporter_registration][:conference_id] = @conference.id
|
||||
supporter = SupporterRegistration.create!(params[:supporter_registration])
|
||||
flash[:notice] = "Supporter added"
|
||||
render :json => {"status" => "ok"}
|
||||
redirect_to(admin_conference_supporters_path(:conference_id => @conference.short_title), :notice => "Supporter added")
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
|||
38
app/controllers/passwords_controller.rb
Normal file
38
app/controllers/passwords_controller.rb
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
class PasswordsController < Devise::PasswordsController
|
||||
skip_before_filter :verify_user
|
||||
def new
|
||||
super
|
||||
end
|
||||
|
||||
def edit
|
||||
super
|
||||
|
||||
end
|
||||
|
||||
def update
|
||||
@user = User.find_by_reset_password_token(params[:user][:reset_password_token])
|
||||
logger.debug "#{@user.email}"
|
||||
password_changed = false
|
||||
if !params[:user][:password].nil?
|
||||
if !params[:user][:password].empty?
|
||||
password_changed = true
|
||||
else
|
||||
params[:user].delete :password
|
||||
params[:user].delete :password_confirmation
|
||||
end
|
||||
end
|
||||
|
||||
if password_changed
|
||||
successfully_updated = @user.reset_password!(params[:user][:password],params[:user][:password_confirmation])
|
||||
else
|
||||
redirect_to session[:return_to], :notice => "Blank Field Entered" and return
|
||||
end
|
||||
|
||||
if successfully_updated
|
||||
redirect_to root_path, :notice => "Your password is changed" and return
|
||||
else
|
||||
redirect_to session[:return_to] and return
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
#new-supporter-dialog
|
||||
= semantic_form_for :supporter_registration, :remote => true, :html => {:id => "supporter-add-form"} do |f|
|
||||
= semantic_form_for :supporter_registration, :html => {:id => "supporter-add-form"} do |f|
|
||||
= f.input :name, :label => "Supporter Name"
|
||||
= f.input :email, :label => "Supporter Email"
|
||||
= f.input :supporter_level_id, :as => :select, :collection => @conference.supporter_levels
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
Osem::Application.routes.draw do
|
||||
|
||||
devise_for :users, :controllers => { :registrations => :registrations }, :path => 'accounts'
|
||||
devise_for :users, :controllers => { :registrations => :registrations,:passwords=>:passwords }, :path => 'accounts'
|
||||
|
||||
namespace :admin do
|
||||
resources :users
|
||||
|
|
|
|||
5
spec/views/passwords/update.html.erb_spec.rb
Normal file
5
spec/views/passwords/update.html.erb_spec.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe "passwords/update.html.erb" do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue