contour 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. data/CHANGELOG.rdoc +13 -0
  2. data/README.rdoc +1 -7
  3. data/Rakefile +38 -0
  4. data/{vendor → app}/assets/images/contour/addfile.png +0 -0
  5. data/{vendor → app}/assets/images/contour/arrow.png +0 -0
  6. data/{vendor → app}/assets/images/contour/blank.png +0 -0
  7. data/{vendor → app}/assets/images/contour/cas_32.png +0 -0
  8. data/{vendor → app}/assets/images/contour/cas_64.png +0 -0
  9. data/{vendor → app}/assets/images/contour/cross.png +0 -0
  10. data/{vendor → app}/assets/images/contour/delete.png +0 -0
  11. data/{vendor → app}/assets/images/contour/doc.png +0 -0
  12. data/{vendor → app}/assets/images/contour/download.png +0 -0
  13. data/{vendor → app}/assets/images/contour/edit.png +0 -0
  14. data/{vendor → app}/assets/images/contour/email.png +0 -0
  15. data/{vendor → app}/assets/images/contour/external.png +0 -0
  16. data/{vendor → app}/assets/images/contour/facebook_32.png +0 -0
  17. data/{vendor → app}/assets/images/contour/facebook_64.png +0 -0
  18. data/{vendor → app}/assets/images/contour/favorite_no.png +0 -0
  19. data/{vendor → app}/assets/images/contour/favorite_yes.png +0 -0
  20. data/{vendor → app}/assets/images/contour/feed.png +0 -0
  21. data/{vendor → app}/assets/images/contour/google_apps_32.png +0 -0
  22. data/{vendor → app}/assets/images/contour/google_apps_64.png +0 -0
  23. data/{vendor → app}/assets/images/contour/im.png +0 -0
  24. data/{vendor → app}/assets/images/contour/information.png +0 -0
  25. data/{vendor → app}/assets/images/contour/key.png +0 -0
  26. data/{vendor → app}/assets/images/contour/ldap_32.png +0 -0
  27. data/{vendor → app}/assets/images/contour/ldap_64.png +0 -0
  28. data/{vendor → app}/assets/images/contour/linkedin_32.png +0 -0
  29. data/{vendor → app}/assets/images/contour/linkedin_64.png +0 -0
  30. data/{vendor → app}/assets/images/contour/mydocuments.png +0 -0
  31. data/{vendor → app}/assets/images/contour/open.png +0 -0
  32. data/{vendor → app}/assets/images/contour/openid_32.png +0 -0
  33. data/{vendor → app}/assets/images/contour/openid_64.png +0 -0
  34. data/{vendor → app}/assets/images/contour/pdf.png +0 -0
  35. data/{vendor → app}/assets/images/contour/save.png +0 -0
  36. data/{vendor → app}/assets/images/contour/search.png +0 -0
  37. data/{vendor → app}/assets/images/contour/tag_blue.png +0 -0
  38. data/{vendor → app}/assets/images/contour/tag_green.png +0 -0
  39. data/{vendor → app}/assets/images/contour/tag_neutral.png +0 -0
  40. data/{vendor → app}/assets/images/contour/tag_red.png +0 -0
  41. data/{vendor → app}/assets/images/contour/tick.png +0 -0
  42. data/{vendor → app}/assets/images/contour/twitter_32.png +0 -0
  43. data/{vendor → app}/assets/images/contour/twitter_64.png +0 -0
  44. data/{vendor → app}/assets/images/contour/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  45. data/{vendor → app}/assets/images/contour/ui-bg_flat_55_fbec88_40x100.png +0 -0
  46. data/{vendor → app}/assets/images/contour/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
  47. data/{vendor → app}/assets/images/contour/ui-bg_glass_85_dfeffc_1x400.png +0 -0
  48. data/{vendor → app}/assets/images/contour/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  49. data/{vendor → app}/assets/images/contour/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
  50. data/{vendor → app}/assets/images/contour/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
  51. data/{vendor → app}/assets/images/contour/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
  52. data/{vendor → app}/assets/images/contour/ui-icons_217bc0_256x240.png +0 -0
  53. data/{vendor → app}/assets/images/contour/ui-icons_2e83ff_256x240.png +0 -0
  54. data/{vendor → app}/assets/images/contour/ui-icons_469bdd_256x240.png +0 -0
  55. data/{vendor → app}/assets/images/contour/ui-icons_6da8d5_256x240.png +0 -0
  56. data/{vendor → app}/assets/images/contour/ui-icons_cd0a0a_256x240.png +0 -0
  57. data/{vendor → app}/assets/images/contour/ui-icons_d8e7f3_256x240.png +0 -0
  58. data/{vendor → app}/assets/images/contour/ui-icons_f9bd01_256x240.png +0 -0
  59. data/{vendor → app}/assets/images/contour/visited.png +0 -0
  60. data/{vendor → app}/assets/images/contour/warning.png +0 -0
  61. data/{vendor → app}/assets/images/contour/xls.png +0 -0
  62. data/{vendor → app}/assets/javascripts/contour.js +0 -0
  63. data/{vendor → app}/assets/javascripts/contour/errors.js.coffee +0 -0
  64. data/app/assets/javascripts/contour/global.js.coffee +13 -0
  65. data/app/assets/javascripts/contour/menu.js.coffee +21 -0
  66. data/{vendor → app}/assets/javascripts/contour/popup.js.coffee +0 -0
  67. data/{vendor → app}/assets/javascripts/external/exporting-2.1.9.src.js +0 -0
  68. data/{vendor → app}/assets/javascripts/external/highcharts-2.1.9.src.js +0 -0
  69. data/{vendor → app}/assets/javascripts/external/jquery-ui-1.8.10.custom.min.js +0 -0
  70. data/{vendor → app}/assets/javascripts/external/waypoints.js +0 -0
  71. data/{vendor → app}/assets/stylesheets/bluetrip-screen.css +0 -0
  72. data/{vendor → app}/assets/stylesheets/contour.css +0 -0
  73. data/{vendor → app}/assets/stylesheets/contour/authentication.css +0 -0
  74. data/{vendor → app}/assets/stylesheets/contour/global.css +2 -1
  75. data/{vendor → app}/assets/stylesheets/contour/header.css +0 -0
  76. data/app/assets/stylesheets/contour/menu.css +109 -0
  77. data/{vendor → app}/assets/stylesheets/contour/message.css +15 -3
  78. data/{vendor → app}/assets/stylesheets/contour/popup.css +0 -0
  79. data/{vendor → app}/assets/stylesheets/jquery-ui-1.8.10.custom.css +0 -0
  80. data/app/models/authentication.rb +11 -0
  81. data/app/views/contour/authentications/_menu.html.erb +26 -0
  82. data/app/views/contour/layouts/_menu.html.erb +15 -21
  83. data/app/views/contour/layouts/application.html.erb +2 -4
  84. data/app/views/contour/sessions/new.html.erb +2 -2
  85. data/config/routes.rb +16 -0
  86. data/contour.gemspec +15 -11
  87. data/lib/contour.rb +10 -6
  88. data/lib/contour/engine.rb +0 -1
  89. data/lib/contour/version.rb +2 -2
  90. data/lib/generators/contour/install_generator.rb +5 -4
  91. data/lib/generators/templates/contour.rb +10 -6
  92. data/test/contour_test.rb +7 -0
  93. data/test/dummy/Rakefile +7 -0
  94. data/test/dummy/app/assets/javascripts/application.js +8 -0
  95. data/test/dummy/app/assets/stylesheets/application.css +8 -0
  96. data/test/dummy/app/controllers/application_controller.rb +3 -0
  97. data/test/dummy/app/helpers/application_helper.rb +2 -0
  98. data/test/dummy/app/models/user.rb +45 -0
  99. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  100. data/test/dummy/config.ru +4 -0
  101. data/test/dummy/config/application.rb +45 -0
  102. data/test/dummy/config/boot.rb +10 -0
  103. data/test/dummy/config/database.yml +37 -0
  104. data/test/dummy/config/environment.rb +5 -0
  105. data/test/dummy/config/environments/development.rb +30 -0
  106. data/test/dummy/config/environments/production.rb +60 -0
  107. data/test/dummy/config/environments/test.rb +39 -0
  108. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  109. data/test/dummy/config/initializers/devise.rb +153 -0
  110. data/test/dummy/config/initializers/inflections.rb +10 -0
  111. data/test/dummy/config/initializers/mime_types.rb +5 -0
  112. data/test/dummy/config/initializers/omniauth.rb +22 -0
  113. data/test/dummy/config/initializers/secret_token.rb +7 -0
  114. data/test/dummy/config/initializers/session_store.rb +8 -0
  115. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  116. data/test/dummy/config/locales/en.yml +5 -0
  117. data/test/dummy/config/routes.rb +58 -0
  118. data/test/dummy/db/migrate/20111203203123_create_users.rb +26 -0
  119. data/test/dummy/db/migrate/20111203203307_create_authentications.rb +11 -0
  120. data/test/dummy/db/schema.rb +45 -0
  121. data/test/dummy/public/404.html +26 -0
  122. data/test/dummy/public/422.html +26 -0
  123. data/test/dummy/public/500.html +26 -0
  124. data/test/dummy/public/favicon.ico +0 -0
  125. data/test/dummy/script/rails +6 -0
  126. data/test/fixtures/authentications.yml +14 -9
  127. data/test/fixtures/users.yml +70 -0
  128. data/test/functional/authentications_controller_test.rb +2 -2
  129. data/test/functional/registrations_controller_test.rb +9 -9
  130. data/test/integration/navigation_test.rb +8 -0
  131. data/test/test_helper.rb +52 -0
  132. data/test/unit/authentication_test.rb +6 -3
  133. data/test/unit/user_test.rb +13 -0
  134. metadata +186 -96
  135. data/.gitignore +0 -7
  136. data/.rvmrc +0 -1
  137. data/lib/contour/engine/routes.rb +0 -10
  138. data/test/unit/helpers/registrations_helper_test.rb +0 -4
  139. data/vendor/assets/javascripts/contour/global.js.coffee +0 -38
  140. data/vendor/assets/javascripts/contour/menu.js.coffee +0 -6
  141. data/vendor/assets/stylesheets/contour/menu.css +0 -77
