caseadilla 0.0.1 → 0.0.2

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 (73) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -0
  3. data/Gemfile +0 -0
  4. data/LICENSE.txt +0 -0
  5. data/README.md +0 -0
  6. data/Rakefile +0 -0
  7. data/app/assets/fonts/caseadilla/glyphicons-halflings-regular.eot +0 -0
  8. data/app/assets/fonts/caseadilla/glyphicons-halflings-regular.svg +228 -228
  9. data/app/assets/fonts/caseadilla/glyphicons-halflings-regular.ttf +0 -0
  10. data/app/assets/fonts/caseadilla/glyphicons-halflings-regular.woff +0 -0
  11. data/app/assets/images/caseadilla/caseadilla.png +0 -0
  12. data/app/assets/javascripts/caseadilla/bootstrap.js +2114 -2114
  13. data/app/assets/javascripts/caseadilla/bootstrap3-wysihtml5.js +520 -520
  14. data/app/assets/javascripts/caseadilla/caseadilla.js +50 -50
  15. data/app/assets/javascripts/caseadilla/html5shiv.js +8 -8
  16. data/app/assets/javascripts/caseadilla/wysihtml5-0.3.0.min.js +260 -260
  17. data/app/assets/stylesheets/caseadilla/bootstrap-glyphicons.css.scss +2 -2
  18. data/app/assets/stylesheets/caseadilla/bootstrap-theme.css +442 -442
  19. data/app/assets/stylesheets/caseadilla/bootstrap-wysihtml5.css +101 -101
  20. data/app/assets/stylesheets/caseadilla/bootstrap.css +6203 -6203
  21. data/app/assets/stylesheets/caseadilla/caseadilla-bootstrap-overrides.css.scss +79 -79
  22. data/app/assets/stylesheets/caseadilla/caseadilla.scss +269 -269
  23. data/app/assets/stylesheets/caseadilla/login.css.scss +80 -80
  24. data/app/controllers/caseadilla/caseadilla_controller.rb +56 -56
  25. data/app/controllers/caseadilla/caseadilla_user_sessions_controller.rb +35 -35
  26. data/app/controllers/caseadilla/password_resets_controller.rb +63 -63
  27. data/app/controllers/caseadilla/roles_controller.rb +64 -64
  28. data/app/controllers/caseadilla/users_controller.rb +117 -117
  29. data/app/helpers/caseadilla/caseadilla_helper.rb +261 -261
  30. data/app/mailers/caseadilla/caseadilla_notification.rb +38 -38
  31. data/app/views/caseadilla/caseadilla/blank.html.erb +11 -11
  32. data/app/views/caseadilla/caseadilla_notification/generate_new_password.erb +11 -11
  33. data/app/views/caseadilla/caseadilla_notification/new_user_information.erb +11 -11
  34. data/app/views/caseadilla/caseadilla_notification/password_reset_instructions.erb +10 -10
  35. data/app/views/caseadilla/caseadilla_user_sessions/new.html.erb +38 -38
  36. data/app/views/caseadilla/roles/_form.html.erb +11 -11
  37. data/app/views/caseadilla/roles/_table.html.erb +27 -27
  38. data/app/views/caseadilla/roles/index.html.erb +14 -14
  39. data/app/views/caseadilla/roles/new.html.erb +17 -17
  40. data/app/views/caseadilla/roles/show.html.erb +17 -17
  41. data/app/views/caseadilla/users/index.html.erb +36 -36
  42. data/app/views/caseadilla/users/new.html.erb +49 -49
  43. data/app/views/caseadilla/users/show.html.erb +38 -38
  44. data/app/views/layouts/caseadilla_auth.html.erb +36 -36
  45. data/app/views/layouts/caseadilla_main.html.erb +110 -118
  46. data/caseadilla.gemspec +48 -48
  47. data/config/initializers/will_paginate.rb +39 -39
  48. data/config/routes.rb +22 -22
  49. data/lib/caseadilla.rb +13 -13
  50. data/lib/caseadilla/engine.rb +34 -34
  51. data/lib/caseadilla/version.rb +1 -1
  52. data/lib/generators/caseadilla/install/install_generator.rb +153 -153
  53. data/lib/generators/caseadilla/install/templates/app/assets/javascripts/caseadilla/custom.js +1 -1
  54. data/lib/generators/caseadilla/install/templates/app/assets/stylesheets/caseadilla/custom.css.scss +2 -2
  55. data/lib/generators/caseadilla/install/templates/app/helpers/caseadilla/config_helper.rb +44 -44
  56. data/lib/generators/caseadilla/install/templates/app/models/user.rb +23 -23
  57. data/lib/generators/caseadilla/install/templates/app/views/caseadilla/layouts/_tab_navigation.html.erb +1 -1
  58. data/lib/generators/caseadilla/install/templates/app/views/caseadilla/layouts/_top_navigation.html.erb +3 -3
  59. data/lib/generators/caseadilla/install/templates/public/robots.txt +4 -4
  60. data/lib/generators/caseadilla/install/templates/steak/config/initializers/caseadilla.rb +7 -7
  61. data/lib/generators/caseadilla/install/templates/steak/db/migrate/add_name_to_users.rb +8 -8
  62. data/lib/generators/caseadilla/install/templates/veggie/config/initializers/caseadilla.rb +7 -7
  63. data/lib/generators/caseadilla/scaffold/scaffold_generator.rb +110 -110
  64. data/lib/generators/caseadilla/scaffold/templates/controller.rb +71 -71
  65. data/lib/generators/caseadilla/scaffold/templates/migration.rb +12 -12
  66. data/lib/generators/caseadilla/scaffold/templates/model.rb +2 -2
  67. data/lib/generators/caseadilla/scaffold/templates/views/_form.html.erb +11 -11
  68. data/lib/generators/caseadilla/scaffold/templates/views/_table.html.erb +18 -18
  69. data/lib/generators/caseadilla/scaffold/templates/views/index.html.erb +14 -14
  70. data/lib/generators/caseadilla/scaffold/templates/views/new.html.erb +17 -17
  71. data/lib/generators/caseadilla/scaffold/templates/views/show.html.erb +17 -17
  72. data/lib/railties/tasks.rake +31 -31
  73. metadata +2 -2
