tb_core 1.3.3 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -0
  3. data/app/assets/javascripts/admin/core/application.js +2 -1
  4. data/app/assets/javascripts/admin/core/modal.js +36 -6
  5. data/app/assets/javascripts/admin/core/users.js +121 -2
  6. data/app/assets/javascripts/tb_core/configuration.js.erb +1 -1
  7. data/app/assets/javascripts/tb_core/remote.js +9 -6
  8. data/app/assets/javascripts/tb_core/utility.js +11 -0
  9. data/app/assets/stylesheets/admin/core/application.scss +118 -117
  10. data/app/assets/stylesheets/admin/core/login.scss +15 -14
  11. data/app/assets/stylesheets/admin/core/users.scss +14 -0
  12. data/app/controllers/admin/application_controller.rb +4 -14
  13. data/app/controllers/admin/password_resets_controller.rb +1 -1
  14. data/app/controllers/admin/user_sessions_controller.rb +0 -27
  15. data/app/controllers/admin/users_controller.rb +37 -4
  16. data/app/controllers/password_resets_controller.rb +1 -1
  17. data/app/controllers/spud/application_controller.rb +37 -11
  18. data/app/controllers/user_sessions_controller.rb +46 -10
  19. data/app/helpers/admin/application_helper.rb +8 -1
  20. data/app/helpers/spud/application_helper.rb +36 -0
  21. data/app/helpers/tb_core/application_helper.rb +2 -2
  22. data/app/mailers/tb_core_mailer.rb +25 -0
  23. data/app/models/spud/spud_user_model.rb +14 -0
  24. data/app/views/admin/setup/new.html.erb +6 -14
  25. data/app/views/admin/user_sessions/new.html.erb +1 -25
  26. data/app/views/admin/users/_form.html.erb +25 -2
  27. data/app/views/layouts/admin/application.html.erb +2 -2
  28. data/app/views/layouts/admin/login.html.erb +2 -1
  29. data/app/views/layouts/mailer.html.erb +23 -0
  30. data/app/views/tb_core_mailer/forgot_password_notification.html.erb +12 -0
  31. data/app/views/tb_core_mailer/user_credentials.html.erb +19 -0
  32. data/app/views/user_sessions/_form.html.erb +24 -0
  33. data/app/views/user_sessions/change_password.html.erb +21 -0
  34. data/app/views/user_sessions/new.html.erb +1 -22
  35. data/config/locales/en.yml +12 -2
  36. data/config/routes.rb +5 -2
  37. data/db/migrate/20150610143438_add_requires_password_change_to_spud_users.rb +5 -0
  38. data/lib/generators/spud/setup_generator.rb +5 -0
  39. data/lib/generators/spud/templates/assets/application.js +1 -1
  40. data/lib/generators/spud/templates/assets/application.scss +2 -2
  41. data/lib/generators/spud/templates/assets/bootstrap.js +14 -0
  42. data/lib/spud_core/belongs_to_app.rb +1 -1
  43. data/lib/spud_core/engine.rb +1 -0
  44. data/lib/spud_core/errors.rb +8 -0
  45. data/lib/spud_core/version.rb +1 -1
  46. data/lib/tb_core/form_builder.rb +31 -6
  47. data/spec/controllers/admin/user_sessions_controller_spec.rb +0 -28
  48. data/spec/dummy/config/environments/development.rb +2 -2
  49. data/spec/dummy/db/migrate/20150610180845_add_requires_password_change_to_spud_users.tb_core.rb +6 -0
  50. data/spec/dummy/db/schema.rb +23 -22
  51. data/spec/models/spud_user_spec.rb +18 -2
  52. metadata +28 -20
  53. data/app/assets/libs/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  54. data/app/assets/libs/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  55. data/app/assets/libs/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  56. data/app/assets/libs/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  57. data/app/assets/libs/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  58. data/app/assets/libs/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  59. data/app/assets/libs/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  60. data/app/assets/libs/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  61. data/app/assets/libs/jquery-ui/images/ui-icons_222222_256x240.png +0 -0
  62. data/app/assets/libs/jquery-ui/images/ui-icons_2e83ff_256x240.png +0 -0
  63. data/app/assets/libs/jquery-ui/images/ui-icons_454545_256x240.png +0 -0
  64. data/app/assets/libs/jquery-ui/images/ui-icons_888888_256x240.png +0 -0
  65. data/app/assets/libs/jquery-ui/images/ui-icons_cd0a0a_256x240.png +0 -0
  66. data/app/assets/libs/jquery-ui/jquery-ui.js +0 -8952
  67. data/app/assets/libs/jquery-ui/jquery-ui.scss +0 -784
  68. data/app/mailers/core_mailer.rb +0 -9
  69. data/app/views/core_mailer/forgot_password_notification.html.erb +0 -14
  70. data/app/views/core_mailer/forgot_password_notification.text.erb +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71aea9ddb3c9316dc739b01f90a9d4fc691de43f