@@ -1,3 +1,16 @@
1
+ == 0.7.0
2
+
3
+ * Enhancements
4
+ * Restructuring gem to be more in line with a gem created by 'rails plugin new'
5
+ * Menu system updated to use embedded ul and li tags, and jQuery to capture mouseenter and mouseleave
6
+ * GUI updates for alert and notice popups
7
+
8
+ * Testing
9
+ * Adding dummy app and tests
10
+
11
+ * Bug Fix
12
+ * New Menu system is now IE7+ compatible
13
+
1
14
  == 0.6.1
2
15
 
3
16
  * Bug Fix
@@ -32,12 +32,6 @@ Contour provides custom JavaScript. In order to make the application layout fun
32
32
 
33
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
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
35
  devise_for :users, :controllers => {:registrations => 'contour/registrations', :sessions => 'contour/sessions', :passwords => 'contour/passwords'}, :path_names => { :sign_up => 'register', :sign_in => 'login' }
42
36
 
43
37
  == Setting up a new project with quick authentication
@@ -52,7 +46,7 @@ Make sure you have Rails 3.1.1
52
46
 
53
47
  Modify Gemfile and add
54
48
 
55
- gem 'contour', '~> 0.6.0' # Basic Layout and Assets
49
+ gem 'contour', '~> 0.7.0' # Basic Layout and Assets
56
50
  gem 'devise' # User Authorization
