contour 1.0.0.beta3 → 1.0.0.beta4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.rdoc +1 -0
- data/app/assets/javascripts/contour/global.js.coffee +0 -3
- data/app/assets/javascripts/twitter-bootstrap/bootstrap.js.coffee +1 -0
- data/app/controllers/contour/sessions_controller.rb +23 -1
- data/app/views/contour/_links.html.erb +25 -0
- data/app/views/contour/confirmations/new.html.erb +15 -7
- data/app/views/contour/layouts/_latest_news.html.erb +14 -13
- data/app/views/contour/passwords/edit.html.erb +21 -9
- data/app/views/contour/passwords/new.html.erb +15 -7
- data/app/views/contour/registrations/edit.html.erb +42 -17
- data/app/views/contour/registrations/new.html.erb +27 -11
- data/app/views/contour/samples/index.html.erb +21 -17
- data/app/views/contour/sessions/new.html.erb +37 -12
- data/app/views/contour/unlocks/new.html.erb +15 -7
- data/lib/contour/version.rb +1 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +1048 -0
- metadata +27 -26
data/CHANGELOG.rdoc
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
* Twitter-Bootstrap CSS layout is now default!
|
5
5
|
* Authentications can now be placed as a submenu using { authentications: true } anywhere in the contour links configuration
|
6
6
|
* Rails updated to minimum 3.2.3
|
7
|
+
* Redirects to the user's alternate login page if a user fails to login on the default devise sign in page
|
7
8
|
|
8
9
|
* Breaking Changes
|
9
10
|
* CSS updated to use Twitter-Bootstrap
|
@@ -5,6 +5,3 @@
|
|
5
5
|
element.html('<br /><center><img width=\"13\" height=\"13\" src=\"' + root_url + 'assets/ajax-loader.gif\" align=\"absmiddle\" alt=\"...\" />' + text + '</center><br />')
|
6
6
|
else if element
|
7
7
|
element.html('<img width=\"13\" height=\"13\" src=\"' + root_url + 'assets/ajax-loader.gif\" align=\"absmiddle\" alt=\"...\" />' + text)
|
8
|
-
|
9
|
-
jQuery ->
|
10
|
-
$(".collapse").collapse()
|
@@ -19,4 +19,26 @@ class Contour::SessionsController < Devise::SessionsController
|
|
19
19
|
super
|
20
20
|
end
|
21
21
|
|
22
|
-
|
22
|
+
# Overwrite Devise authentication to check if the user is typing another credential into the default box
|
23
|
+
# if so, find alternative login methods for that user and forward the user to those login screens
|
24
|
+
def create
|
25
|
+
# resource = warden.authenticate!(auth_options)
|
26
|
+
resource = warden.authenticate(auth_options)
|
27
|
+
|
28
|
+
if resource
|
29
|
+
set_flash_message(:notice, :signed_in) if is_navigational_format?
|
30
|
+
sign_in(resource_name, resource)
|
31
|
+
respond_with resource, location: after_sign_in_path_for(resource)
|
32
|
+
else
|
33
|
+
resource = resource_name.to_s.titleize.constantize.find_by_email(params[resource_name][:email])
|
34
|
+
if resource and resource.respond_to?('authentications') and providers = resource.authentications.pluck(:provider).uniq and providers.size > 0
|
35
|
+
redirect_to request.script_name + '/auth/' + providers.first
|
36
|
+
elsif providers = Authentication.where(uid: params[resource_name][:email]).pluck(:provider).uniq and providers.size > 0
|
37
|
+
redirect_to request.script_name + '/auth/' + providers.first
|
38
|
+
else
|
39
|
+
resource = warden.authenticate!(auth_options)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%- if controller_name != 'sessions' %>
|
2
|
+
<%= link_to "Sign in", new_session_path(resource_name), class: 'btn btn-mini' %>
|
3
|
+
<% end -%>
|
4
|
+
|
5
|
+
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
6
|
+
<%= link_to "Sign up", new_registration_path(resource_name), class: 'btn btn-mini' %>
|
7
|
+
<% end -%>
|
8
|
+
|
9
|
+
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
|
10
|
+
<%= link_to "Forgot your password?", new_password_path(resource_name), class: 'btn btn-mini' %>
|
11
|
+
<% end -%>
|
12
|
+
|
13
|
+
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
14
|
+
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name), class: 'btn btn-mini' %>
|
15
|
+
<% end -%>
|
16
|
+
|
17
|
+
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
18
|
+
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name), class: 'btn btn-mini' %>
|
19
|
+
<% end -%>
|
20
|
+
|
21
|
+
<%- if devise_mapping.omniauthable? %>
|
22
|
+
<%- resource_class.omniauth_providers.each do |provider| %>
|
23
|
+
<%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider), class: 'btn btn-mini' %>
|
24
|
+
<% end -%>
|
25
|
+
<% end -%>
|
@@ -1,12 +1,20 @@
|
|
1
|
-
|
1
|
+
<% @title = 'Resend confirmation instructions' %>
|
2
|
+
<div class="page-header">
|
3
|
+
<h1><%= @title %></h1>
|
4
|
+
</div>
|
2
5
|
|
3
|
-
<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
|
6
|
+
<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post, class: 'form-horizontal' }) do |f| %>
|
4
7
|
<%= devise_error_messages! %>
|
5
8
|
|
6
|
-
<div
|
7
|
-
|
9
|
+
<div class="control-group">
|
10
|
+
<%= f.label :email, class: 'control-label' %>
|
11
|
+
<div class="controls">
|
12
|
+
<%= f.email_field :email %>
|
13
|
+
</div>
|
14
|
+
</div>
|
8
15
|
|
9
|
-
<div
|
16
|
+
<div class="form-actions">
|
17
|
+
<%= f.submit "Resend confirmation instructions", class: 'btn btn-primary' %>
|
18
|
+
<%= render partial: 'contour/links' %>
|
19
|
+
</div>
|
10
20
|
<% end %>
|
11
|
-
|
12
|
-
<%= render "links" %>
|
@@ -1,16 +1,17 @@
|
|
1
1
|
<% unless @news_feed.blank? %>
|
2
|
-
<
|
3
|
-
<
|
2
|
+
<div class="page-header">
|
3
|
+
<h1>
|
4
|
+
Latest News
|
5
|
+
<%#= link_to @news_feed.channel.title, @news_feed.channel.link, target: '_blank', class: 'btn btn-mini' %>
|
6
|
+
</h1>
|
7
|
+
</div>
|
4
8
|
|
5
|
-
|
6
|
-
<
|
7
|
-
|
8
|
-
|
9
|
-
<
|
10
|
-
|
11
|
-
<ul style="list-style: none"><li><%= item.description.gsub("[...]", link_to('[read more]', item.link, target: '_blank')).html_safe %></li></ul>
|
12
|
-
</div>
|
13
|
-
<% end %>
|
9
|
+
<% @news_feed.items.each_with_index do |item, i| %>
|
10
|
+
<% if i < Contour.news_feed_items.to_i %>
|
11
|
+
<div class="well">
|
12
|
+
<label><%= link_to item.title, item.link, target: '_blank' %></label><br />
|
13
|
+
<ul style="list-style: none"><li><%= item.description.gsub("[...]", link_to('[read more]', item.link, target: '_blank')).html_safe %></li></ul>
|
14
|
+
</div>
|
14
15
|
<% end %>
|
15
|
-
|
16
|
-
<% end %>
|
16
|
+
<% end %>
|
17
|
+
<% end %>
|
@@ -1,16 +1,28 @@
|
|
1
|
-
|
1
|
+
<% @title = 'Change your password' %>
|
2
|
+
<div class="page-header">
|
3
|
+
<h1><%= @title %></h1>
|
4
|
+
</div>
|
2
5
|
|
3
|
-
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
|
6
|
+
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, class: 'form-horizontal' }) do |f| %>
|
4
7
|
<%= devise_error_messages! %>
|
5
8
|
<%= f.hidden_field :reset_password_token %>
|
6
9
|
|
7
|
-
<div
|
8
|
-
|
10
|
+
<div class="control-group">
|
11
|
+
<%= f.label :password, "New password", class: 'control-label' %>
|
12
|
+
<div class="controls">
|
13
|
+
<%= f.password_field :password %>
|
14
|
+
</div>
|
15
|
+
</div>
|
9
16
|
|
10
|
-
<div
|
11
|
-
|
17
|
+
<div class="control-group">
|
18
|
+
<%= f.label :password_confirmation, "Confirm new password", class: 'control-label' %>
|
19
|
+
<div class="controls">
|
20
|
+
<%= f.password_field :password_confirmation %>
|
21
|
+
</div>
|
22
|
+
</div>
|
12
23
|
|
13
|
-
<div
|
24
|
+
<div class="form-actions">
|
25
|
+
<%= f.submit "Change my password", class: 'btn btn-primary' %>
|
26
|
+
<%= render partial: 'contour/links' %>
|
27
|
+
</div>
|
14
28
|
<% end %>
|
15
|
-
|
16
|
-
<%= render "links" %>
|
@@ -1,12 +1,20 @@
|
|
1
|
-
|
1
|
+
<% @title = 'Forgot your password?' %>
|
2
|
+
<div class="page-header">
|
3
|
+
<h1><%= @title %></h1>
|
4
|
+
</div>
|
2
5
|
|
3
|
-
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
|
6
|
+
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post, class: 'form-horizontal' }) do |f| %>
|
4
7
|
<%= devise_error_messages! %>
|
5
8
|
|
6
|
-
<div
|
7
|
-
|
9
|
+
<div class="control-group">
|
10
|
+
<%= f.label :email, class: 'control-label' %>
|
11
|
+
<div class="controls">
|
12
|
+
<%= f.email_field :email %>
|
13
|
+
</div>
|
14
|
+
</div>
|
8
15
|
|
9
|
-
<div
|
16
|
+
<div class="form-actions">
|
17
|
+
<%= f.submit "Send me reset password instructions", class: 'btn btn-primary' %>
|
18
|
+
<%= render partial: 'contour/links' %>
|
19
|
+
</div>
|
10
20
|
<% end %>
|
11
|
-
|
12
|
-
<%= render "links" %>
|
@@ -1,25 +1,50 @@
|
|
1
|
-
|
1
|
+
<% @title = "Edit #{resource_name.to_s.humanize}" %>
|
2
|
+
<div class="page-header">
|
3
|
+
<h1><%= @title %></h1>
|
4
|
+
</div>
|
2
5
|
|
3
|
-
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :
|
6
|
+
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), html: { method: :put, class: 'form-horizontal' }) do |f| %>
|
4
7
|
<%= devise_error_messages! %>
|
5
8
|
|
6
|
-
<div
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
9
|
+
<div class="control-group">
|
10
|
+
<%= f.label :email, class: 'control-label' %>
|
11
|
+
<div class="controls">
|
12
|
+
<%= f.email_field :email %>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<div class="control-group">
|
17
|
+
<%= f.label :password, class: 'control-label' %>
|
18
|
+
<div class="controls">
|
19
|
+
<%= f.password_field :password, :autocomplete => "off" %>
|
20
|
+
<i class="help-block">(leave blank if you don't want to change it)</i>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div class="control-group">
|
25
|
+
<%= f.label :password_confirmation, class: 'control-label' %>
|
26
|
+
<div class="controls">
|
27
|
+
<%= f.password_field :password_confirmation %>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div class="control-group">
|
32
|
+
<%= f.label :current_password, class: 'control-label' %>
|
33
|
+
<div class="controls">
|
34
|
+
<%= f.password_field :current_password %>
|
35
|
+
<i class="help-block">(we need your current password to confirm your changes)</i>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div class="form-actions">
|
40
|
+
<%= f.submit "Update", class: 'btn btn-primary' %>
|
41
|
+
</div>
|
19
42
|
<% end %>
|
20
43
|
|
21
|
-
<
|
44
|
+
<div class="page-header">
|
45
|
+
<h3>Cancel my account</h3>
|
46
|
+
</div>
|
22
47
|
|
23
|
-
<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete %>.</p>
|
48
|
+
<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete, class: 'btn btn-danger' %>.</p>
|
24
49
|
|
25
50
|
<%= link_to "Back", :back %>
|
@@ -1,18 +1,34 @@
|
|
1
|
-
|
1
|
+
<% @title = 'Sign up' %>
|
2
|
+
<div class="page-header">
|
3
|
+
<h1><%= @title %></h1>
|
4
|
+
</div>
|
2
5
|
|
3
|
-
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
|
6
|
+
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), html: { class: 'form-horizontal' }) do |f| %>
|
4
7
|
<%= devise_error_messages! %>
|
5
8
|
|
6
|
-
<div
|
7
|
-
|
9
|
+
<div class="control-group">
|
10
|
+
<%= f.label :email, class: 'control-label' %>
|
11
|
+
<div class="controls">
|
12
|
+
<%= f.email_field :email %>
|
13
|
+
</div>
|
14
|
+
</div>
|
8
15
|
|
9
|
-
<div
|
10
|
-
|
16
|
+
<div class="control-group">
|
17
|
+
<%= f.label :password, class: 'control-label' %>
|
18
|
+
<div class="controls">
|
19
|
+
<%= f.password_field :password %>
|
20
|
+
</div>
|
21
|
+
</div>
|
11
22
|
|
12
|
-
<div
|
13
|
-
|
23
|
+
<div class="control-group">
|
24
|
+
<%= f.label :password_confirmation, class: 'control-label' %>
|
25
|
+
<div class="controls">
|
26
|
+
<%= f.password_field :password_confirmation %>
|
27
|
+
</div>
|
28
|
+
</div>
|
14
29
|
|
15
|
-
<div
|
30
|
+
<div class="form-actions">
|
31
|
+
<%= f.submit "Sign up", class: 'btn btn-primary' %>
|
32
|
+
<%= render partial: 'contour/links' %>
|
33
|
+
</div>
|
16
34
|
<% end %>
|
17
|
-
|
18
|
-
<%= render "links" %>
|
@@ -1,9 +1,13 @@
|
|
1
|
-
|
1
|
+
<% @title = 'Contour Details' %>
|
2
|
+
<div class="page-header">
|
3
|
+
<h1><%= @title %></h1>
|
4
|
+
</div>
|
5
|
+
|
6
|
+
<dl class="dl-horizontal">
|
7
|
+
<dt>Contour Version</dt>
|
8
|
+
<dd><%= Contour::VERSION::STRING %></dd>
|
9
|
+
</dl>
|
2
10
|
|
3
|
-
<p>
|
4
|
-
<b>Contour Version:</b>
|
5
|
-
<%= Contour::VERSION::STRING %>
|
6
|
-
</p>
|
7
11
|
|
8
12
|
<h2>Application Details</h2>
|
9
13
|
|
@@ -15,18 +19,18 @@ If the file does not exist run:<br />
|
|
15
19
|
<br />
|
16
20
|
<code style="margin-left:10px">rails generate contour:install</code><br />
|
17
21
|
<br />
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
<%
|
24
|
-
|
25
|
-
<
|
22
|
+
|
23
|
+
<dl class="dl-horizontal">
|
24
|
+
<% unless request.script_name.blank? %>
|
25
|
+
<dt>Subdomain</dt>
|
26
|
+
<dd><%= request.script_name %></dd>
|
27
|
+
<% end %>
|
28
|
+
<% (Contour.class_variables.collect{|v| v.to_s.gsub('@@','')} - ['menu_items']).each do |attribute| %>
|
29
|
+
<dt><%= attribute.titleize %></dt>
|
26
30
|
<% if Contour.send(attribute).blank? %>
|
27
|
-
<
|
31
|
+
<dd class="muted">NULL</dd>
|
28
32
|
<% else %>
|
29
|
-
|
33
|
+
<dd><%= Contour.send(attribute) %></dd>
|
30
34
|
<% end %>
|
31
|
-
|
32
|
-
|
35
|
+
<% end %>
|
36
|
+
</dl>
|
@@ -1,17 +1,42 @@
|
|
1
|
-
|
1
|
+
<% @title = 'Sign in' %>
|
2
2
|
|
3
|
-
|
4
|
-
<div
|
5
|
-
|
3
|
+
<div class="row">
|
4
|
+
<div class="span8">
|
5
|
+
<div class="page-header">
|
6
|
+
<h1><%= @title %></h1>
|
7
|
+
</div>
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
+
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name), html: { class: 'form-horizontal' }) do |f| %>
|
10
|
+
<div class="control-group">
|
11
|
+
<%= f.label :email, class: 'control-label' %>
|
12
|
+
<div class="controls">
|
13
|
+
<%= f.email_field :email %>
|
14
|
+
</div>
|
15
|
+
</div>
|
9
16
|
|
10
|
-
|
11
|
-
|
12
|
-
|
17
|
+
<div class="control-group">
|
18
|
+
<%= f.label :password, class: 'control-label' %>
|
19
|
+
<div class="controls">
|
20
|
+
<%= f.password_field :password %>
|
21
|
+
</div>
|
22
|
+
</div>
|
13
23
|
|
14
|
-
|
15
|
-
|
24
|
+
<% if devise_mapping.rememberable? -%>
|
25
|
+
<div class="control-group">
|
26
|
+
<div class="controls checkbox">
|
27
|
+
<%= f.check_box :remember_me %> <%= f.label :remember_me %>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
<% end -%>
|
16
31
|
|
17
|
-
|
32
|
+
<div class="form-actions">
|
33
|
+
<%= f.submit "Sign in", class: 'btn btn-primary' %>
|
34
|
+
<%= render partial: 'contour/links' %>
|
35
|
+
</div>
|
36
|
+
<% end %>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div class="span4">
|
40
|
+
<%= render partial: 'contour/layouts/latest_news' %>
|
41
|
+
</div>
|
42
|
+
</div>
|
@@ -1,12 +1,20 @@
|
|
1
|
-
|
1
|
+
<% @title = 'Resend unlock instructions' %>
|
2
|
+
<div class="page-header">
|
3
|
+
<h1><%= @title %></h1>
|
4
|
+
</div>
|
2
5
|
|
3
|
-
<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
|
6
|
+
<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post, class: 'form-horizontal' }) do |f| %>
|
4
7
|
<%= devise_error_messages! %>
|
5
8
|
|
6
|
-
<div
|
7
|
-
|
9
|
+
<div class="control-group">
|
10
|
+
<%= f.label :email, class: 'control-label' %>
|
11
|
+
<div class="controls">
|
12
|
+
<%= f.email_field :email %>
|
13
|
+
</div>
|
14
|
+
</div>
|
8
15
|
|
9
|
-
<div
|
16
|
+
<div class="form-actions">
|
17
|
+
<%= f.submit "Resend unlock instructions", class: 'btn btn-primary' %>
|
18
|
+
<%= render partial: 'contour/links' %>
|
19
|
+
</div>
|
10
20
|
<% end %>
|
11
|
-
|
12
|
-
<%= render "links" %>
|