4
- data.tar.gz: 2c6513d8c1deca712ffee16191abc4a60d1d0ace
3
+ metadata.gz: cf2f47767b015951d5eca3a7af3055b5c20101d6
4
+ data.tar.gz: 3869ef7c61f21fbef83d92303d81bbd819081abc
5
5
  SHA512:
6
- metadata.gz: eab1674d55e9a78198f6b740e1e3ba26bb62805e0dde9382c68f110794b81db84bc70865d26c4a3e18a1ca98d4761aa9d71759552ceb6d04e0e43a1747428147
7
- data.tar.gz: cd40971446fe52fdeafedfa2e653701ced4d23843b0592902c2e2d1f56a771585db6b413f5b08e7fc66bc363710b4caefbcfe8720f18f83eb2e774d5d3273687
6
+ metadata.gz: d4e8a3d18f3768dd7bdc4c4c58bed5ce6d412203cda91e86b324e7a36af44e672a1ee7722e9ded0b869590a975210ad5d9789d1ec5a5230e7a2c5d1e71528619
7
+ data.tar.gz: c084bff092e94de06d53b90d8253e041be1d4e338dce48d83c95d00563579bc7f326b90648c8e70defbd2f50f5f1110117afd171e2f7bd721a422c51aabaf616
data/README.md CHANGED
@@ -163,6 +163,16 @@ You can specificy the `:builder` attribute in a `form_for`, or you can just use
163
163
 
164
164
  See `form_builder.rb` for the full details.
165
165
 
166
+ ### User Select
167
+
168
+ A common case is to have a model in your app that `belongs_to :spud_user`. The `tb_user_select` form helper method makes it easy to assign or create new users from within another form.
169
+
170
+ <%= tb_form_for @widget do |f| %>
171
+ <%= f.tb_user_select %>
172
+ <%= f.tb_text_field :name %>
173
+ <%= f.tb_save_buttons('Widget', widgets_path) %>
174
+ <% end %>
175
+
166
176
  Remote Forms
167
177
  --------------
168
178
 
@@ -1,8 +1,9 @@
1
1
  //= require jquery
2
2
  //= require jquery_ujs
3
+ //= require jquery-ui
3
4
  //= require tinymce-jquery
4
5
  //= require bootstrap-sprockets
5
- //= require jquery-ui/jquery-ui
6
+
6
7
  //= require ../../tb_core
7
8
  //= require_self
8
9
  //= require_tree .