57
51
  gem 'omniauth' # User Multi-Authentication
58
52
 
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'Contour'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('CHANGELOG.rdoc')
20
+ rdoc.rdoc_files.include('README.rdoc')
21
+ rdoc.rdoc_files.include('lib/**/*.rb')
22
+ end
23
+
24
+
25
+
26
+ Bundler::GemHelper.install_tasks
27
+
28
+ require 'rake/testtask'
29
+
30
+ Rake::TestTask.new(:test) do |t|
31
+ t.libs << 'lib'
32
+ t.libs << 'test'
33
+ t.pattern = 'test/**/*_test.rb'
34
+ t.verbose = false
35
+ end
36
+
37
+
38
+ task :default => :test
@@ -0,0 +1,13 @@
1
+ # Global functions referenced from HTML
2
+ @showWaiting = (element_id, text, centered) ->
3
+ element = $(element_id)
4
+ if element && centered
5
+ element.html('<br /><center><img width=\"13\" height=\"13\" src=\"' + root_url + 'assets/ajax-loader.gif\" align=\"absmiddle\" alt=\"...\" />' + text + '</center><br />')
6
+ else if element
7
+ element.html('<img width=\"13\" height=\"13\" src=\"' + root_url + 'assets/ajax-loader.gif\" align=\"absmiddle\" alt=\"...\" />' + text)
8
+
9
+ @showMessage = (elements) ->
10
+ $.each(elements, (index, value) ->
11
+ element = $(value)
12
+ element.fadeIn(2000)
13
+ )
@@ -0,0 +1,21 @@
1
+ jQuery ->
2
+ $('#menu').waypoint( (event, direction) ->
3
+ $(this).toggleClass('sticky', direction == "down")
4
+ $(this).css( left: $("#header").offset().left )
5
+ event.stopPropagation()
6
+ )
7
+
8
+ $('#menu').find("li").each( () ->
9
+ if $(this).find("ul").length > 0
10
+ # $("<span>").text("^").appendTo($(this).children(":first"))
11
+
12
+ # show subnav on hover
13
+ $(this).mouseenter( () ->
14
+ $(this).find("ul").stop(true, true).show() #slideDown()
15
+ )
16
+
17
+ # hide submenus on exit
18
+ $(this).mouseleave( () ->
19
+ $(this).find("ul").stop(true, true).hide() #slideUp()
20
+ )
21
+ )
@@ -17,7 +17,8 @@ a:link.positive {
17
17
  }