@@ -1,81 +1,81 @@
1
- /*
2
- *= require ./bootstrap.css
3
- *= require ./bootstrap-glyphicons.css
4
- *= require ./caseadilla-bootstrap-overrides.css
5
- */
6
-
7
- body {
8
- padding-top: 0px;
9
- padding-bottom: 0px;
10
- }
11
-
12
- .container-narrow {
13
- margin: 0 auto;
14
- max-width: 400px;
15
- }
16
-
17
- .alert {
18
- text-align: center;
19
- }
20
-
21
- .brand {
22
- margin-top: 20px;
23
- margin-bottom: 40px;
24
- }
25
-
26
- .form-group .checkbox-inline label {
27
- margin-top: 5px;
28
- margin-bottom: 20px;
29
- font-weight: normal;
30
- }
31
-
32
- .form-group .checkbox-inline input[type="checkbox"] {
33
- margin-top: 1px;
34
- }
35
-
36
- .form-group input {
37
- text-align: center;
38
- }
39
-
40
- form#new_user input.btn-large {
41
- background-color: rgb(220, 120, 40);
42
- border-color: rgb(175, 92, 32);
43
- }
44
-
45
- .jumbotron {
46
- padding: 20px;
47
- margin-bottom: 20px;
48
- font-size: 14px;
49
- line-height: 1;
50
- background-color: #eeeeee;
51
- text-align: center;
52
- border-bottom: 1px solid #e5e5e5;
53
- }
54
-
55
- footer p {
56
- font-size: 13px;
57
- text-align: center;
58
- color: #888;
59
- }
60
-
61
- footer p a {
62
- color: #555;
63
- }
64
-
65
- footer p a:hover {
66
- color: #000;
67
- text-decoration: none;
68
- }
69
-
70
- @media screen and (min-width: 768px) {
71
- .jumbotron {
72
- border-bottom: 0;
73
- padding: 20px;
74
- border-radius: 6px;
75
- }
76
-
77
- body {
78
- padding-top: 40px;
79
- padding-bottom: 20px;
80
- }
1
+ /*
2
+ *= require ./bootstrap.css
3
+ *= require ./bootstrap-glyphicons.css
4
+ *= require ./caseadilla-bootstrap-overrides.css
5
+ */
6
+
7
+ body {
8
+ padding-top: 0px;
9
+ padding-bottom: 0px;
10
+ }
11
+
12
+ .container-narrow {
13
+ margin: 0 auto;
14
+ max-width: 400px;
15
+ }
16
+
17
+ .alert {
18
+ text-align: center;
19
+ }
20
+
21
+ .brand {
22
+ margin-top: 20px;
23
+ margin-bottom: 40px;
24
+ }
25
+
26
+ .form-group .checkbox-inline label {
27
+ margin-top: 5px;
28
+ margin-bottom: 20px;
29
+ font-weight: normal;
30
+ }
31
+
32
+ .form-group .checkbox-inline input[type="checkbox"] {
33
+ margin-top: 1px;
34
+ }
35
+
36
+ .form-group input {
37
+ text-align: center;
38
+ }
39
+
40
+ form#new_user input.btn-large {
41
+ background-color: rgb(220, 120, 40);
42
+ border-color: rgb(175, 92, 32);
43
+ }
44
+
45
+ .jumbotron {
46
+ padding: 20px;
47
+ margin-bottom: 20px;
48
+ font-size: 14px;
49
+ line-height: 1;
50
+ background-color: #eeeeee;
51
+ text-align: center;
52
+ border-bottom: 1px solid #e5e5e5;
53
+ }
54
+
55
+ footer p {
56
+ font-size: 13px;
57
+ text-align: center;
58
+ color: #888;
59
+ }
60
+
61
+ footer p a {
62
+ color: #555;
63
+ }
64
+
65
+ footer p a:hover {
66
+ color: #000;
67
+ text-decoration: none;
68
+ }
69
+
70
+ @media screen and (min-width: 768px) {
71
+ .jumbotron {
72
+ border-bottom: 0;
73
+ padding: 20px;
74
+ border-radius: 6px;
75
+ }
76
+
77
+ body {
78
+ padding-top: 40px;
79
+ padding-bottom: 20px;
80
+ }
81
81
  }