@@ -4,12 +4,28 @@ spud.admin.modal = {
4
4
 
5
5
  displayWithOptions: function(options){
6
6
  var modal = $('#modal_window');
7
- if(options.title){
7
+ if (options.title){
8
8
  modal.find('.modal-title').text(options.title);
9
9
  }
10
- if(options.html){
10
+ if (options.html){
11
11
  modal.find('.modal-body').html(options.html);
12
12
  }
13
+ if (options.size) {
14
+ var sizeClass = '';
15
+ switch (options.size) {
16
+ case "lg": //because some people like brevity
17
+ case "large": //some like accuracy
18
+ case "modal-lg": // some like bootstrap
19
+ sizeClass = "modal-lg";
20
+ break;
21
+ case "sm":
22
+ case "small":
23
+ case "modal-sm":
24
+ sizeClass = "modal-sm";
25
+ break;
26
+ }
27
+ modal.find('.modal-dialog').addClass(sizeClass);
28
+ }
13
29
  var defaultFooter = modal.find('.modal-footer-default');
14
30
  if(options.buttons){
15
31
  var newFooter = defaultFooter.clone();
@@ -20,12 +36,26 @@ spud.admin.modal = {
20
36
  }
21
37
  defaultFooter.hide();
22
38
  newFooter.insertAfter(defaultFooter);
23
- }
24
- else{
39
+ } else {
25
40
  $('modal-footer-additional').remove();
26
- defaultFooter.show();
41
+ if(options.hideFooter){
42
+ defaultFooter.hide();
43
+ } else{
44
+ defaultFooter.show();
45
+ }
27
46
  }
28
- modal.modal('show');
47
+
48
+ // modalArgs are passed straight to the modal and can contain bootstrap default properties.
49
+ var modalArgs = 'show';
50
+ if (options.disableClose) {
51
+ // This modal cannot be closed by pressing escape or clicking the background page.
52
+ modalArgs = {
53
+ backdrop: 'static',
54
+ keyboard: false
55
+ };
56
+ }
57
+
58
+ modal.modal(modalArgs);
29
59
  },
30
60
 
31
61
  hide: function(){
@@ -1,11 +1,130 @@
1
1
  (function(){
2
2
 
3
- var splitPane;
3
+ var $picker;
4
4
 
5
5
  spud.admin.users = {
6
- index: function(){
6
+ init: function(){
7
+ var $body = $('body');
8
+ $body.on('click', '.btn-generate-password', clickedGeneratePassword);
9
+ $body.on('change', '#spud_user_password', changedUserPassword);
7
10
 
11
+ $picker = $('.tb-user-select');
12
+ if($picker.length > 0){
13
+ $picker.on('change', changedUserSelect).trigger('change');
14
+ $body.on('click', '.tb-user-select-edit', clickedPickerEdit);
15
+ $body.on('click', '.tb-user-select-add', clickedPickerAdd);
16
+ $('.modal-body').on('ajax:success', '.user-form', savedModalUser);
17
+ }
8
18
  }
9
19
  };
10
20
 
21
+ /*
22
+ * Set a randomly generated password
23
+ */
24
+ var clickedGeneratePassword = function(e){
25
+ e.preventDefault();
26
+ var randomPassword = generatePassword(12);
27
+ $('#spud_user_password').val(randomPassword).trigger('change');
28
+ $('#spud_user_password_confirmation').val(randomPassword);
29
+ $('.generated-password').text("Generated: " + randomPassword);
30
+ $('#spud_user_requires_password_change').prop('checked', true);
31
+ $('#send_email').prop('checked', true);
32
+ };
33
+
34
+ var generatePassword = function(length){
35
+ var charset = "abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
36
+ var password = '';
37
+ for(var i=0, n=charset.length; i<length; i++){
38
+ password += charset.charAt(Math.floor(Math.random() * n));
39
+ }
40
+ return password;
41
+ };
42
+
43
+ /*
44
+ * If a password is set, display the Send Email option. Otherwise, hide it.
45
+ */
46
+ var changedUserPassword = function(e){
47
+ var value = $(this).val();
48
+ if(value === ''){
49
+ $('.user-send-email-group').hide().prop('checked', false);
50
+ }
51
+ else{
52
+ $('.user-send-email-group').show();
53
+ }
54
+ };
55
+
56
+ /*
57
+ * If a user is selected, enable the Edit button. Otherwise disable it.
58
+ */
59
+ var changedUserSelect = function(e){
60
+ var id = $(this).val();
61
+ var $edit = $('.tb-user-select-edit');
62
+ if(id){
63
+ $('.tb-user-select-edit').attr('disabled', false);
64
+ }
65
+ else{
66
+ $('.tb-user-select-edit').attr('disabled', true);
67
+ }
68
+ };
69
+
70
+ /*
71
+ * Bring up the edit form when the Edit button is clicked
72
+ */
73
+ var clickedPickerEdit = function(e){
74
+ e.preventDefault();
75
+ var id = $('.tb-user-select').val();
76
+ if(id){
77
+ var href = $(this).attr('href').replace(':id', id);
78
+ $.ajax(href, {
79
+ dataType: 'html',
80
+ success: function(html){
81
+ spud.admin.modal.displayWithOptions({
82
+ title: 'Edit User',
83
+ html: html,
84
+ hideFooter: true
85
+ });
86
+ }
87
+ });
88
+ }
89
+ };
90
+
91
+ /*
92
+ * Bring up the new user form when the Add button is clicked
93
+ */
94
+ var clickedPickerAdd = function(e){
95
+ e.preventDefault();
96
+ $.ajax($(this).attr('href'), {
97
+ dataType: 'html',
98
+ success: function(html){
99
+ spud.admin.modal.displayWithOptions({
100
+ title: 'New User',
101
+ html: html,
102
+ hideFooter: true
103
+ });
104
+ }
105
+ });
106
+ };
107
+
108
+ /*
109
+ * When a user is saved, close the modal and update the picker
110
+ */
111
+ var savedModalUser = function(event, json, textStatus, jqXHR){
112
+ var $option = $('<option/>', {
113
+ value: json.id,
114
+ text: json.first_name + ' ' + json.last_name + ' (' + json.email + ')'
115
+ });
116
+ var $existingOption = $('.tb-user-select option[value=' + json.id + ']');
117
+ if($existingOption.length > 0){
118
+ $existingOption.replaceWith($option);
119
+ }
120
+ else{
121
+ $picker.append($option);
122
+ }
123
+ $picker.val(json.id);
124
+ spud.admin.modal.hide();
125
+ return false;
126
+ };
127
+
128
+ $(document).ready(spud.admin.users.init);
129
+
11
130
  })();
@@ -2,7 +2,7 @@
2
2
 
3
3
  tb.config = {
4
4
  env: '<%= Rails.env %>',
5
- siteName: '<%= Spud::Core.config.site_name %>',
5
+ siteName: '<%= Spud::Core.config.site_name.gsub("'"){"\\'"} %>',
6
6
  subUri: '<%= Rails.configuration.relative_url_root %>'
7
7
  };
8
8
 
@@ -106,9 +106,9 @@ var displayErrorsInline = function($form, errors){
106
106
 
107
107
  if (keyArr.length === 2) {
108
108
  keyArr[0] += '_attributes';
109
- $input = $("[name$='[" + keyArr.join('][') + "]']");
109
+ $input = $form.find("[name$='[" + keyArr.join('][') + "]']");
110
110
  } else {
111
- $input = $("[name$='[" + key + "]']");
111
+ $input = $form.find("[name$='[" + key + "]']");
112
112
  }
113
113
 
114
114
  if($input.length > 0){
@@ -117,14 +117,17 @@ var displayErrorsInline = function($form, errors){
117
117
  }
118
118
  else{
119
119
  console.warn('Missing input field for key:', key);
120
+ $form.prepend('<p class="form-error form-error-base">'+key+' '+errors[key][0]+'</p>');
120
121
  }
121
122
  }
122
123
  }
123
- var $firstError = $form.find('.form-error-inline, .form-error-base').first().parent('div');
124
+ var $firstError = $form.find('.form-error-inline, .form-error-base').first().parent();
124
125
  if($firstError.length > 0){
125
- $('body, html').animate({
126
- scrollTop: $firstError.offset().top
127
- });
126
+ if(!tb.util.elementIsInView($firstError)){
127
+ $('body, html').animate({
128
+ scrollTop: $firstError.offset().top
129
+ });
130
+ }
128
131
  }
129
132
  };
130
133
 
@@ -30,6 +30,17 @@ tb.util = {
30
30
 
31
31
  getCsrfToken: function(){
32
32
  return $('meta[name=csrf-token]').attr('content');
33
+ },
34
+
35
+ /*
36
+ * Use top/bottom offsets to determine if the given jQuery element is within the current scroll view
37
+ */
38
+ elementIsInView: function($element){
39
+ var docViewTop = document.body.scrollTop;
40
+ var docViewBottom = docViewTop + $(window).height();
41
+ var container = $('.stat-front-desk');
42
+ var elemTop = $element.offset().top;
43
+ return docViewBottom >= elemTop && docViewTop <= elemTop;
33
44
  }
34
45
  };
35
46
 
@@ -1,107 +1,108 @@
1
- //= require jquery-ui/jquery-ui
2
1
  //= require_self
3
2
  //= require_directory
4
3
 
4
+ //= require jquery-ui
5
+
5
6
  @import "bootstrap-sprockets";
6
7
  @import "bootstrap";
7
8
 
8
9
  body {
9
- background:#eee;
10
- background-color:#eee;
11
- margin: 0 0;
10
+ background:#eee;
11
+ background-color:#eee;
12
+ margin: 0 0;
12
13
  }
13
14
 
14
15
  // Header
15
16
  #header {
16
- padding: 5px 15px;
17
- background: #333;
18
- color: #fff;
19
- font-size: 14px;
20
- h1{
21
- font: normal 18px/18px sans-serif;
22
- color: #fff;
23
- display: inline;
24
- }
25
- a{
26
- color: white;
27
- }
17
+ padding: 5px 15px;
18
+ background: #333;
19
+ color: #fff;
20
+ font-size: 14px;
21
+ h1{
22
+ font: normal 18px/18px sans-serif;
23
+ color: #fff;
24
+ display: inline;
25
+ }
26
+ a{
27
+ color: white;
28
+ }
28
29
  }
29
30
 
30
31
  // Admin Apps
31
32
  .admin-application {
32
- width:150px;
33
- background:#fff;
34
- float:left;
35
- text-align:center;
36
- border:1px solid transparent;
37
- border-radius:10px;
38
- margin: 0 20px 20px 0;
39
- position: relative;
40
- user-select: none;
41
- &:hover{
42
- background:#fff;
43
- border:1px solid #ccc;
44
- }
45
- a, a:visited{
46
- display:block;
47
- color:#000;
48
- padding:10px 10px;
49
- text-decoration:none;
50
- }
51
- img {
52
- width: 125px;
53
- border: none;
54
- height: 125px;
55
- }
56
- .dash-icon-badge{
57
- display: none;
58
- position: absolute;
59
- right: -15px;
60
- top: -15px;
61
- width: 36px;
62
- height: 36px;
63
- background: #e55137;
64
- border-radius: 18px;
65
- color: white;
66
- line-height: 36px;
67
- font-size: 15px;
68
- }
69
- .application-name{
70
- white-space: nowrap;
71
- }
33
+ width:150px;
34
+ background:#fff;
35
+ float:left;
36
+ text-align:center;
37
+ border:1px solid transparent;
38
+ border-radius:10px;
39
+ margin: 0 20px 20px 0;
40
+ position: relative;
41
+ user-select: none;
42
+ &:hover{
43
+ background:#fff;
44
+ border:1px solid #ccc;
45
+ }
46
+ a, a:visited{
47
+ display:block;
48
+ color:#000;
49
+ padding:10px 10px;
50
+ text-decoration:none;
51
+ }
52
+ img {
53
+ width: 125px;
54
+ border: none;
55
+ height: 125px;
56
+ }
57
+ .dash-icon-badge{
58
+ display: none;
59
+ position: absolute;
60
+ right: -15px;
61
+ top: -15px;
62
+ width: 36px;
63
+ height: 36px;
64
+ background: #e55137;
65
+ border-radius: 18px;
66
+ color: white;
67
+ line-height: 36px;
68
+ font-size: 15px;
69
+ }
70
+ .application-name{
71
+ white-space: nowrap;
72
+ }
72
73
  }
73
74
 
74
75
  // Detail
75
76
  .nav-tabs{
76
- margin-bottom: 20px;
77
+ margin-bottom: 20px;
77
78
  }
78
79
  .admin-search-form{
79
- display: inline;
80
+ display: inline;
80
81
  }
81
82
  .detail-wrapper {
82
- background:#fff;
83
- min-height:300px;
84
- border-radius:10px;
85
- margin: 0 auto 20px;
86
- padding: 15px;
87
- .detail-title{
88
- margin: 0 0 15px;
89
- }
90
- .app-thumbnail{
91
- width: 40px;
92
- height: 40px;
93
- display: inline-block;
94
- margin: 0;
95
- }
96
- .data-controls{
97
- float: right;
98
- }
99
- .pagination{
100
- margin-bottom: 0;
101
- }
102
- .details{
83
+ background:#fff;
84
+ min-height:300px;
85
+ border-radius:10px;
86
+ margin: 0 auto 20px;
87
+ padding: 15px;
88
+ .detail-title{
89
+ margin: 0 0 15px;
90
+ }
91
+ .app-thumbnail{
92
+ width: 40px;
93
+ height: 40px;
94
+ display: inline-block;
95
+ margin: 0;
96
+ }
97
+ .data-controls{
98
+ float: right;
99
+ }
100
+ .pagination{
101
+ margin-bottom: 0;
102
+ }
103
+ .details{
103
104
 
104
- }
105
+ }
105
106
  }
106
107
 
107
108
  // Forms
@@ -111,61 +112,61 @@ div.field_with_errors {
111
112
  display: inline;
112
113
  }
113
114
  div.field_with_errors label, .form-field-error, .form-errors {
114
- color: crimson;
115
+ color: crimson;
115
116
  }
116
117
 
117
118
  // New (Remote) Errors
118
119
  p.form-error{
119
- color: crimson;
120
- font-size: 12px;
121
- font-style: italic;
122
- line-height: normal;
123
- margin: 4px 0 0;
120
+ color: crimson;
121
+ font-size: 12px;
122
+ font-style: italic;
123
+ line-height: normal;
124
+ margin: 4px 0 0;
124
125
  }
125
126
  p.form-error-base{
126
- margin: 0 0 10px;
127
+ margin: 0 0 10px;
127
128
  }
128
129
  @media (min-width: $screen-sm){
129
- .form-horizontal .form-error-base{
130
- margin-left: 17.3%;
131
- }
130
+ .form-horizontal .form-error-base{
131
+ margin-left: 17.3%;
132
+ }
132
133
  }
133
134
  .date-select{
134
- &.form-control{
135
- display: inline-block;
136
- }
137
- &.year{
138
- width: 20%
139
- }
140
- &.month{
141
- width: 35%
142
- }
143
- &.day{
144
- width: 20%
145
- }
135
+ &.form-control{
136
+ display: inline-block;
137
+ }
138
+ &.year{
139
+ width: 20%
140
+ }
141
+ &.month{
142
+ width: 35%
143
+ }
144
+ &.day{
145
+ width: 20%
146
+ }
146
147
  }
147
148
  .datetime-select{
148
- &.form-control{
149
- display: inline-block;
150
- }
151
- &.year{
152
- width: 20%;
153
- }
154
- &.month{
155
- width: 22.3%;
156
- }
157
- &.day, &.hour, &.minute{
158
- width: 15%;
159
- }
149
+ &.form-control{
150
+ display: inline-block;
151
+ }
152
+ &.year{
153
+ width: 20%;
154
+ }
155
+ &.month{
156
+ width: 22.3%;
157
+ }
158
+ &.day, &.hour, &.minute{
159
+ width: 15%;
160
+ }
160
161
  }
161
162
 
162
163
  // Tables
163
164
  td.no-wrap{
164
- white-space: nowrap;
165
+ white-space: nowrap;
165
166
  }
166
167
  td.table-actions{
167
- white-space: nowrap;
168
- text-align: right;
168
+ white-space: nowrap;
169
+ text-align: right;
169
170
  }
170
171
  .table .nesting-spacer{
171
172
  display: inline-block;
@@ -1,4 +1,4 @@
1
- .login-form {
1
+ .login-container{
2
2
  margin-top: 75px;
3
3
  padding: 0px;
4
4
  color:#000;
@@ -7,17 +7,18 @@
7
7
  box-shadow: 2px 2px 10px #777;
8
8
  overflow-x: hidden;
9
9
  overflow-y: hidden;
10
- }
11
- .login-form h1 {
12
- font-size: 28px;
13
- margin: 0 0 20px;
14
- padding: 10px 20px;
15
- background-color:#333;
16
- color: #fff;
17
- }
18
- .login-form .alert{
19
- margin: 0 10px;
20
- }
21
- .login-form form {
22
- margin: 20px;
10
+
11
+ h1{
12
+ font-size: 28px;
13
+ margin: 0 0 20px;
14
+ padding: 10px 20px;
15
+ background-color:#333;
16
+ color: #fff;
17
+ }
18
+ .alert{
19
+ margin: 0 10px;
20
+ }
21
+ form {
22
+ margin: 20px;
23
+ }
23
24
  }
@@ -0,0 +1,14 @@
1
+ // User Picker
2
+ .tb-user-select{
3
+ width: calc(100% - 184px);
4
+ display: inline-block;
5
+ }
6
+ .tb-user-select-btn{
7
+ width: 90px;
8
+ margin-left: 2px;
9
+ }
10
+
11
+ // Send Email
12
+ .user-send-email-group{
13
+ display: none;
14
+ }
@@ -8,22 +8,12 @@ class Admin::ApplicationController < Spud::ApplicationController
8
8
 
9
9
  private
10
10
 
11
- def handle_request_error(error)
12
- error.template = '/layouts/admin/error_page'
13
- super(error)
11
+ def template_for_request_error
12
+ return '/layouts/admin/error_page'
14
13
  end
15
14
 
16
- def require_admin_user
17
- if current_user.blank?
18
- flash[:notice] = "You must be logged in to access the requested page"
19
- redirect_to admin_login_path(:return_to => request.path)
20
- return false
21
- elsif !current_user.has_admin_rights?
22
- raise Spud::AccessDeniedError.new(:item => 'module', :template => '/layouts/admin/error_page')
23
- return false
24
- else
25
- return true
26
- end
15
+ def login_path_for_require_user
16
+ admin_login_path(:return_to => request.path)
27
17
  end
28
18
 
29
19
  end
@@ -12,7 +12,7 @@ class Admin::PasswordResetsController < Admin::ApplicationController
12
12
  @user = SpudUser.find_by_email(params[:email])
13
13
  if @user
14
14
  @user.reset_perishable_token!
15
- CoreMailer.forgot_password_notification(@user, admin_password_reset_url(@user.perishable_token)).deliver_later
15
+ TbCoreMailer.forgot_password_notification(@user, admin_password_reset_url(@user.perishable_token)).deliver_later
16
16
  flash[:notice] = "Instructions to reset your password have been emailed to you. " +
17
17
  "Please check your email."
18
18
  redirect_to admin_login_path