18
18
 
19
19
  #content {
20
- padding: 4px;
20
+ margin-top: 10px;
21
+ padding: 0px 4px 4px 4px;
21
22
  background-color: #FFF;
22
23
  }
23
24
 
@@ -0,0 +1,109 @@
1
+ /**************************************/
2
+ /* NAVIGATION */
3
+ /**************************************/
4
+
5
+ #menu ul.ul-menu {
6
+ margin: 0px;
7
+ list-style: none;
8
+ position: relative;
9
+ z-index: 1;
10
+ }
11
+
12
+ #menu ul.ul-menu li {
13
+ margin-left: 0px;
14
+ display: block;
15
+ /* float: left;*/
16
+ position: relative;
17
+ padding: 0px 5px;
18
+ }
19
+
20
+ #menu ul.ul-menu li.li_left {
21
+ /* display: block;*/
22
+ float: left;
23
+ z-index: 1;
24
+ /* position: relative;*/
25
+ }
26
+
27
+ #menu ul.ul-menu li.li_right {
28
+ /* display: block;*/
29
+ float: right;
30
+ z-index: 1;
31
+ /* position: relative;*/
32
+ }
33
+
34
+ #menu ul.ul-menu li ul {
35
+ list-style: none;
36
+ /* position: relative;*/
37
+ top: 16px;
38
+
39
+ padding: 8px 5px 5px 5px;
40
+ margin: 0px -5px;
41
+
42
+ border-bottom-right-radius: 8px;
43
+ -moz-border-radius-bottomright: 8px;
44
+ -webkit-border-radius-bottomright: 8px;
45
+
46
+ border-bottom-left-radius: 8px;
47
+ -moz-border-radius-bottomleft: 8px;
48
+ -webkit-border-radius-bottomleft: 8px;
49
+
50
+ -moz-box-shadow: 0px 5px 5px #666;
51
+ -webkit-box-shadow: 0px 5px 5px #666;
52
+ box-shadow: 0px 5px 5px #666;
53
+
54
+ background-color: #404040;
55
+ position: absolute;
56
+ display: none;
57
+ }
58
+
59
+ #menu ul.ul-menu li.li_left ul {
60
+ left: 0px;
61
+ }
62
+
63
+ #menu ul.ul-menu li.li_right ul {
64
+ right: 0px;
65
+ text-align: right;
66
+ }
67
+
68
+
69
+ #menu ul.ul-menu li ul li {
70
+ white-space: nowrap;
71
+ padding-left: 5px;
72
+ padding-right: 5px;
73
+ }
74
+
75
+ #menu {
76
+ background:#404040;
77
+ padding:5px;
78
+ color: #fff;
79
+
80
+ -moz-border-radius-bottomright: 8px;
81
+ -webkit-border-radius-bottomright: 8px;
82
+ border-bottom-right-radius: 8px;
83
+
84
+ -moz-border-radius-bottomleft: 8px;
85
+ -webkit-border-radius-bottomleft: 8px;
86
+ border-bottom-left-radius: 8px;
87
+
88
+ -moz-box-shadow: 0px 5px 5px #666;
89
+ -webkit-box-shadow: 0px 5px 5px #666;
90
+ box-shadow: 0px 5px 5px #666;
91
+ }
92
+
93
+ .sticky {
94
+ position:fixed;
95
+ top:0;
96
+ width:950px;
97
+ margin:0 auto;
98
+ z-index:100;
99
+ }
100
+
101
+ #menu a {
102
+ color: #fff;
103
+ text-decoration: none;
104
+ padding:0 5px;
105
+ }
106
+
107
+ #menu a:hover {
108
+ color: #EB6C20;
109
+ }
@@ -3,12 +3,20 @@
3
3
  /**************************************/