@@ -1,57 +1,57 @@
1
- module Caseadilla
2
- class CaseadillaController < ApplicationController
3
-
4
- require 'caseadilla/caseadilla_helper'
5
- include Caseadilla::CaseadillaHelper
6
-
7
- require 'caseadilla/config_helper'
8
- include Caseadilla::ConfigHelper
9
-
10
- layout 'caseadilla_main'
11
-
12
- # before_filter :set_time_zone
13
- before_action :require_sign_in
14
-
15
- ActionView::Base.field_error_proc = proc { |input, instance| "#{input}".html_safe }
16
-
17
- def index
18
- redirect_to caseadilla_config_dashboard_url
19
- end
20
-
21
- def blank
22
- @caseadilla_page_title = "Welcome"
23
- end
24
-
25
- private
26
-
27
- def steak?
28
- return false unless Caseadilla::Engine.flavor = :steak
29
- end
30
-
31
- def chicken?
32
- return false unless Caseadilla::Engine.flavor = :chicken
33
- end
34
-
35
- def veggie?
36
- return false unless Caseadilla::Engine.flavor = :veggie
37
- end
38
-
39
- # def set_time_zone
40
- # Time.zone = current_user.time_zone if current_user
41
- # end
42
-
43
- def redirect_back_or_default(default)
44
- redirect_to(session[:return_to] || default)
45
- session[:return_to] = nil
46
- end
47
-
48
- def sort_order(default)
49
- "#{(params[:c] || default.to_s).gsub(/[\s;'\"]/,'')} #{'ASC' if params[:d] == 'up'} #{'DESC' if params[:d] == 'down'}"
50
- end
51
-
52
- def require_sign_in
53
- redirect_to caseadilla_sign_in_path unless user_signed_in?
54
- end
55
-
56
- end
1
+ module Caseadilla
2
+ class CaseadillaController < ApplicationController
3
+
4
+ require 'caseadilla/caseadilla_helper'
5
+ include Caseadilla::CaseadillaHelper
6
+
7
+ require 'caseadilla/config_helper'
8
+ include Caseadilla::ConfigHelper
9
+
10
+ layout 'caseadilla_main'
11
+
12
+ # before_filter :set_time_zone
13
+ before_action :require_sign_in
14
+
15
+ ActionView::Base.field_error_proc = proc { |input, instance| "#{input}".html_safe }
16
+
17
+ def index
18
+ redirect_to caseadilla_config_dashboard_url
19
+ end
20
+
21
+ def blank
22
+ @caseadilla_page_title = "Welcome"
23
+ end
24
+
25
+ private
26
+
27
+ def steak?
28
+ return false unless Caseadilla::Engine.flavor = :steak
29
+ end
30
+
31
+ def chicken?
32
+ return false unless Caseadilla::Engine.flavor = :chicken
33
+ end
34
+
35
+ def veggie?
36
+ return false unless Caseadilla::Engine.flavor = :veggie
37
+ end
38
+
39
+ # def set_time_zone
40
+ # Time.zone = current_user.time_zone if current_user
41
+ # end
42
+
43
+ def redirect_back_or_default(default)
44
+ redirect_to(session[:return_to] || default)
45
+ session[:return_to] = nil
46
+ end
47
+
48
+ def sort_order(default)
49
+ "#{(params[:c] || default.to_s).gsub(/[\s;'\"]/,'')} #{'ASC' if params[:d] == 'up'} #{'DESC' if params[:d] == 'down'}"
50
+ end
51
+
52
+ def require_sign_in
53
+ redirect_to caseadilla_sign_in_path unless user_signed_in?
54
+ end
55
+
56
+ end
57
57
  end
