contour 0.0.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +7 -0
- data/CHANGELOG.rdoc +13 -0
- data/README.rdoc +56 -0
- data/app/controllers/contour/authentications_controller.rb +60 -0
- data/app/controllers/contour/registrations_controller.rb +16 -0
- data/app/controllers/contour/samples_controller.rb +5 -0
- data/app/controllers/contour/sessions_controller.rb +3 -0
- data/app/views/contour/authentications/_index.html.erb +25 -0
- data/app/views/contour/authentications/_menu.html.erb +25 -0
- data/app/views/contour/authentications/index.html.erb +27 -0
- data/app/views/contour/layouts/_menu.html.erb +32 -0
- data/app/views/contour/layouts/_message.html.erb +8 -0
- data/app/views/contour/layouts/application.html.erb +47 -0
- data/app/views/contour/registrations/edit.html.erb +25 -0
- data/app/views/contour/registrations/new.html.erb +37 -0
- data/app/views/contour/samples/index.html.erb +27 -0
- data/app/views/contour/sessions/new.html.erb +25 -0
- data/app/views/devise/passwords/edit.html.erb +16 -0
- data/app/views/devise/passwords/new.html.erb +12 -0
- data/contour.gemspec +27 -0
- data/lib/contour.rb +36 -0
- data/lib/contour/engine.rb +8 -0
- data/lib/contour/version.rb +1 -1
- data/lib/generators/contour/install_generator.rb +38 -0
- data/lib/generators/templates/contour.rb +30 -0
- data/lib/generators/templates/devise.rb +153 -0
- data/lib/generators/templates/omniauth.rb +22 -0
- data/lib/generators/templates/omniauth_fix.rb +98 -0
- data/lib/generators/templates/rack_fix.rb +44 -0
- data/vendor/assets/images/authbuttons/cas_32.png +0 -0
- data/vendor/assets/images/authbuttons/cas_64.png +0 -0
- data/vendor/assets/images/authbuttons/facebook_32.png +0 -0
- data/vendor/assets/images/authbuttons/facebook_64.png +0 -0
- data/vendor/assets/images/authbuttons/google_apps_32.png +0 -0
- data/vendor/assets/images/authbuttons/google_apps_64.png +0 -0
- data/vendor/assets/images/authbuttons/ldap_32.png +0 -0
- data/vendor/assets/images/authbuttons/ldap_64.png +0 -0
- data/vendor/assets/images/authbuttons/linkedin_32.png +0 -0
- data/vendor/assets/images/authbuttons/linkedin_64.png +0 -0
- data/vendor/assets/images/authbuttons/openid_32.png +0 -0
- data/vendor/assets/images/authbuttons/openid_64.png +0 -0
- data/vendor/assets/images/authbuttons/twitter_32.png +0 -0
- data/vendor/assets/images/authbuttons/twitter_64.png +0 -0
- data/vendor/assets/images/redmond/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/vendor/assets/images/redmond/ui-bg_flat_55_fbec88_40x100.png +0 -0
- data/vendor/assets/images/redmond/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
- data/vendor/assets/images/redmond/ui-bg_glass_85_dfeffc_1x400.png +0 -0
- data/vendor/assets/images/redmond/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/vendor/assets/images/redmond/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
- data/vendor/assets/images/redmond/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
- data/vendor/assets/images/redmond/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
- data/vendor/assets/images/redmond/ui-icons_217bc0_256x240.png +0 -0
- data/vendor/assets/images/redmond/ui-icons_2e83ff_256x240.png +0 -0
- data/vendor/assets/images/redmond/ui-icons_469bdd_256x240.png +0 -0
- data/vendor/assets/images/redmond/ui-icons_6da8d5_256x240.png +0 -0
- data/vendor/assets/images/redmond/ui-icons_cd0a0a_256x240.png +0 -0
- data/vendor/assets/images/redmond/ui-icons_d8e7f3_256x240.png +0 -0
- data/vendor/assets/images/redmond/ui-icons_f9bd01_256x240.png +0 -0
- data/vendor/assets/javascripts/contour.js +8 -0
- data/vendor/assets/javascripts/errors.js.coffee +10 -0
- data/vendor/assets/javascripts/external/exporting-2.1.4.src.js +673 -0
- data/vendor/assets/javascripts/external/highcharts-2.1.4.src.js +10668 -0
- data/vendor/assets/javascripts/external/jquery-ui-1.8.10.custom.min.js +782 -0
- data/vendor/assets/javascripts/external/waypoints.js +610 -0
- data/vendor/assets/javascripts/global.js.coffee +38 -0
- data/vendor/assets/javascripts/menu.js.coffee +6 -0
- data/vendor/assets/javascripts/popup.js.coffee +67 -0
- data/vendor/assets/stylesheets/authentication.css +63 -0
- data/vendor/assets/stylesheets/bluetrip-screen.css +324 -0
- data/vendor/assets/stylesheets/contour.css +15 -0
- data/vendor/assets/stylesheets/global.css +59 -0
- data/vendor/assets/stylesheets/header.css +18 -0
- data/vendor/assets/stylesheets/jquery-ui-1.8.10.custom.css +574 -0
- data/vendor/assets/stylesheets/menu.css +77 -0
- data/vendor/assets/stylesheets/message.css +27 -0
- data/vendor/assets/stylesheets/popup.css +79 -0
- metadata +114 -29
- data/README +0 -18
data/.gitignore
ADDED
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
== 0.1.1
|
2
|
+
|
3
|
+
* Bug Fix
|
4
|
+
* Apparently add_dependency doesn't currently work without ~> Set Omniauth dependency to increment on bug fix revision
|
5
|
+
|
6
|
+
== 0.1.0
|
7
|
+
|
8
|
+
* Enhancements
|
9
|
+
* Contour can now be used as a default template for the application layout
|
10
|
+
* Contour provides assets, (images, css, and javascript), to provide an easy authentication system built on top of Devise and Omniauth
|
11
|
+
* Contour provides CSS based on Bluetrip to provide cross-browser compatiblity
|
12
|
+
* Contour rails generator provides fixes to Rack and Omniauth to allow correct reverse proxy (chaining) authentication to machines behind firewalls
|
13
|
+
|
1
14
|
== 0.0.0
|
2
15
|
|
3
16
|
* Skeleton files to compile gem and make it available on rubygems.org
|
data/README.rdoc
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
= Contour
|
2
|
+
|
3
|
+
Basic Rails framework files and assets for layout and authentication
|
4
|
+
|
5
|
+
== Installation
|
6
|
+
|
7
|
+
Contour can be installed from rubygems.org using:
|
8
|
+
|
9
|
+
gem install contour
|
10
|
+
|
11
|
+
Or update your Gemfile to include:
|
12
|
+
|
13
|
+
gem 'contour'
|
14
|
+
|
15
|
+
== Getting started
|
16
|
+
|
17
|
+
Contour depends on a config initializer. The config initializer is used to set various default settings in the layout, and also allows the menu to be created using a ruby hash. To install a template you can run:
|
18
|
+
|
19
|
+
rails generate contour:install
|
20
|
+
|
21
|
+
Contour uses a template to generate your application layout. You can add the following in your application_controller.rb:
|
22
|
+
|
23
|
+
layout "contour/layouts/application"
|
24
|
+
|
25
|
+
Contour also provides a custom jquery-ui and BlueTrip CSS Framework. To include these, add the following to your application.css manifest:
|
26
|
+
|
27
|
+
*= require contour
|
28
|
+
|
29
|
+
Contour provides custom JavaScript. In order to make the application layout function properly include the following at the beginning of your application.js:
|
30
|
+
|
31
|
+
//= require contour
|
32
|
+
|
33
|
+
In order to get registration working, you can use the modified Contour Authentications controller which overrides the default devise controller of the same name:
|
34
|
+
|
35
|
+
match '/auth/failure' => 'contour/authentications#failure'
|
36
|
+
match '/auth/:provider/callback' => 'contour/authentications#create'
|
37
|
+
match '/auth/:provider' => 'contour/authentications#passthru'
|
38
|
+
|
39
|
+
resources :authentications, :controller => 'contour/authentications'
|
40
|
+
|
41
|
+
devise_for :users, :controllers => {:registrations => 'contour/registrations'}, :path_names => { :sign_up => 'register', :sign_in => 'login' }
|
42
|
+
|
43
|
+
== Contributing to contour
|
44
|
+
|
45
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
46
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
47
|
+
* Fork the project
|
48
|
+
* Start a feature/bugfix branch
|
49
|
+
* Commit and push until you are happy with your contribution
|
50
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
51
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
52
|
+
|
53
|
+
== Copyright
|
54
|
+
|
55
|
+
Copyright (c) 2011 Remo Mueller. See LICENSE for further details.
|
56
|
+
|
@@ -0,0 +1,60 @@
|
|
1
|
+
class Contour::AuthenticationsController < ApplicationController
|
2
|
+
def index
|
3
|
+
@authentications = current_user.authentications if current_user
|
4
|
+
end
|
5
|
+
|
6
|
+
def passthru
|
7
|
+
render :file => "#{Rails.root}/public/404.html", :status => 404, :layout => false
|
8
|
+
end
|
9
|
+
|
10
|
+
def failure
|
11
|
+
redirect_to new_user_session_path, :alert => params[:message].blank? ? nil : params[:message].humanize
|
12
|
+
end
|
13
|
+
|
14
|
+
def create
|
15
|
+
logger.info "request #{request.env["omniauth.auth"].inspect}"
|
16
|
+
omniauth = request.env["omniauth.auth"]
|
17
|
+
logger.info "omniauth: #{omniauth.inspect}"
|
18
|
+
|
19
|
+
if omniauth
|
20
|
+
|
21
|
+
omniauth['uid'] = omniauth['user_info']['email'] if omniauth['provider'] == 'google_apps' and omniauth['user_info']
|
22
|
+
authentication = Authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid'])
|
23
|
+
logger.info "OMNI AUTH INFO: #{omniauth.inspect}"
|
24
|
+
omniauth['user_info']['email'] = omniauth['extra']['user_hash']['email'] if omniauth['user_info'] and omniauth['user_info']['email'].blank? and omniauth['extra'] and omniauth['extra']['user_hash']
|
25
|
+
if authentication
|
26
|
+
session["user_return_to"] = request.env["action_dispatch.request.unsigned_session_cookie"]["user_return_to"] if request.env and request.env["action_dispatch.request.unsigned_session_cookie"] and request.env["action_dispatch.request.unsigned_session_cookie"]["user_return_to"] and session["user_return_to"].blank?
|
27
|
+
flash[:notice] = "Signed in successfully." if authentication.user.active_for_authentication?
|
28
|
+
sign_in_and_redirect(:user, authentication.user)
|
29
|
+
elsif current_user
|
30
|
+
current_user.authentications.create!(:provider => omniauth['provider'], :uid => omniauth['uid'])
|
31
|
+
redirect_to authentications_path, :notice => "Authentication successful."
|
32
|
+
else
|
33
|
+
user = User.new(params[:user])
|
34
|
+
user.apply_omniauth(omniauth)
|
35
|
+
if user.save
|
36
|
+
session["user_return_to"] = request.env["action_dispatch.request.unsigned_session_cookie"]["user_return_to"] if request.env and request.env["action_dispatch.request.unsigned_session_cookie"] and request.env["action_dispatch.request.unsigned_session_cookie"]["user_return_to"] and session["user_return_to"].blank?
|
37
|
+
flash[:notice] = "Signed in successfully." if user.active_for_authentication?
|
38
|
+
sign_in_and_redirect(:user, user)
|
39
|
+
else
|
40
|
+
session[:omniauth] = omniauth.except('extra')
|
41
|
+
redirect_to new_user_registration_path
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
else
|
46
|
+
request.env.keys.each do |key|
|
47
|
+
logger.info "request.env[#{key}]: #{request.env[key]}"
|
48
|
+
end
|
49
|
+
redirect_to authentications_path, :alert => "Authentication not successful."
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
def destroy
|
55
|
+
@authentication = current_user.authentications.find(params[:id])
|
56
|
+
@authentication.destroy
|
57
|
+
flash[:notice] = "Successfully destroyed authentication."
|
58
|
+
redirect_to authentications_path
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class Contour::RegistrationsController < Devise::RegistrationsController
|
2
|
+
def create
|
3
|
+
super
|
4
|
+
session[:omniauth] = nil unless @user.new_record?
|
5
|
+
end
|
6
|
+
|
7
|
+
private
|
8
|
+
|
9
|
+
def build_resource(*args)
|
10
|
+
super
|
11
|
+
if session[:omniauth]
|
12
|
+
@user.apply_omniauth(session[:omniauth])
|
13
|
+
@user.valid?
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<table style="border-collapse:collapse;table-layout:fixed;margin:0px;padding:0px;border-width:0px"><%= ("<col width='64px'/>" * PROVIDERS.size).html_safe %>
|
2
|
+
<tr>
|
3
|
+
<% PROVIDERS.each do |provider| %>
|
4
|
+
<% url_params = (provider == :google_apps) ? '?domain=gmail.com' : '' %>
|
5
|
+
<% if provider == :open_id %>
|
6
|
+
<% provider_name = 'OpenID' %>
|
7
|
+
<% image_name = 'openid' %>
|
8
|
+
<% elsif provider == :linked_in %>
|
9
|
+
<% provider_name = 'LinkedIn' %>
|
10
|
+
<% image_name = 'linkedin' %>
|
11
|
+
<% elsif [:LDAP, :CAS].include?(provider) %>
|
12
|
+
<% provider_name = provider.to_s.upcase %>
|
13
|
+
<% image_name = provider.to_s.downcase %>
|
14
|
+
<% else %>
|
15
|
+
<% provider_name = provider.to_s.titleize %>
|
16
|
+
<% image_name = provider.to_s.downcase %>
|
17
|
+
<% end %>
|
18
|
+
<td style="white-space:nowrap;text-align:center;border-width:0px">
|
19
|
+
<a href="<%= SITE_URL %>/<%= OmniAuth.config.path_prefix.split('/').last.to_s %>/<%= provider.to_s.downcase %><%= url_params %>" class="noicon"><%= image_tag "authbuttons/#{image_name}_64.png", :align => 'absmiddle', :size => "64x64", :alt => provider_name %></a>
|
20
|
+
<br /><br />
|
21
|
+
<%= provider_name %>
|
22
|
+
</td>
|
23
|
+
<% end %>
|
24
|
+
</tr>
|
25
|
+
</table>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<% PROVIDERS.each do |provider| %>
|
2
|
+
|
3
|
+
<% url_params = (provider == :google_apps) ? '?domain=gmail.com' : '' %>
|
4
|
+
<% if provider == :open_id %>
|
5
|
+
<% provider_name = 'OpenID' %>
|
6
|
+
<% image_name = 'openid' %>
|
7
|
+
<% elsif provider == :linked_in %>
|
8
|
+
<% provider_name = 'LinkedIn' %>
|
9
|
+
<% image_name = 'linkedin' %>
|
10
|
+
<% elsif [:LDAP, :CAS].include?(provider) %>
|
11
|
+
<% provider_name = provider.to_s.upcase %>
|
12
|
+
<% image_name = provider.to_s.downcase %>
|
13
|
+
<% else %>
|
14
|
+
<% provider_name = provider.to_s.titleize %>
|
15
|
+
<% image_name = provider.to_s.downcase %>
|
16
|
+
<% end %>
|
17
|
+
<div style="float:right;margin-right:15px;width:32px;position:relative">
|
18
|
+
<div style="position:absolute;top:-4px">
|
19
|
+
<a href="<%= SITE_URL %>/<%= OmniAuth.config.path_prefix.split('/').last.to_s %>/<%= provider.to_s.downcase %><%= url_params %>" class="noicon">
|
20
|
+
<%= image_tag "authbuttons/#{image_name}_32.png", :align => 'absmiddle', :size => "28x28", :title => provider_name %>
|
21
|
+
</a>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<% end %>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<!-- authentications/index.html.erb -->
|
2
|
+
<% @title = "Authentications" %>
|
3
|
+
|
4
|
+
<h1><%= @title %></h1>
|
5
|
+
|
6
|
+
<% if @authentications %>
|
7
|
+
<% unless @authentications.empty? %>
|
8
|
+
<p><strong>You can sign in to this account using:</strong></p>
|
9
|
+
<div class="authentications">
|
10
|
+
<% for authentication in @authentications %>
|
11
|
+
<div class="authentication">
|
12
|
+
<%= image_tag "authbuttons/#{authentication.provider}_32.png", :size => "32x32" %>
|
13
|
+
<div class="provider"><%= authentication.provider.titleize %></div>
|
14
|
+
<div class="uid"><%= authentication.uid %></div>
|
15
|
+
<%= link_to "X", authentication, :confirm => 'Are you sure you want to remove this authentication option?', :method => :delete, :class => "remove" %>
|
16
|
+
</div>
|
17
|
+
<% end %>
|
18
|
+
<div style="clear:both"></div>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
<p><strong>Add another service to sign in with:</strong></p>
|
22
|
+
<% else %>
|
23
|
+
<p><strong>Sign in through one of these services:</strong></p>
|
24
|
+
<% end %>
|
25
|
+
|
26
|
+
|
27
|
+
<%= render :partial => 'contour/authentications/index' %>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<% display = ['not_signed_in', 'always'] %>
|
2
|
+
<% if user_signed_in? -%>
|
3
|
+
<% display = ['signed_in', 'always'] %>
|
4
|
+
<% end %>
|
5
|
+
|
6
|
+
<% Contour.menu_items.each do |menu_item| %>
|
7
|
+
<% if display.include?(menu_item[:display]) %>
|
8
|
+
<div style="float:<%= menu_item[:position] %>">
|
9
|
+
<%= link_to_function (menu_item[:eval] ? eval(menu_item[:name]) : menu_item[:name]), "$('#menu_#{menu_item[:id]}').show();", :onmouseover => "$('#menu_#{menu_item[:id]}').show();" %>
|
10
|
+
<div style="position:relative;">
|
11
|
+
<div id="menu_<%= menu_item[:id] %>" class="menu_dropdown_<%= menu_item[:position_class] %>" style="display:none">
|
12
|
+
<% menu_item[:links].each do |link| %>
|
13
|
+
<% if link[:html].blank? %>
|
14
|
+
<div style="white-space:nowrap">
|
15
|
+
<%= link_to (link[:eval] ? eval(link[:name]) : link[:name]), eval(link[:path]), :class => 'noicon' %>
|
16
|
+
</div>
|
17
|
+
<% else %>
|
18
|
+
<%= link[:eval] ? eval(link[:html]).html_safe : link[:html].html_safe %>
|
19
|
+
<% end %>
|
20
|
+
<% end %>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
<% end %>
|
25
|
+
<% end %>
|
26
|
+
|
27
|
+
<% ids = Contour.menu_items.select{|mi| display.include?(mi[:display])}.collect{|mi| mi[:id]} %>
|
28
|
+
<%= javascript_tag "hideOnMouseOut([#{ids.collect{|id| "'#menu_#{id}'"}.join(',')}]);" %>
|
29
|
+
|
30
|
+
<%= render :partial => 'contour/authentications/menu' unless user_signed_in? %>
|
31
|
+
|
32
|
+
<div style="clear:both"></div>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<% unless notice.blank? %>
|
2
|
+
<div id="msg_notice" class="notice" style="display:none"><%= notice %></div>
|
3
|
+
<%= javascript_tag "showMessage(['#msg_notice']);" %>
|
4
|
+
<% end %>
|
5
|
+
<% unless alert.blank? %>
|
6
|
+
<div id="msg_alert" class="error" style="display:none"><%= alert %></div>
|
7
|
+
<%= javascript_tag "showMessage(['#msg_alert']);" %>
|
8
|
+
<% end %>
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title><%= [Contour.application_name, @title].compact.join(' - ').html_safe %></title>
|
5
|
+
<%= favicon_link_tag %>
|
6
|
+
<%= stylesheet_link_tag "application" %>
|
7
|
+
<%= javascript_include_tag "application" %>
|
8
|
+
<%= csrf_meta_tags %>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<%= javascript_tag "var root_url='#{SITE_URL + '/'}';var auth_token='#{form_authenticity_token}';" %>
|
12
|
+
<div id="header" class="container" style="background-image: url(<%= SITE_URL %>/assets/<%= Contour.header_background_image %>);">
|
13
|
+
<div id="version" style="position:relative;display:none">
|
14
|
+
<span style="position:absolute;top:-15px;left:82px;font-size:0.5em;font-variant:normal" class="quiet"><%= Contour.application_version %></span>
|
15
|
+
</div>
|
16
|
+
<%= image_tag(Contour.header_title_image, :alt => '', :style => 'vertical-align:middle') unless Contour.header_title_image.blank? %>
|
17
|
+
<%= link_to DEFAULT_APP_NAME, root_path, :style => 'text-decoration:none;color:#404040;', :onmouseover => "$('#version').show();", :onmouseout => "$('#version').hide();" %>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<div class="container" style="position:relative">
|
21
|
+
<div id="message">
|
22
|
+
<%= render :partial => 'contour/layouts/message' %>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<div style="height:29px">
|
27
|
+
<div id="menu" class="container">
|
28
|
+
<%= render :partial => 'contour/layouts/menu' %>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<div id="content" class="container">
|
33
|
+
<%= yield %>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<div id="popup" style="overflow-y: hidden;">
|
37
|
+
<div id="popup_header" style="padding: 12px;">
|
38
|
+
<div style="float:right;margin-right:10px; margin-top:-4px"><%= image_tag(Contour.header_title_image, :alt => '') %></div>
|
39
|
+
<a id="popup_close">x</a>
|
40
|
+
<h1 id="popup_title"></h1>
|
41
|
+
</div>
|
42
|
+
<div id="popup_content"></div>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div id="background_popup"></div>
|
46
|
+
</body>
|
47
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<h2>Edit <%= resource_name.to_s.humanize %></h2>
|
2
|
+
|
3
|
+
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
|
4
|
+
<%= devise_error_messages! %>
|
5
|
+
|
6
|
+
<p><%= f.label :email %><br />
|
7
|
+
<%= f.text_field :email %></p>
|
8
|
+
|
9
|
+
<p><%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
|
10
|
+
<%= f.password_field :password %></p>
|
11
|
+
|
12
|
+
<p><%= f.label :password_confirmation %><br />
|
13
|
+
<%= f.password_field :password_confirmation %></p>
|
14
|
+
|
15
|
+
<p><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
|
16
|
+
<%= f.password_field :current_password %></p>
|
17
|
+
|
18
|
+
<p><%= f.submit "Update" %></p>
|
19
|
+
<% end %>
|
20
|
+
|
21
|
+
<h3>Cancel my account</h3>
|
22
|
+
|
23
|
+
<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete %>.</p>
|
24
|
+
|
25
|
+
<%= link_to "Back", :back %>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
<% @title = 'Sign Up' %>
|
2
|
+
<h2><%= @title %></h2>
|
3
|
+
|
4
|
+
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
|
5
|
+
<%= devise_error_messages! %>
|
6
|
+
|
7
|
+
<p><%= f.label :first_name %><br />
|
8
|
+
<%= f.text_field :first_name %>
|
9
|
+
</p>
|
10
|
+
|
11
|
+
<p><%= f.label :last_name %><br />
|
12
|
+
<%= f.text_field :last_name %></p>
|
13
|
+
|
14
|
+
<p><%= f.label :email %><br />
|
15
|
+
<%= f.text_field :email %></p>
|
16
|
+
|
17
|
+
<% if @user.password_required? %>
|
18
|
+
<p><%= f.label :password %><br />
|
19
|
+
<%= f.password_field :password %></p>
|
20
|
+
|
21
|
+
<p><%= f.label :password_confirmation %><br />
|
22
|
+
<%= f.password_field :password_confirmation %></p>
|
23
|
+
<% end %>
|
24
|
+
|
25
|
+
<p><%= f.submit "Sign up" %></p>
|
26
|
+
<% end %>
|
27
|
+
|
28
|
+
<%= render :partial => "devise/shared/links" %>
|
29
|
+
|
30
|
+
<% if false %>
|
31
|
+
<% if @user.password_required? %>
|
32
|
+
<% unless PROVIDERS.blank? %>
|
33
|
+
<h3>Don't want to remember a new login and password? Sign up using one of your existing accounts!</h3>
|
34
|
+
<%= render :partial => 'contour/authentications/index' %>
|
35
|
+
<% end %>
|
36
|
+
<% end %>
|
37
|
+
<% end %>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<h1>Contour Details</h1>
|
2
|
+
|
3
|
+
<p>
|
4
|
+
<b>Contour Version:</b>
|
5
|
+
<%= Contour::VERSION %>
|
6
|
+
</p>
|
7
|
+
|
8
|
+
<h2>Application Details</h2>
|
9
|
+
|
10
|
+
These items can all be specified in:<br />
|
11
|
+
<br />
|
12
|
+
<code style="margin-left:10px">config/initializers/contour.rb</code><br />
|
13
|
+
<br />
|
14
|
+
If the file does not exist run:<br />
|
15
|
+
<br />
|
16
|
+
<code style="margin-left:10px">rails generate contour:install</code><br />
|
17
|
+
<br />
|
18
|
+
<% ['application_name', 'application_version', 'header_background_image', 'header_title_image'].each do |attribute| %>
|
19
|
+
<p>
|
20
|
+
<b><%= attribute.titleize %>:</b>
|
21
|
+
<% if Contour.send(attribute).blank? %>
|
22
|
+
<span class="quiet">NULL</span>
|
23
|
+
<% else %>
|
24
|
+
<%= Contour.send(attribute) %>
|
25
|
+
<% end %>
|
26
|
+
</p>
|
27
|
+
<% end %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<% @title = 'Login' %>
|
2
|
+
<h2><%= @title %></h2>
|
3
|
+
|
4
|
+
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
|
5
|
+
<p><%= f.label :email %><br />
|
6
|
+
<%= f.text_field :email %></p>
|
7
|
+
|
8
|
+
<p><%= f.label :password %><br />
|
9
|
+
<%= f.password_field :password %></p>
|
10
|
+
|
11
|
+
<% if devise_mapping.rememberable? -%>
|
12
|
+
<p><%= f.check_box :remember_me %> <%= f.label :remember_me %></p>
|
13
|
+
<% end -%>
|
14
|
+
|
15
|
+
<p><%= f.submit "Sign in" %></p>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<%= render :partial => "devise/shared/links" %>
|
19
|
+
|
20
|
+
<% if false %>
|
21
|
+
<% unless PROVIDERS.blank? %>
|
22
|
+
<h3>Don't want to remember a new login and password? Sign in using one of your existing accounts!</h3>
|
23
|
+
<%= render :partial => 'contour/authentications/index' %>
|
24
|
+
<% end %>
|
25
|
+
<% end %>
|