contour 2.1.0.beta17 → 2.1.0.rc

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.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/app/assets/stylesheets/contour.css +0 -2
  4. data/app/controllers/contour/authentications_controller.rb +5 -4
  5. data/app/views/contour/authentications/_add_remove_table.html.erb +31 -0
  6. data/app/views/contour/authentications/_authentications.html.erb +3 -0
  7. data/app/views/contour/authentications/destroy.js.erb +1 -0
  8. data/app/views/contour/authentications/index.html.erb +1 -22
  9. data/lib/contour/engine.rb +1 -1
  10. data/lib/contour/version.rb +1 -1
  11. data/test/controllers/authentications_controller_test.rb +2 -3
  12. data/test/dummy/db/test.sqlite3 +0 -0
  13. data/test/dummy/log/test.log +3591 -0
  14. data/test/dummy/tmp/cache/assets/test/sprockets/0b793dc498fe65856d1b31a805f114dc +0 -0
  15. data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  16. data/test/dummy/tmp/cache/assets/test/sprockets/1c3ad26f378b8f1fc2c20392ce4a540d +0 -0
  17. data/test/dummy/tmp/cache/assets/test/sprockets/291c470bea09e91a82ed77cb455b45fc +0 -0
  18. data/test/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  19. data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  20. data/test/dummy/tmp/cache/assets/test/sprockets/3e2f53860ebad5d43a5b7b1d2f7c93db +0 -0
  21. data/test/dummy/tmp/cache/assets/test/sprockets/408c90980fca5a250881bafa3ef0ca63 +0 -0
  22. data/test/dummy/tmp/cache/assets/test/sprockets/6666059cb20313a69e518d351e00eb1f +0 -0
  23. data/test/dummy/tmp/cache/assets/test/sprockets/8f6410f2a80e0115a1b8bf6cf7cbf317 +0 -0
  24. data/test/dummy/tmp/cache/assets/test/sprockets/a7b222735fc6d94f5713fa8e4c00feec +0 -0
  25. data/test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  26. data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  27. data/test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  28. metadata +9 -5
  29. data/app/assets/stylesheets/contour/authentication.css +0 -63
  30. data/app/assets/stylesheets/contour/errors.css +0 -38
  31. data/app/views/contour/authentications/_index.html.erb +0 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06c1f851aa201f8b055336424f8f786f4428c090
4
- data.tar.gz: 6dcb4f35ccf617568aaa820907a2583efec5124d
3
+ metadata.gz: 6eeafc1e71115e595174207a08eecefb9fef34b6
4
+ data.tar.gz: 084f8740106fc73858ccc8e4b39541bbd8d5edae
5
5
  SHA512:
6
- metadata.gz: 4f7d6c9c0640d083d851c3ab42d9291e68cd1fce9582904d35b4a1d39745062b3ee6ed38693c8f3464b6fea6f9c2455ad4359a5afe12a4199d2e59f4a0c91e4f
7
- data.tar.gz: 76bd1bf6ebcc9f160c919073b5f819834d9ae7ae831c95b62f7bc5b33b7e6a8451ed02b51680e4d2d4125a4b08846cc8891c60a877c74e26c50fee938074e83e
6
+ metadata.gz: b66c708d48d51b7e688c5f91c63270e6f54367f5dd209b787dc2e65970e7f1dec4033382a2fe053c299d3c5bc8adeba8ef33f760a685f1b49fee467ee3e6d25c
7
+ data.tar.gz: bf7230763663e68a6ea71a467a412a789873c2e3c2d1d7c43c7229cc48969d9bf2a8ec60290998e8ff38fb4d902a3c097760097d0450e4ebadf459368a4c080b
data/CHANGELOG.md CHANGED
@@ -7,6 +7,10 @@
7
7
  - `links: [ ..., { header: 'Dropdown header' }, ... ]`
8
8
  - Removed bootstrap-scroll-modal since it collided with BS3's implementation
9
9
  - Updated HighCharts to 3.0.5
10
+ - Available authentications table can be included via the following partial:
11
+ - `render partial: 'contour/authentications/authentications'`
12
+ - Authentications can be added and removed through this view
13
+ - Authentications can now be integrated on existing settings pages instead of being a separate page
10
14
  - **Gem Changes**
11
15
  - Updated to Devise 3.0.3
12
16
 
@@ -12,7 +12,5 @@
12
12
  *= require datepicker
13
13
  *= require timepicker
14
14
  *= require contour/about
15
- *= require contour/authentication
16
- *= require contour/errors
17
15
  *= require spinner
18
16
  */
@@ -2,7 +2,6 @@ class Contour::AuthenticationsController < ApplicationController
2
2
  skip_before_action :verify_authenticity_token, only: :create
3
3
 
4
4
  def index
5
- @authentications = current_user.authentications if current_user
6
5
  end
7
6
 
8
7
  def passthru