@@ -1,36 +1,36 @@
1
- module Caseadilla
2
- class CaseadillaUserSessionsController < Caseadilla::CaseadillaController
3
-
4
- skip_before_action :require_sign_in, :only => [:new, :create]
5
- before_filter :requires_no_session_user, :except => [:destroy]
6
-
7
- layout 'caseadilla_auth'
8
-
9
- def new
10
- @user_session = nil
11
- end
12
-
13
- def create
14
- @user_session = nil
15
- if @user_session.save
16
- redirect_back_or_default :controller => :caseadilla, :action => :index
17
- else
18
- render :action => :new
19
- end
20
- end
21
-
22
- def destroy
23
- current_user_session.destroy
24
- redirect_back_or_default new_caseadilla_user_session_url
25
- end
26
-
27
- private
28
-
29
- def requires_no_session_user
30
- if current_user
31
- redirect_to :controller => :caseadilla, :action => :index
32
- end
33
- end
34
-
35
- end
1
+ module Caseadilla
2
+ class CaseadillaUserSessionsController < Caseadilla::CaseadillaController
3
+
4
+ skip_before_action :require_sign_in, :only => [:new, :create]
5
+ before_filter :requires_no_session_user, :except => [:destroy]
6
+
7
+ layout 'caseadilla_auth'
8
+
9
+ def new
10
+ @user_session = nil
11
+ end
12
+
13
+ def create
14
+ @user_session = nil
15
+ if @user_session.save
16
+ redirect_back_or_default :controller => :caseadilla, :action => :index
17
+ else
18
+ render :action => :new
19
+ end
20
+ end
21
+
22
+ def destroy
23
+ current_user_session.destroy
24
+ redirect_back_or_default new_caseadilla_user_session_url
25
+ end
26
+
27
+ private
28
+
29
+ def requires_no_session_user
30
+ if current_user
31
+ redirect_to :controller => :caseadilla, :action => :index
32
+ end
33
+ end
34
+
35
+ end
36
36
  end