4
4
 
5
5
  #message {
6
- position:absolute;
7
- left:-5px;
8
- top:-30px;
6
+ position: absolute;
7
+ left: -5px;
8
+ top: -28px;
9
+ }
10
+
11
+ .error {
12
+ background: #FBC2C4;
13
+ }
14
+ .notice {
15
+ background: #FFF493;
9
16
  }
10
17
 
11
18
  .notice, .error {
19
+ border-width: 0px;
12
20
  float:left;
13
21
  margin:0 4px 0 0;
14
22
  padding:2px 8px;
@@ -24,4 +32,8 @@
24
32
  border-top-right-radius: 8px;
25
33
  -moz-border-radius-topright: 8px;
26
34
  -webkit-border-radius-topright: 8px;
35
+
36
+ -moz-box-shadow: 0px 0px 5px #666;
37
+ -webkit-box-shadow: 0px 0px 5px #666;
38
+ box-shadow: 0px 0px 5px #666;
27
39
  }
@@ -0,0 +1,11 @@
1
+ class Authentication < ActiveRecord::Base
2
+ belongs_to :user
3
+
4
+ def provider_name
5
+ if provider == 'open_id'
6
+ "OpenID"
7
+ else
8
+ provider.to_s.titleize
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,28 @@
1
+ <% PROVIDERS.each do |provider| %>
2
+ <% url_params = (provider == :google_apps) ? '?domain=gmail.com' : '' %>
3
+ <% if provider == :open_id %>
4
+ <% provider_name = 'OpenID' %>
5
+ <% image_name = 'openid' %>
6
+ <% elsif provider == :linked_in %>
7
+ <% provider_name = 'LinkedIn' %>
8
+ <% image_name = 'linkedin' %>
9
+ <% elsif [:LDAP, :CAS].include?(provider) %>
10
+ <% provider_name = provider.to_s.upcase %>
11
+ <% image_name = provider.to_s.downcase %>
12
+ <% else %>
13
+ <% provider_name = provider.to_s.titleize %>
14
+ <% image_name = provider.to_s.downcase %>
15
+ <% end %>
16
+ <li class="parent li_right" style="top:-4px;height:20px;"> <%# margin-right:15px;padding-left:0px;padding-right:0px %>
17
+ <a href="<%= request.script_name %><%= "/" + OmniAuth.config.path_prefix.split('/').last.to_s %><%= "/" + provider.to_s.downcase %><%= url_params %>" class="noicon">
18
+ <%= image_tag "contour/#{image_name}_32.png", :align => 'absmiddle', :height => "28px", :title => provider_name %>
19
+ </a>
20
+ </li>
21
+ <% end %>
22
+
23
+
24
+
25
+ <% if false %>
1
26
  <% PROVIDERS.each do |provider| %>
2
27
  <% url_params = (provider == :google_apps) ? '?domain=gmail.com' : '' %>
3
28
  <% if provider == :open_id %>
@@ -18,4 +43,5 @@
18
43
  <%= image_tag "contour/#{image_name}_32.png", :align => 'absmiddle', :height => "28px", :title => provider_name %>
19
44
  </a>
20
45
  </div>
46
+ <% end %>
21
47
  <% end %>