tb_core 1.3.3 → 1.3.4
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.
- checksums.yaml +4 -4
- data/README.md +10 -0
- data/app/assets/javascripts/admin/core/application.js +2 -1
- data/app/assets/javascripts/admin/core/modal.js +36 -6
- data/app/assets/javascripts/admin/core/users.js +121 -2
- data/app/assets/javascripts/tb_core/configuration.js.erb +1 -1
- data/app/assets/javascripts/tb_core/remote.js +9 -6
- data/app/assets/javascripts/tb_core/utility.js +11 -0
- data/app/assets/stylesheets/admin/core/application.scss +118 -117
- data/app/assets/stylesheets/admin/core/login.scss +15 -14
- data/app/assets/stylesheets/admin/core/users.scss +14 -0
- data/app/controllers/admin/application_controller.rb +4 -14
- data/app/controllers/admin/password_resets_controller.rb +1 -1
- data/app/controllers/admin/user_sessions_controller.rb +0 -27
- data/app/controllers/admin/users_controller.rb +37 -4
- data/app/controllers/password_resets_controller.rb +1 -1
- data/app/controllers/spud/application_controller.rb +37 -11
- data/app/controllers/user_sessions_controller.rb +46 -10
- data/app/helpers/admin/application_helper.rb +8 -1
- data/app/helpers/spud/application_helper.rb +36 -0
- data/app/helpers/tb_core/application_helper.rb +2 -2
- data/app/mailers/tb_core_mailer.rb +25 -0
- data/app/models/spud/spud_user_model.rb +14 -0
- data/app/views/admin/setup/new.html.erb +6 -14
- data/app/views/admin/user_sessions/new.html.erb +1 -25
- data/app/views/admin/users/_form.html.erb +25 -2
- data/app/views/layouts/admin/application.html.erb +2 -2
- data/app/views/layouts/admin/login.html.erb +2 -1
- data/app/views/layouts/mailer.html.erb +23 -0
- data/app/views/tb_core_mailer/forgot_password_notification.html.erb +12 -0
- data/app/views/tb_core_mailer/user_credentials.html.erb +19 -0
- data/app/views/user_sessions/_form.html.erb +24 -0
- data/app/views/user_sessions/change_password.html.erb +21 -0
- data/app/views/user_sessions/new.html.erb +1 -22
- data/config/locales/en.yml +12 -2
- data/config/routes.rb +5 -2
- data/db/migrate/20150610143438_add_requires_password_change_to_spud_users.rb +5 -0
- data/lib/generators/spud/setup_generator.rb +5 -0
- data/lib/generators/spud/templates/assets/application.js +1 -1
- data/lib/generators/spud/templates/assets/application.scss +2 -2
- data/lib/generators/spud/templates/assets/bootstrap.js +14 -0
- data/lib/spud_core/belongs_to_app.rb +1 -1
- data/lib/spud_core/engine.rb +1 -0
- data/lib/spud_core/errors.rb +8 -0
- data/lib/spud_core/version.rb +1 -1
- data/lib/tb_core/form_builder.rb +31 -6
- data/spec/controllers/admin/user_sessions_controller_spec.rb +0 -28
- data/spec/dummy/config/environments/development.rb +2 -2
- data/spec/dummy/db/migrate/20150610180845_add_requires_password_change_to_spud_users.tb_core.rb +6 -0
- data/spec/dummy/db/schema.rb +23 -22
- data/spec/models/spud_user_spec.rb +18 -2
- metadata +28 -20
- data/app/assets/libs/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/libs/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/app/assets/libs/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/app/assets/libs/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/libs/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/app/assets/libs/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/app/assets/libs/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/app/assets/libs/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/app/assets/libs/jquery-ui/images/ui-icons_222222_256x240.png +0 -0
- data/app/assets/libs/jquery-ui/images/ui-icons_2e83ff_256x240.png +0 -0
- data/app/assets/libs/jquery-ui/images/ui-icons_454545_256x240.png +0 -0
- data/app/assets/libs/jquery-ui/images/ui-icons_888888_256x240.png +0 -0
- data/app/assets/libs/jquery-ui/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/app/assets/libs/jquery-ui/jquery-ui.js +0 -8952
- data/app/assets/libs/jquery-ui/jquery-ui.scss +0 -784
- data/app/mailers/core_mailer.rb +0 -9
- data/app/views/core_mailer/forgot_password_notification.html.erb +0 -14
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf2f47767b015951d5eca3a7af3055b5c20101d6
|
4
|
+
data.tar.gz: 3869ef7c61f21fbef83d92303d81bbd819081abc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
@@ -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
|
-
|
41
|
+
if(options.hideFooter){
|
42
|
+
defaultFooter.hide();
|
43
|
+
} else{
|
44
|
+
defaultFooter.show();
|
45
|
+
}
|
27
46
|
}
|
28
|
-
|
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
|
3
|
+
var $picker;
|
4
4
|
|
5
5
|
spud.admin.users = {
|
6
|
-
|
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
|
})();
|
@@ -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(
|
124
|
+
var $firstError = $form.find('.form-error-inline, .form-error-base').first().parent();
|
124
125
|
if($firstError.length > 0){
|
125
|
-
|
126
|
-
|
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
|
-
|
10
|
-
|
11
|
-
|
10
|
+
background:#eee;
|
11
|
+
background-color:#eee;
|
12
|
+
margin: 0 0;
|
12
13
|
}
|
13
14
|
|
14
15
|
// Header
|
15
16
|
#header {
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
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
|
-
|
77
|
+
margin-bottom: 20px;
|
77
78
|
}
|
78
79
|
.admin-search-form{
|
79
|
-
|
80
|
+
display: inline;
|
80
81
|
}
|
81
82
|
.detail-wrapper {
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
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
|
-
|
115
|
+
color: crimson;
|
115
116
|
}
|
116
117
|
|
117
118
|
// New (Remote) Errors
|
118
119
|
p.form-error{
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
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
|
-
|
127
|
+
margin: 0 0 10px;
|
127
128
|
}
|
128
129
|
@media (min-width: $screen-sm){
|
129
|
-
|
130
|
-
|
131
|
-
|
130
|
+
.form-horizontal .form-error-base{
|
131
|
+
margin-left: 17.3%;
|
132
|
+
}
|
132
133
|
}
|
133
134
|
.date-select{
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
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
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
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
|
-
|
165
|
+
white-space: nowrap;
|
165
166
|
}
|
166
167
|
td.table-actions{
|
167
|
-
|
168
|
-
|
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-
|
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
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
}
|
18
|
-
.
|
19
|
-
|
20
|
-
}
|
21
|
-
|
22
|
-
|
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
|
}
|
@@ -8,22 +8,12 @@ class Admin::ApplicationController < Spud::ApplicationController
|
|
8
8
|
|
9
9
|
private
|
10
10
|
|
11
|
-
def
|
12
|
-
|
13
|
-
super(error)
|
11
|
+
def template_for_request_error
|
12
|
+
return '/layouts/admin/error_page'
|
14
13
|
end
|
15
14
|
|
16
|
-
def
|
17
|
-
|
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
|
-
|
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
|