casein 3.1.0
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.
- data/Gemfile +1 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +215 -0
- data/Rakefile +40 -0
- data/app/controllers/casein/casein_controller.rb +72 -0
- data/app/controllers/casein/password_resets_controller.rb +66 -0
- data/app/controllers/casein/user_sessions_controller.rb +40 -0
- data/app/controllers/casein/users_controller.rb +102 -0
- data/app/helpers/casein/casein_helper.rb +170 -0
- data/app/mailers/casein/casein_notification.rb +44 -0
- data/app/models/casein/user.rb +55 -0
- data/app/models/casein/user_session.rb +8 -0
- data/app/views/casein/casein/blank.html.erb +1 -0
- data/app/views/casein/casein_notification/generate_new_password.erb +12 -0
- data/app/views/casein/casein_notification/new_user_information.erb +12 -0
- data/app/views/casein/casein_notification/password_reset_instructions.erb +11 -0
- data/app/views/casein/password_resets/edit.html.erb +48 -0
- data/app/views/casein/user_sessions/new.html.erb +66 -0
- data/app/views/casein/users/index.html.erb +35 -0
- data/app/views/casein/users/new.html.erb +46 -0
- data/app/views/casein/users/show.html.erb +94 -0
- data/app/views/layouts/casein_auth.html.erb +24 -0
- data/app/views/layouts/casein_main.html.erb +61 -0
- data/config/routes.rb +19 -0
- data/lib/casein.rb +3 -0
- data/lib/casein/engine.rb +12 -0
- data/lib/generators/casein/install/USAGE +1 -0
- data/lib/generators/casein/install/install_generator.rb +37 -0
- data/lib/generators/casein/install/templates/app/helpers/casein/config_helper.rb +46 -0
- data/lib/generators/casein/install/templates/app/views/casein/layouts/_left_navigation.html.erb +2 -0
- data/lib/generators/casein/install/templates/app/views/casein/layouts/_right_navigation.html.erb +1 -0
- data/lib/generators/casein/install/templates/db/migrate/casein_create_users.rb +30 -0
- data/lib/generators/casein/install/templates/public/casein/javascripts/custom.js +3 -0
- data/lib/generators/casein/install/templates/public/casein/stylesheets/custom.css +3 -0
- data/lib/generators/casein/install/templates/public/robots.txt +5 -0
- data/lib/generators/casein/scaffold/USAGE +1 -0
- data/lib/generators/casein/scaffold/scaffold_generator.rb +97 -0
- data/lib/generators/casein/scaffold/templates/controller.rb +60 -0
- data/lib/generators/casein/scaffold/templates/migration.rb +13 -0
- data/lib/generators/casein/scaffold/templates/model.rb +3 -0
- data/lib/generators/casein/scaffold/templates/views/_form.html.erb +9 -0
- data/lib/generators/casein/scaffold/templates/views/_table.html.erb +17 -0
- data/lib/generators/casein/scaffold/templates/views/index.html.erb +11 -0
- data/lib/generators/casein/scaffold/templates/views/new.html.erb +18 -0
- data/lib/generators/casein/scaffold/templates/views/show.html.erb +18 -0
- data/lib/generators/casein/update/USAGE +1 -0
- data/lib/generators/casein/update/templates/public/casein/images/casein.png +0 -0
- data/lib/generators/casein/update/templates/public/casein/images/header.png +0 -0
- data/lib/generators/casein/update/templates/public/casein/images/icons/add.png +0 -0
- data/lib/generators/casein/update/templates/public/casein/images/icons/delete.png +0 -0
- data/lib/generators/casein/update/templates/public/casein/images/icons/table.png +0 -0
- data/lib/generators/casein/update/templates/public/casein/images/login/alertBg.png +0 -0
- data/lib/generators/casein/update/templates/public/casein/images/login/background.png +0 -0
- data/lib/generators/casein/update/templates/public/casein/images/login/bottom.png +0 -0
- data/lib/generators/casein/update/templates/public/casein/images/login/loginBoxBg.png +0 -0
- data/lib/generators/casein/update/templates/public/casein/images/login/loginBoxBottom.png +0 -0
- data/lib/generators/casein/update/templates/public/casein/images/login/loginBoxTop.png +0 -0
- data/lib/generators/casein/update/templates/public/casein/images/login/loginSubmit.png +0 -0
- data/lib/generators/casein/update/templates/public/casein/images/login/recoverSubmit.png +0 -0
- data/lib/generators/casein/update/templates/public/casein/images/login/top.png +0 -0
- data/lib/generators/casein/update/templates/public/casein/images/nav.png +0 -0
- data/lib/generators/casein/update/templates/public/casein/images/rightNav.png +0 -0
- data/lib/generators/casein/update/templates/public/casein/images/rightNavButton.png +0 -0
- data/lib/generators/casein/update/templates/public/casein/images/visitSiteNav.png +0 -0
- data/lib/generators/casein/update/templates/public/casein/javascripts/casein.js +25 -0
- data/lib/generators/casein/update/templates/public/casein/javascripts/jquery.js +154 -0
- data/lib/generators/casein/update/templates/public/casein/javascripts/login.js +24 -0
- data/lib/generators/casein/update/templates/public/casein/javascripts/rails.js +132 -0
- data/lib/generators/casein/update/templates/public/casein/stylesheets/elements.css +307 -0
- data/lib/generators/casein/update/templates/public/casein/stylesheets/login.css +133 -0
- data/lib/generators/casein/update/templates/public/casein/stylesheets/screen.css +206 -0
- data/lib/generators/casein/update/update_generator.rb +40 -0
- data/lib/railties/tasks.rake +31 -0
- data/test/casein3_test.rb +8 -0
- data/test/test_helper.rb +3 -0
- metadata +174 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
jQuery(document).ready(function()
|
2
|
+
{
|
3
|
+
if(jQuery("#notice"))
|
4
|
+
{
|
5
|
+
setTimeout(function()
|
6
|
+
{
|
7
|
+
jQuery("#notice").fadeOut(500);
|
8
|
+
}, 20000);
|
9
|
+
};
|
10
|
+
});
|
11
|
+
|
12
|
+
toggleDiv = function(div)
|
13
|
+
{
|
14
|
+
switch ($("#"+div).css('display'))
|
15
|
+
{
|
16
|
+
case "none":
|
17
|
+
$("#"+div).fadeIn(300);
|
18
|
+
break;
|
19
|
+
|
20
|
+
case "block":
|
21
|
+
$("#"+div).fadeOut(300);
|
22
|
+
break;
|
23
|
+
}
|
24
|
+
}
|
@@ -0,0 +1,132 @@
|
|
1
|
+
jQuery(function ($) {
|
2
|
+
var csrf_token = $('meta[name=csrf-token]').attr('content'),
|
3
|
+
csrf_param = $('meta[name=csrf-param]').attr('content');
|
4
|
+
|
5
|
+
$.fn.extend({
|
6
|
+
/**
|
7
|
+
* Triggers a custom event on an element and returns the event result
|
8
|
+
* this is used to get around not being able to ensure callbacks are placed
|
9
|
+
* at the end of the chain.
|
10
|
+
*
|
11
|
+
* TODO: deprecate with jQuery 1.4.2 release, in favor of subscribing to our
|
12
|
+
* own events and placing ourselves at the end of the chain.
|
13
|
+
*/
|
14
|
+
triggerAndReturn: function (name, data) {
|
15
|
+
var event = new $.Event(name);
|
16
|
+
this.trigger(event, data);
|
17
|
+
|
18
|
+
return event.result !== false;
|
19
|
+
},
|
20
|
+
|
21
|
+
/**
|
22
|
+
* Handles execution of remote calls firing overridable events along the way
|
23
|
+
*/
|
24
|
+
callRemote: function () {
|
25
|
+
var el = this,
|
26
|
+
method = el.attr('method') || el.attr('data-method') || 'GET',
|
27
|
+
url = el.attr('action') || el.attr('href'),
|
28
|
+
dataType = el.attr('data-type') || 'script';
|
29
|
+
|
30
|
+
if (url === undefined) {
|
31
|
+
throw "No URL specified for remote call (action or href must be present).";
|
32
|
+
} else {
|
33
|
+
if (el.triggerAndReturn('ajax:before')) {
|
34
|
+
var data = el.is('form') ? el.serializeArray() : [];
|
35
|
+
$.ajax({
|
36
|
+
url: url,
|
37
|
+
data: data,
|
38
|
+
dataType: dataType,
|
39
|
+
type: method.toUpperCase(),
|
40
|
+
beforeSend: function (xhr) {
|
41
|
+
el.trigger('ajax:loading', xhr);
|
42
|
+
},
|
43
|
+
success: function (data, status, xhr) {
|
44
|
+
el.trigger('ajax:success', [data, status, xhr]);
|
45
|
+
},
|
46
|
+
complete: function (xhr) {
|
47
|
+
el.trigger('ajax:complete', xhr);
|
48
|
+
},
|
49
|
+
error: function (xhr, status, error) {
|
50
|
+
el.trigger('ajax:failure', [xhr, status, error]);
|
51
|
+
}
|
52
|
+
});
|
53
|
+
}
|
54
|
+
|
55
|
+
el.trigger('ajax:after');
|
56
|
+
}
|
57
|
+
}
|
58
|
+
});
|
59
|
+
|
60
|
+
/**
|
61
|
+
* confirmation handler
|
62
|
+
*/
|
63
|
+
$('a[data-confirm],input[data-confirm]').live('click', function () {
|
64
|
+
var el = $(this);
|
65
|
+
if (el.triggerAndReturn('confirm')) {
|
66
|
+
if (!confirm(el.attr('data-confirm'))) {
|
67
|
+
return false;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
});
|
71
|
+
|
72
|
+
|
73
|
+
/**
|
74
|
+
* remote handlers
|
75
|
+
*/
|
76
|
+
$('form[data-remote]').live('submit', function (e) {
|
77
|
+
$(this).callRemote();
|
78
|
+
e.preventDefault();
|
79
|
+
});
|
80
|
+
|
81
|
+
$('a[data-remote],input[data-remote]').live('click', function (e) {
|
82
|
+
$(this).callRemote();
|
83
|
+
e.preventDefault();
|
84
|
+
});
|
85
|
+
|
86
|
+
$('a[data-method]:not([data-remote])').live('click', function (e){
|
87
|
+
var link = $(this),
|
88
|
+
href = link.attr('href'),
|
89
|
+
method = link.attr('data-method'),
|
90
|
+
form = $('<form method="post" action="'+href+'"></form>'),
|
91
|
+
metadata_input = '<input name="_method" value="'+method+'" type="hidden" />';
|
92
|
+
|
93
|
+
if (csrf_param != null && csrf_token != null) {
|
94
|
+
metadata_input += '<input name="'+csrf_param+'" value="'+csrf_token+'" type="hidden" />';
|
95
|
+
}
|
96
|
+
|
97
|
+
form.hide()
|
98
|
+
.append(metadata_input)
|
99
|
+
.appendTo('body');
|
100
|
+
|
101
|
+
e.preventDefault();
|
102
|
+
form.submit();
|
103
|
+
});
|
104
|
+
|
105
|
+
/**
|
106
|
+
* disable-with handlers
|
107
|
+
*/
|
108
|
+
var disable_with_input_selector = 'input[data-disable-with]';
|
109
|
+
var disable_with_form_remote_selector = 'form[data-remote]:has(' + disable_with_input_selector + ')';
|
110
|
+
var disable_with_form_not_remote_selector = 'form:not([data-remote]):has(' + disable_with_input_selector + ')';
|
111
|
+
|
112
|
+
var disable_with_input_function = function () {
|
113
|
+
$(this).find(disable_with_input_selector).each(function () {
|
114
|
+
var input = $(this);
|
115
|
+
input.data('enable-with', input.val())
|
116
|
+
.attr('value', input.attr('data-disable-with'))
|
117
|
+
.attr('disabled', 'disabled');
|
118
|
+
});
|
119
|
+
};
|
120
|
+
|
121
|
+
$(disable_with_form_remote_selector).live('ajax:before', disable_with_input_function);
|
122
|
+
$(disable_with_form_not_remote_selector).live('submit', disable_with_input_function);
|
123
|
+
|
124
|
+
$(disable_with_form_remote_selector).live('ajax:complete', function () {
|
125
|
+
$(this).find(disable_with_input_selector).each(function () {
|
126
|
+
var input = $(this);
|
127
|
+
input.removeAttr('disabled')
|
128
|
+
.val(input.data('enable-with'));
|
129
|
+
});
|
130
|
+
});
|
131
|
+
|
132
|
+
});
|
@@ -0,0 +1,307 @@
|
|
1
|
+
/* CASEIN */
|
2
|
+
|
3
|
+
.icon {
|
4
|
+
height: 16px;
|
5
|
+
width: 16px;
|
6
|
+
padding: 0px 9px 0px 9px;
|
7
|
+
display: block;
|
8
|
+
float: left;
|
9
|
+
}
|
10
|
+
|
11
|
+
.iconRow {
|
12
|
+
height: 16px;
|
13
|
+
width: 16px;
|
14
|
+
padding: 0px;
|
15
|
+
display: block;
|
16
|
+
float: left;
|
17
|
+
}
|
18
|
+
|
19
|
+
#content {
|
20
|
+
position: fixed;
|
21
|
+
font-size: 12px;
|
22
|
+
bottom: 0;
|
23
|
+
left: 0;
|
24
|
+
right: 318px;
|
25
|
+
background: #fff;
|
26
|
+
z-index: 10;
|
27
|
+
overflow: auto;
|
28
|
+
}
|
29
|
+
|
30
|
+
#content p {
|
31
|
+
font-size: 12px;
|
32
|
+
margin: 1em 0;
|
33
|
+
}
|
34
|
+
|
35
|
+
#data {
|
36
|
+
padding: 15px 25px 25px 25px;
|
37
|
+
}
|
38
|
+
|
39
|
+
#content h1 {
|
40
|
+
border-bottom: 2px solid #DDDDDD;
|
41
|
+
color: #111111;
|
42
|
+
font-size: 1.2em;
|
43
|
+
font-weight: normal;
|
44
|
+
margin: 0 0 15px 0;
|
45
|
+
padding: 0 0 5px 0;
|
46
|
+
}
|
47
|
+
|
48
|
+
#content h2, #preview h2 {
|
49
|
+
font-size: 15px;
|
50
|
+
font-weight: normal;
|
51
|
+
color: #111;
|
52
|
+
border-bottom: 2px solid #ddd;
|
53
|
+
padding: 0 0 5px 0;
|
54
|
+
margin: 0 0 15px 0;
|
55
|
+
position: relative;
|
56
|
+
}
|
57
|
+
|
58
|
+
#content h2 img, #preview h2 img {
|
59
|
+
position: absolute;
|
60
|
+
top: 0;
|
61
|
+
right: 0;
|
62
|
+
cursor: pointer;
|
63
|
+
}
|
64
|
+
|
65
|
+
#content .openFolder {
|
66
|
+
border-bottom: 1px solid #ddd;
|
67
|
+
background: url(/casein/images/icons/folder.png) no-repeat center left;
|
68
|
+
font-weight: bold;
|
69
|
+
cursor: pointer;
|
70
|
+
}
|
71
|
+
|
72
|
+
#content .itemList {
|
73
|
+
width: 100%;
|
74
|
+
border-bottom: 3px solid #666;
|
75
|
+
}
|
76
|
+
|
77
|
+
#content .itemList .center {
|
78
|
+
text-align: center;
|
79
|
+
}
|
80
|
+
|
81
|
+
#content .itemList .icon {
|
82
|
+
width: 16px;
|
83
|
+
}
|
84
|
+
|
85
|
+
#content .itemList th {
|
86
|
+
text-align: left;
|
87
|
+
font-size: 11px;
|
88
|
+
padding: 7px 8px 6px 8px;
|
89
|
+
border-bottom: 3px solid #666;
|
90
|
+
}
|
91
|
+
|
92
|
+
#content .itemList th a {
|
93
|
+
color: #000;
|
94
|
+
}
|
95
|
+
|
96
|
+
#content .delete {
|
97
|
+
width: 16px;
|
98
|
+
height: 16px;
|
99
|
+
padding: 0px;
|
100
|
+
}
|
101
|
+
|
102
|
+
#content .delete a {
|
103
|
+
float: left;
|
104
|
+
padding: 0px;
|
105
|
+
}
|
106
|
+
|
107
|
+
#content .itemList td {
|
108
|
+
font-size: 11px;
|
109
|
+
color: #333;
|
110
|
+
border-bottom: 1px solid #ddd;
|
111
|
+
}
|
112
|
+
|
113
|
+
#content .itemList td a {
|
114
|
+
display: block;
|
115
|
+
padding: 9px 8px 7px 8px;
|
116
|
+
line-height: 11px;
|
117
|
+
color: #333;
|
118
|
+
text-decoration: none;
|
119
|
+
}
|
120
|
+
|
121
|
+
#content .itemList td.noLink {
|
122
|
+
padding: 9px 8px 7px 8px;
|
123
|
+
}
|
124
|
+
|
125
|
+
#content .itemList tr.hover:hover {
|
126
|
+
background: #eee;
|
127
|
+
border-bottom: 1px solid #ccc;
|
128
|
+
cursor: pointer;
|
129
|
+
}
|
130
|
+
|
131
|
+
#content .even {
|
132
|
+
background: #e7edfc;
|
133
|
+
}
|
134
|
+
|
135
|
+
#content .tfContainer {
|
136
|
+
width: 45%;
|
137
|
+
min-height: 60px;
|
138
|
+
float: left;
|
139
|
+
padding: 0 5% 12px 0;
|
140
|
+
}
|
141
|
+
|
142
|
+
#content .tfContainer p {
|
143
|
+
margin: 0;
|
144
|
+
}
|
145
|
+
|
146
|
+
#content .tfContainer div {
|
147
|
+
float: left;
|
148
|
+
margin: 0 10px 0 0;
|
149
|
+
}
|
150
|
+
|
151
|
+
#content .tfContainer .caseinDateSelectWrapper div {
|
152
|
+
float: none;
|
153
|
+
margin: 0px;
|
154
|
+
margin-top: 4px;
|
155
|
+
}
|
156
|
+
|
157
|
+
#content .tfContainerSecond {
|
158
|
+
padding: 0 0 12px 4%;
|
159
|
+
}
|
160
|
+
|
161
|
+
#content .tfContainerFullWidth {
|
162
|
+
width: 100%;
|
163
|
+
padding-right: 0px;
|
164
|
+
}
|
165
|
+
|
166
|
+
#content .help {
|
167
|
+
border-bottom: 5px solid #fce701;
|
168
|
+
background: #fff9bb;
|
169
|
+
padding: 12px 20px 8px 20px;
|
170
|
+
font-size: 12px;
|
171
|
+
color: #111111;
|
172
|
+
margin: 0 0 20px 0;
|
173
|
+
font-style: italic;
|
174
|
+
}
|
175
|
+
|
176
|
+
#content label {
|
177
|
+
font-size: 12px;
|
178
|
+
color: #333;
|
179
|
+
}
|
180
|
+
|
181
|
+
#content #error {
|
182
|
+
border-bottom: 5px solid #f48e8e;
|
183
|
+
background: #f7b7b7;
|
184
|
+
padding: 12px 20px 8px 20px;
|
185
|
+
font-size: 12px;
|
186
|
+
color: #801616;
|
187
|
+
margin: 0 0 20px 0;
|
188
|
+
}
|
189
|
+
|
190
|
+
#content #notice {
|
191
|
+
border-bottom: 5px solid #95ccef;
|
192
|
+
background: #d9ebf6;
|
193
|
+
padding: 12px 20px 8px 20px;
|
194
|
+
font-size: 12px;
|
195
|
+
color: #245574;
|
196
|
+
margin: 0 0 20px 0;
|
197
|
+
}
|
198
|
+
|
199
|
+
#content .tfContainer .caseinTextField {
|
200
|
+
width: 100%;
|
201
|
+
font-size: 12px;
|
202
|
+
padding: 6px 0 5px 0;
|
203
|
+
margin: 3px 0 0 0;
|
204
|
+
}
|
205
|
+
|
206
|
+
#content .tfContainer .formError {
|
207
|
+
padding: 7px 0 0 0;
|
208
|
+
color: #801616;
|
209
|
+
}
|
210
|
+
|
211
|
+
#content .tfContainer .formError input {
|
212
|
+
border: 1px solid #801616;
|
213
|
+
}
|
214
|
+
|
215
|
+
#content .extraOptions {
|
216
|
+
font-size: 11px;
|
217
|
+
padding: 10px 0;
|
218
|
+
cursor: pointer;
|
219
|
+
width: 100px;
|
220
|
+
}
|
221
|
+
|
222
|
+
#content .extras {
|
223
|
+
padding: 15px;
|
224
|
+
border-top: 2px solid #ddd;
|
225
|
+
border-bottom: 2px solid #ddd;
|
226
|
+
margin: 5px 0;
|
227
|
+
background: #eee;
|
228
|
+
position: relative;
|
229
|
+
}
|
230
|
+
|
231
|
+
#content .extras .checkboxOptions {
|
232
|
+
padding: 20px 0 20px 0;
|
233
|
+
font-size: 11px;
|
234
|
+
color: #222;
|
235
|
+
font-weight: bold;
|
236
|
+
}
|
237
|
+
|
238
|
+
#content .invalidForm {
|
239
|
+
color: #993333;
|
240
|
+
border: 1px solid #ff6666;
|
241
|
+
}
|
242
|
+
|
243
|
+
#content .tfContainer .caseinSelect {
|
244
|
+
width: 100%;
|
245
|
+
margin: 5px 0 0 0;
|
246
|
+
}
|
247
|
+
|
248
|
+
#content .tfContainer .caseinDateTimeSelect {
|
249
|
+
width: auto;
|
250
|
+
margin: 5px 0 0 0;
|
251
|
+
}
|
252
|
+
|
253
|
+
#content .tfContainer .caseinFileFieldContainer {
|
254
|
+
width: 350px;
|
255
|
+
padding: 3px 5px 4px 5px;
|
256
|
+
margin: 3px 0 0 0;
|
257
|
+
border: 1px solid #ccc;
|
258
|
+
}
|
259
|
+
|
260
|
+
#content .caseinTextArea, #content .caseinTextAreaBig {
|
261
|
+
width: 100%;
|
262
|
+
height: 120px;
|
263
|
+
font-family: "Lucida Grande", "Trebuchet MS", Helvetica, Arial, sans-serif;
|
264
|
+
font-size: 12px;
|
265
|
+
padding: 6px 0 5px 0;
|
266
|
+
margin: 3px 0 0 0;
|
267
|
+
}
|
268
|
+
|
269
|
+
#content .caseinTextAreaBig {
|
270
|
+
height: 300px;
|
271
|
+
}
|
272
|
+
|
273
|
+
#content .rcText {
|
274
|
+
font-size: 11px;
|
275
|
+
color: #333;
|
276
|
+
}
|
277
|
+
|
278
|
+
#content .submits {
|
279
|
+
text-align: right;
|
280
|
+
font-size: 12px;
|
281
|
+
padding: 10px 10px;
|
282
|
+
background-color: #ddd;
|
283
|
+
}
|
284
|
+
|
285
|
+
#content .cancel, #content a.negative:link, #content a.negative:visited {
|
286
|
+
color: #ff0000;
|
287
|
+
}
|
288
|
+
|
289
|
+
#content .cancel:hover, #content a.negative:visited:hover {
|
290
|
+
color: #990000;
|
291
|
+
}
|
292
|
+
|
293
|
+
#content .pagination {
|
294
|
+
text-align: center;
|
295
|
+
margin: 20px 0px 0px 0px;
|
296
|
+
font-size: 12px;
|
297
|
+
padding: 10px 10px;
|
298
|
+
background-color: #ddd;
|
299
|
+
}
|
300
|
+
|
301
|
+
#content .pagination a:link, a:visited {
|
302
|
+
color: #555;
|
303
|
+
}
|
304
|
+
|
305
|
+
#content .pagination a:hover, a:visited:hover {
|
306
|
+
color: #000;
|
307
|
+
}
|