@@ -43,14 +42,16 @@ class Contour::AuthenticationsController < ApplicationController
43
42
  end
44
43
  end
45
44
  else
46
- redirect_to authentications_path, alert: "Authentication not successful."
45
+ redirect_to authentications_path, alert: 'Authentication not successful.'
47
46
  end
48
47
  end
49
48
 
50
49
  def destroy
51
50
  @authentication = current_user.authentications.find(params[:id])
52
51
  @authentication.destroy
53
- flash[:notice] = "Successfully destroyed authentication."
54
- redirect_to authentications_path
52
+ respond_to do |format|
53
+ format.html { redirect_to authentications_path, notice: 'Successfully removed authentication.' }
54
+ format.js
55
+ end
55
56
  end
56
57
  end
@@ -0,0 +1,31 @@
1
+ <% if current_user %>
2
+ <table class="table table-striped" style="table-layout:fixed">
3
+ <thead>
4
+ <tr>
5
+ <th></th>
6
+ <th>Provider</th>
7
+ <th>User ID</th>
8
+ <th>Actions</th>
9
+ </tr>
10
+ </thead>
11
+
12
+ <% PROVIDERS.each do |provider| %>
13
+ <% url_params = (provider == :google_apps) ? '?domain=gmail.com' : '' %>
14
+ <% provider_name = OmniAuth.config.camelizations[provider.to_s.downcase] || provider.to_s.titleize %>
15
+ <% image_name = provider.to_s.downcase %>
16
+ <% authentication = current_user.authentications.find_by_provider(provider.to_s.downcase) %>
17
+ <tr>
18
+ <td><%= image_tag "contour/#{image_name}_32.png", height: '32px' %></td>
19
+ <td><%= provider_name %></td>
20
+ <td><%= authentication.uid if authentication %></td>
21
+ <td>
22
+ <% if authentication %>
23
+ <%= link_to 'Remove', authentication, remote: true, method: :delete, class: 'btn btn-xs btn-danger-inverse', data: { confirm: 'Are you sure you want to remove this authentication option?' } %>
24
+ <% else %>
25
+ <%= link_to 'Add', "#{request.script_name}/#{OmniAuth.config.path_prefix.split('/').last.to_s}/#{provider.to_s.downcase}#{url_params}", class: 'btn btn-xs btn-default' %>
26
+ <% end %>
27
+ </td>
28
+ </tr>
29
+ <% end %>
30
+ </table>
31
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <div id="authentications">
2
+ <%= render partial: 'contour/authentications/add_remove_table' %>
3
+ </div>
@@ -0,0 +1 @@
1
+ $("#authentications").html("<%= escape_javascript(render("contour/authentications/add_remove_table")) %>");
@@ -3,25 +3,4 @@
3
3
  <h1><%= @title %></h1>
4
4
  </div>
5
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 "contour/#{authentication.provider}_32.png", height: "32px" %>
13
- <div class="provider"><%= authentication.provider.titleize %></div>
14
- <div class="uid"><%= authentication.uid %></div>
15
- <%= link_to "X", authentication, method: :delete, class: "remove", data: { confirm: 'Are you sure you want to remove this authentication option?' } %>
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' %>
6
+ <%= render partial: 'contour/authentications/authentications' %>
@@ -6,7 +6,7 @@ module Contour
6
6
  engine_name :contour
7
7
 
8
8
  # Overwrite Rails errors to use Twitter/Contour CSS classes
9
- config.action_view.field_error_proc = Proc.new { |html_tag, instance| "<span class=\"control-group-error\">#{html_tag}</span>".html_safe }
9
+ config.action_view.field_error_proc = Proc.new { |html_tag, instance| "<span class=\"has-error\">#{html_tag}</span>".html_safe }
10
10
 
11
11
  end
12
12
  end
@@ -3,7 +3,7 @@ module Contour
3
3
  MAJOR = 2
4
4
  MINOR = 1
5
5
  TINY = 0
6
- BUILD = "beta17" # nil, "pre", "rc", "rc2"
6
+ BUILD = "rc" # nil, "pre", "rc", "rc2"
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, BUILD].compact.join('.')
9
9
  end
@@ -12,7 +12,6 @@ class Contour::AuthenticationsControllerTest < ActionController::TestCase
12
12
  test "should get index" do
13
13
  get :index
14
14
  assert_response :success
15
- assert_not_nil assigns(:authentications)
16
15
  end
17
16
 
18
17
  # TODO: Remove
@@ -50,9 +49,9 @@ class Contour::AuthenticationsControllerTest < ActionController::TestCase
50
49
 
51
50
  test "should destroy authentication" do
52
51
  assert_difference('Authentication.count', -1) do
53
- delete :destroy, id: @authentication.to_param
52
+ delete :destroy, id: @authentication, format: 'js'
54
53
  end
55
54
 
56
- assert_redirected_to authentications_path
55
+ assert_template 'destroy'
57
56
  end
58
57
  end
Binary file