@@ -1,64 +1,64 @@
1
- module Caseadilla
2
- class PasswordResetsController < Caseadilla::CaseadillaController
3
-
4
- skip_before_filter :authorise
5
- before_filter :load_user_using_perishable_token, :only => [:edit, :update]
6
-
7
- layout 'caseadilla_auth'
8
-
9
- def create
10
- users = Caseadilla::User.where(:email => params[:recover_email]).all
11
-
12
- if users.length > 0
13
- users.each do |user|
14
- user.send_password_reset_instructions
15
- end
16
-
17
- if users.length > 1
18
- flash[:notice] = "Multiple accounts were found. Emails have been sent to " + params[:recover_email] + " with instructions on how to reset your passwords"
19
- else
20
- flash[:notice] = "An email has been sent to " + params[:recover_email] + " with instructions on how to reset your password"
21
- end
22
- else
23
- flash[:warning] = "There is no user with that email"
24
- end
25
-
26
- redirect_to new_caseadilla_user_session_url
27
- end
28
-
29
- def edit
30
- render
31
- end
32
-
33
- def update
34
-
35
- if params[:caseadilla_user][:password].empty? || params[:caseadilla_user][:password_confirmation].empty?
36
- flash.now[:warning] = "A field has been left empty"
37
- else
38
-
39
- @reset_user.password = params[:caseadilla_user][:password]
40
- @reset_user.password_confirmation = params[:caseadilla_user][:password_confirmation]
41
-
42
- if @reset_user.save
43
- flash[:notice] = "Password successfully updated"
44
- redirect_to new_caseadilla_user_session_url
45
- return
46
- end
47
- end
48
-
49
- render :action => :edit
50
- end
51
-
52
- private
53
-
54
- def load_user_using_perishable_token
55
-
56
- @reset_user = Caseadilla::User.find_using_perishable_token params[:token]
57
-
58
- unless @reset_user
59
- flash[:warning] = "Your account could not be located. Try to copy and paste the URL directly from the email."
60
- redirect_to new_caseadilla_user_session_url
61
- end
62
- end
63
- end
1
+ module Caseadilla
2
+ class PasswordResetsController < Caseadilla::CaseadillaController
3
+
4
+ skip_before_filter :authorise
5
+ before_filter :load_user_using_perishable_token, :only => [:edit, :update]
6
+
7
+ layout 'caseadilla_auth'
8
+
9
+ def create
10
+ users = Caseadilla::User.where(:email => params[:recover_email]).all
11
+
12
+ if users.length > 0
13
+ users.each do |user|
14
+ user.send_password_reset_instructions
15
+ end
16
+
17
+ if users.length > 1
18
+ flash[:notice] = "Multiple accounts were found. Emails have been sent to " + params[:recover_email] + " with instructions on how to reset your passwords"
19
+ else
20
+ flash[:notice] = "An email has been sent to " + params[:recover_email] + " with instructions on how to reset your password"
21
+ end
22
+ else
23
+ flash[:warning] = "There is no user with that email"
24
+ end
25
+
26
+ redirect_to new_caseadilla_user_session_url
27
+ end
28
+
29
+ def edit
30
+ render
31
+ end
32
+
33
+ def update
34
+
35
+ if params[:caseadilla_user][:password].empty? || params[:caseadilla_user][:password_confirmation].empty?
36
+ flash.now[:warning] = "A field has been left empty"
37
+ else
38
+
39
+ @reset_user.password = params[:caseadilla_user][:password]
40
+ @reset_user.password_confirmation = params[:caseadilla_user][:password_confirmation]
41
+
42
+ if @reset_user.save
43
+ flash[:notice] = "Password successfully updated"
44
+ redirect_to new_caseadilla_user_session_url
45
+ return
46
+ end
47
+ end
48
+
49
+ render :action => :edit
50
+ end
51
+
52
+ private
53
+
54
+ def load_user_using_perishable_token
55
+
56
+ @reset_user = Caseadilla::User.find_using_perishable_token params[:token]
57
+
58
+ unless @reset_user
59
+ flash[:warning] = "Your account could not be located. Try to copy and paste the URL directly from the email."
60
+ redirect_to new_caseadilla_user_session_url
61
+ end
62
+ end
63
+ end
64
64
  end