hobo 0.7.0 → 0.7.1
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/hobo_files/plugin/CHANGES.txt +220 -23
- data/hobo_files/plugin/generators/hobo_front_controller/templates/index.dryml +18 -25
- data/hobo_files/plugin/generators/hobo_migration/hobo_migration_generator.rb +20 -15
- data/hobo_files/plugin/generators/hobo_model/templates/model.rb +3 -3
- data/hobo_files/plugin/generators/hobo_rapid/hobo_rapid_generator.rb +3 -3
- data/hobo_files/plugin/generators/hobo_rapid/templates/hobo-rapid.css +1 -2
- data/hobo_files/plugin/generators/hobo_rapid/templates/hobo-rapid.js +21 -4
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/clean/public/images/fieldbg.gif +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/clean/public/images/spinner.gif +0 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/clean/public/stylesheets/application.css +154 -26
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/clean/public/stylesheets/rapid-ui.css +144 -0
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/views/application.dryml +1 -1
- data/hobo_files/plugin/generators/hobo_user_controller/templates/controller.rb +1 -1
- data/hobo_files/plugin/generators/hobo_user_model/templates/model.rb +8 -11
- data/hobo_files/plugin/init.rb +0 -2
- data/hobo_files/plugin/lib/active_record/has_many_association.rb +0 -9
- data/hobo_files/plugin/lib/active_record/has_many_through_association.rb +0 -10
- data/hobo_files/plugin/lib/hobo.rb +57 -44
- data/hobo_files/plugin/lib/hobo/bundle.rb +222 -0
- data/hobo_files/plugin/lib/hobo/controller.rb +2 -5
- data/hobo_files/plugin/lib/hobo/dryml.rb +8 -7
- data/hobo_files/plugin/lib/hobo/dryml/dryml_builder.rb +10 -21
- data/hobo_files/plugin/lib/hobo/dryml/taglib.rb +107 -80
- data/hobo_files/plugin/lib/hobo/dryml/template.rb +27 -20
- data/hobo_files/plugin/lib/hobo/enum_string.rb +1 -1
- data/hobo_files/plugin/lib/hobo/field_declaration_dsl.rb +7 -0
- data/hobo_files/plugin/lib/hobo/guest.rb +4 -0
- data/hobo_files/plugin/lib/hobo/hobo_helper.rb +37 -9
- data/hobo_files/plugin/lib/hobo/model.rb +79 -17
- data/hobo_files/plugin/lib/hobo/model_controller.rb +59 -60
- data/hobo_files/plugin/lib/hobo/model_router.rb +16 -4
- data/hobo_files/plugin/lib/hobo/rapid_helper.rb +2 -1
- data/hobo_files/plugin/lib/hobo/user.rb +10 -7
- data/hobo_files/plugin/lib/hobo/user_controller.rb +6 -6
- data/hobo_files/plugin/{tags → taglibs}/core.dryml +5 -4
- data/hobo_files/plugin/{tags → taglibs}/rapid.dryml +54 -7
- data/hobo_files/plugin/{tags → taglibs}/rapid_document_tags.dryml +0 -0
- data/hobo_files/plugin/{tags → taglibs}/rapid_editing.dryml +4 -2
- data/hobo_files/plugin/{tags → taglibs}/rapid_forms.dryml +1 -4
- data/hobo_files/plugin/{tags → taglibs}/rapid_navigation.dryml +1 -2
- data/hobo_files/plugin/taglibs/rapid_pages.dryml +411 -0
- data/hobo_files/plugin/{tags → taglibs}/rapid_plus.dryml +0 -0
- data/hobo_files/plugin/{tags → taglibs}/rapid_support.dryml +9 -6
- data/hobo_files/plugin/tasks/fix_dryml.rake +0 -1
- metadata +16 -14
- data/hobo_files/plugin/generators/hobo_rapid/templates/themes/clean/public/stylesheets/rapid_ui.css +0 -167
- data/hobo_files/plugin/lib/hobo/plugins.rb +0 -75
- data/hobo_files/plugin/tags/rapid_pages.dryml +0 -341
@@ -16,6 +16,7 @@ var Hobo = {
|
|
16
16
|
searchRequest: null,
|
17
17
|
uidCounter: 0,
|
18
18
|
ipeOldValues: {},
|
19
|
+
spinnerMinTime: 1000, // milliseconds
|
19
20
|
|
20
21
|
uid: function() {
|
21
22
|
Hobo.uidCounter += 1
|
@@ -103,7 +104,7 @@ var Hobo = {
|
|
103
104
|
params.push(Form.serialize(form))
|
104
105
|
}
|
105
106
|
|
106
|
-
Hobo.showSpinner(message)
|
107
|
+
Hobo.showSpinner(message, options.spinnerNextTo)
|
107
108
|
var complete = function() {
|
108
109
|
if (form && options.resetForm) form.reset();
|
109
110
|
Hobo.hideSpinner();
|
@@ -378,14 +379,30 @@ var Hobo = {
|
|
378
379
|
},
|
379
380
|
|
380
381
|
|
381
|
-
showSpinner: function(message) {
|
382
|
+
showSpinner: function(message, nextTo) {
|
383
|
+
clearTimeout(Hobo.spinnerTimer)
|
384
|
+
Hobo.spinnerHideAt = new Date().getTime() + Hobo.spinnerMinTime;
|
382
385
|
if(t = $('ajax-progress-text')) Element.update(t, message);
|
383
|
-
if(e = $('ajax-progress'))
|
386
|
+
if(e = $('ajax-progress')) {
|
387
|
+
if (nextTo) {
|
388
|
+
var pos = nextTo.cumulativeOffset()
|
389
|
+
e.style.top = pos.top + "px"
|
390
|
+
e.style.left = (pos.left + nextTo.offsetWidth) + "px"
|
391
|
+
}
|
392
|
+
e.style.display = "block";
|
393
|
+
}
|
384
394
|
},
|
385
395
|
|
386
396
|
|
387
397
|
hideSpinner: function() {
|
388
|
-
if(e = $('ajax-progress'))
|
398
|
+
if (e = $('ajax-progress')) {
|
399
|
+
var remainingTime = Hobo.spinnerHideAt - new Date().getTime()
|
400
|
+
if (remainingTime <= 0) {
|
401
|
+
e.visualEffect('Fade')
|
402
|
+
} else {
|
403
|
+
Hobo.spinnerTimer = setTimeout(function () { e.visualEffect('Fade') }, remainingTime)
|
404
|
+
}
|
405
|
+
}
|
389
406
|
},
|
390
407
|
|
391
408
|
|
Binary file
|
Binary file
|
@@ -1,45 +1,173 @@
|
|
1
1
|
html {background: #666;}
|
2
2
|
body {
|
3
|
-
width:
|
4
|
-
font:
|
5
|
-
line-height:
|
3
|
+
width: 800px; margin: 0 auto; background: white; color: #222;
|
4
|
+
font: 12px "Lucida Grande", Arial, sans-serif;
|
5
|
+
line-height: 18px; padding-bottom: 10px; margin-bottom: 20px;
|
6
6
|
}
|
7
7
|
h1, h2, h3 {font-family: "Rockwell", "Trebuchet MS", "Arial", sans-serif;}
|
8
|
-
h1 {line-height:
|
9
|
-
h2 {line-height:
|
10
|
-
h3 {line-height:
|
8
|
+
h1 {font-size: 32px; line-height: 32px; margin: 20px 0 10px;}
|
9
|
+
h2 {font-size: 24px; line-height: 24px; margin: 15px 0 10px;}
|
10
|
+
h3 {font-size: 18px; line-height: 18px; margin: 10px 0 5px;}
|
11
|
+
h4 {font-size: 14px; line-height: 14px; margin: 10px 0 5px;}
|
12
|
+
h5 {font-size: 12px; line-height: 12px; margin: 10px 0 5px;}
|
13
|
+
h6 {font-size: 10px; line-height: 10px; margin: 10px 0 5px;}
|
14
|
+
|
15
|
+
li {margin-left: 20px;}
|
11
16
|
|
12
17
|
a {
|
13
|
-
text-decoration: none; color:
|
14
|
-
border-bottom: 1px dotted #
|
18
|
+
text-decoration: none; color: #222;
|
19
|
+
border-bottom: 1px dotted #ccc;
|
20
|
+
background: #f8f8f8;
|
21
|
+
}
|
22
|
+
a:hover {
|
23
|
+
border-bottom: 1px dotted #aaa; background: #f0f0f0; color: black;
|
24
|
+
}
|
25
|
+
h1 a, h2 a, h3 a {background: none; border: none;}
|
26
|
+
|
27
|
+
/*input.text, input.string, input.email_address, input.password, textarea {
|
28
|
+
border: 2px solid #444; padding: 1px;
|
29
|
+
}*/
|
30
|
+
input.text, input.string, input.email_address, input.password, input.search, textarea {
|
31
|
+
font-size:1.1em;
|
32
|
+
line-height:1.3em;
|
33
|
+
border-top:1px solid #7c7c7c;
|
34
|
+
border-left:1px solid #c3c3c3;
|
35
|
+
border-right:1px solid #c3c3c3;
|
36
|
+
border-bottom:1px solid #ddd;
|
37
|
+
background: #fff url(../images/fieldbg.gif) repeat-x top;
|
38
|
+
}
|
39
|
+
|
40
|
+
input.file_upload {
|
41
|
+
border: 1px dotted #666;
|
42
|
+
}
|
43
|
+
|
44
|
+
.button {
|
45
|
+
padding: 6px 10px;
|
46
|
+
/* color: white; background: black; border: 1px solid #666;*/
|
47
|
+
font: bold 11px "Lucida Grande", Arial, sans-serif;
|
48
|
+
border-top:1px solid #ddd;
|
49
|
+
border-left:1px solid #c3c3c3;
|
50
|
+
border-right:1px solid #c3c3c3;
|
51
|
+
border-bottom:1px solid #8c8c8c;
|
52
|
+
background: #eee;
|
53
|
+
}
|
54
|
+
.button:hover {cursor: pointer;}
|
55
|
+
.button:active {border-top:1px solid #8c8c8c; border-bottom:1px solid #ddd;}
|
56
|
+
.actions {font-size: 11px;}
|
57
|
+
|
58
|
+
|
59
|
+
#ajax-progress {
|
60
|
+
background: black url(../images/spinner.gif) no-repeat 10px 8px;
|
61
|
+
border: 1px solid #444;
|
62
|
+
padding: 8px 20px 8px 40px;
|
63
|
+
color: #cfc; font-weight: bold; font-size: 13px; text-shadow: black 2px 2px 2px;
|
64
|
+
}
|
65
|
+
#search-results-panel {
|
66
|
+
position: absolute; top: 35px; right: 25px; width: 350px; height: 500px; overflow: auto; z-index: 50;
|
67
|
+
padding: 0 20px 20px; background: #f2f2f2; border: 1px solid #ddd; color: black;
|
68
|
+
}
|
69
|
+
#search-results-panel .card.linkable a {
|
70
|
+
/* background: #333; border-color: #444;*/ color: black;
|
15
71
|
}
|
16
|
-
a:hover {border-bottom: 1px dotted #222;}
|
17
72
|
|
18
|
-
.
|
73
|
+
.content-header, .content-body, .content-footer {margin: 10px 60px; padding: 0 0 10px;}
|
74
|
+
.flash {margin-left: 60px; margin-right: 60px; text-shadow: #728852 2px 2px 0;}
|
19
75
|
.article { margin: 20px 0; border-top: 1px dotted #ccc;}
|
20
76
|
|
21
77
|
/***********/
|
22
78
|
|
23
|
-
.
|
24
|
-
.
|
25
|
-
.
|
26
|
-
.
|
27
|
-
.
|
28
|
-
|
29
|
-
.
|
30
|
-
|
79
|
+
.page-header {color: white; background: black; padding: 20px 0 0; position: relative;}
|
80
|
+
.page-header h1 {margin: 0; padding: 0 40px 30px; font-family: "Trebuchet MS", Tahoma, Arial, sans-serif; font-size: 48px; letter-spacing: -2.5pt;}
|
81
|
+
.page-header .nav {margin: 0 30px; overflow: hidden; height: 100%;}
|
82
|
+
.page-header .nav li {float: left; list-style: none; margin-left: 0;}
|
83
|
+
.page-header a {color: white; border: none; background: none;}
|
84
|
+
|
85
|
+
.page-header div.search {
|
86
|
+
position: absolute; top: 0; right: 25px; padding: 6px 30px 8px 15px;
|
87
|
+
background: #282828; border: 1px solid #313131; border-width: 0 1px 1px;
|
31
88
|
}
|
32
|
-
.
|
33
|
-
|
34
|
-
|
89
|
+
.page-header div.search label {
|
90
|
+
padding-right: 10px;
|
91
|
+
text-transform: uppercase; font: bold 9px Arial, sans-serif; letter-spacing: 1.0pt;
|
35
92
|
}
|
36
|
-
.
|
93
|
+
.page-header div.search input {
|
94
|
+
font-size: 10px;
|
95
|
+
}
|
96
|
+
#search-spinner {position: absolute; top: 6px; right: 7px;}
|
37
97
|
|
38
|
-
|
98
|
+
.account-nav {
|
99
|
+
position: absolute; top: 38px; right: 40px;
|
100
|
+
/* font: normal 12px Arial, sans-serif;*/
|
101
|
+
font-size: 11px;
|
102
|
+
}
|
103
|
+
|
104
|
+
ul.main-nav {float: left; margin: 0 10px;}
|
105
|
+
.main-nav li {background: black; margin-right: 10px;}
|
106
|
+
.main-nav a {
|
107
|
+
background: #282828;
|
108
|
+
display: block; padding: 7px 15px; border: 1px solid #313131; border-width: 1px 1px 0;
|
109
|
+
font: bold 16px "Myriad Pro", Arial, sans-serif; text-shadow: black 2px 2px 2px;
|
110
|
+
}
|
111
|
+
.main-nav a:hover {background: #444; border: 1px solid #555; border-width: 1px 1px 0;}
|
112
|
+
.account-nav li {padding-left: 20px;}
|
113
|
+
.account-nav a {border-bottom: 1px solid black; font-weight: bold;}
|
114
|
+
.account-nav a:hover {border-bottom: 1px dotted #ddd;}
|
115
|
+
|
116
|
+
|
117
|
+
.page-content {padding-top: 10px;}
|
118
|
+
|
119
|
+
.login-page, .signup-page {width: 50%; margin-top: 40px;}
|
120
|
+
.login-page .field-list, .signup-page .field-list {width: 300px;}
|
121
|
+
.login-page .field-list td, .signup-page .field-list td {width: auto;}
|
122
|
+
.login-page .field-list th, .signup-page .field-list th {width: 120px;}
|
123
|
+
.login-page .submit-button, .signup-page .submit-button {margin: 10px 130px;}
|
124
|
+
|
125
|
+
.edit-page .delete-button {margin-top: 25px;}
|
126
|
+
|
127
|
+
.show-page .content-header {position: relative; border-bottom: 1px dotted #ddd;}
|
128
|
+
.show-page .content-header h1, .new-in-collection-page .content-header h1 {margin-bottom: 4px; margin-right: 70px;}
|
129
|
+
.show-page .content-header a.edit {position: absolute; top: 0; right: 0;}
|
130
|
+
|
131
|
+
.new-in-collection-page .content-header h2 {margin-top: 6px; font: bold 16px "Lucida Grande", Arial, sans-serif;}
|
132
|
+
.new-in-collection-page .content-header h2, .new-in-collection-page .content-header h2 a {color: #222;}
|
133
|
+
|
134
|
+
.show-page .create-new {
|
135
|
+
padding: 0 30px;
|
136
|
+
border-top: 1px dotted #ddd; margin-top: 20px; background: #f5f5f5;
|
137
|
+
}
|
138
|
+
.show-page .create-new form .submit-button {margin: 20px 155px;}
|
139
|
+
|
140
|
+
.card {
|
141
|
+
background: #f5f5f5;
|
142
|
+
border: 1px solid #e8e8e8;
|
143
|
+
padding:10px 20px;
|
144
|
+
margin-bottom: 5px;
|
145
|
+
}
|
146
|
+
.card .creation-details {
|
147
|
+
font-size: 11px; color: #333; display: block;
|
148
|
+
}
|
149
|
+
.card .datetime {color: #666;}
|
150
|
+
|
151
|
+
.card.content {
|
152
|
+
font-size: 11px;
|
153
|
+
border: none; background: none; padding: 0; margin: 10px 0;
|
154
|
+
}
|
155
|
+
|
156
|
+
.new-links {margin-top: 20px;}
|
157
|
+
.new-links ul li {list-style: none; margin-left: 0;}
|
158
|
+
|
159
|
+
.dependent-collection ul li {
|
160
|
+
list-style: none; margin-left: 0;
|
161
|
+
}
|
162
|
+
|
163
|
+
/*******************************************************/
|
164
|
+
/* these styles are for the generated front index page */
|
165
|
+
/* you can delete them if you over-ride it */
|
39
166
|
|
40
|
-
.
|
41
|
-
background: #eee; color: #222; padding: 10px 20px;
|
167
|
+
.front-page .welcome-message {
|
168
|
+
background: #eee; color: #222; border: 1px solid #e8e8e8; padding: 10px 20px 20px;
|
42
169
|
}
|
43
|
-
.
|
170
|
+
.front-page .welcome-message h2 {
|
44
171
|
font-size: 18px; line-height: 27px;
|
45
172
|
}
|
173
|
+
.front-page .content-body li {list-style: none; margin-left: 0;}
|
data/hobo_files/plugin/generators/hobo_rapid/templates/themes/clean/public/stylesheets/rapid-ui.css
ADDED
@@ -0,0 +1,144 @@
|
|
1
|
+
.hidden {display: none;}
|
2
|
+
|
3
|
+
.flash {
|
4
|
+
background: #92ab6e;
|
5
|
+
padding: 10px 30px; margin-top: 5px;
|
6
|
+
border: 1px solid #829862;
|
7
|
+
/* border-width: 2px 0;*/
|
8
|
+
color: white;
|
9
|
+
}
|
10
|
+
|
11
|
+
.in-place-textfield-bhv, .in-place-textarea-bhv, .in-place-html-textarea-bhv {
|
12
|
+
border: 1px dotted #666;
|
13
|
+
padding: 0 3px; padding-right: 20px;
|
14
|
+
background-image: url(../images/pencil.png);
|
15
|
+
background-position: top right;
|
16
|
+
background-repeat: no-repeat;
|
17
|
+
}
|
18
|
+
|
19
|
+
.inplaceeditor-form input, .inplaceeditor-form textarea,
|
20
|
+
table.new-record textarea, table.new-record input {
|
21
|
+
border: 1px dotted #666;
|
22
|
+
padding: 3px; width: 100%;
|
23
|
+
}
|
24
|
+
.inplaceeditor-form, .inplaceeditor-form input {
|
25
|
+
display: inline;
|
26
|
+
}
|
27
|
+
|
28
|
+
.edit-page .content-header {overflow: hidden; height: 100%;}
|
29
|
+
.edit-page .content-header h1 {float: left;}
|
30
|
+
.edit-page .content-header .delete-button {float: right;}
|
31
|
+
form .actions {margin: 30px 0;width: 100%; text-align: center;}
|
32
|
+
|
33
|
+
/**** Admin ****/
|
34
|
+
|
35
|
+
.admin-banner {
|
36
|
+
background: #9d0018; border-top: 2px solid #7a0013; border-bottom: 2px solid #7a0013;
|
37
|
+
padding: 2px 0;
|
38
|
+
margin: 10px 0;
|
39
|
+
}
|
40
|
+
.admin-banner p, .admin-banner span {
|
41
|
+
font: 12px "Lucida Grande", Arial, sans-serif;
|
42
|
+
}
|
43
|
+
.admin-banner p, .admin-banner div {margin-bottom: 0;}
|
44
|
+
.admin-banner a {color: white; text-decoration: none; padding: 1px 5px; font-weight: bold;}
|
45
|
+
.admin-banner a:hover {color: #9d0018; background: white;}
|
46
|
+
.admin-banner .logged-in {
|
47
|
+
float: right;
|
48
|
+
}
|
49
|
+
|
50
|
+
/* rails error message */
|
51
|
+
.error-messages {
|
52
|
+
font-family: "Lucida Grande", arial, sans-serif;
|
53
|
+
background: #9d0018;
|
54
|
+
border: 1px solid #7a0013;
|
55
|
+
padding: 15px 30px;
|
56
|
+
color: white;
|
57
|
+
margin-bottom: 20px;
|
58
|
+
}
|
59
|
+
.error-messages h2 {
|
60
|
+
text-transform: none;
|
61
|
+
letter-spacing: normal;
|
62
|
+
color: white;
|
63
|
+
margin-bottom: 10px;
|
64
|
+
}
|
65
|
+
.error-messages li {
|
66
|
+
margin-left: 20px;
|
67
|
+
}
|
68
|
+
|
69
|
+
/********* everything below here came from hobo_rapid.css, needs looking at ********/
|
70
|
+
|
71
|
+
/**** Default styling for Rapid ***/
|
72
|
+
|
73
|
+
#ajax-progress {
|
74
|
+
float: right; margin: 20px;
|
75
|
+
position: fixed; display: none; z-index: 10;
|
76
|
+
}
|
77
|
+
/*
|
78
|
+
#ajax-progress {
|
79
|
+
color: grey;
|
80
|
+
float: right;
|
81
|
+
margin: 20px;
|
82
|
+
position: fixed;
|
83
|
+
background: white;
|
84
|
+
font-family: Tahoma "sans serif";
|
85
|
+
display: none;
|
86
|
+
z-index: 10;
|
87
|
+
}
|
88
|
+
|
89
|
+
#ajax-progress div {
|
90
|
+
border: 1px dashed grey;
|
91
|
+
margin: 10px;
|
92
|
+
padding: 3px;
|
93
|
+
padding-top: -15px;
|
94
|
+
}
|
95
|
+
|
96
|
+
#ajax-progress img {
|
97
|
+
padding-left: 6px;
|
98
|
+
vertical-align: middle;
|
99
|
+
}
|
100
|
+
*/
|
101
|
+
|
102
|
+
/* Scriptaculous Autocompleter ---*/
|
103
|
+
|
104
|
+
div.completions-popup {
|
105
|
+
position:absolute;
|
106
|
+
width:250px;
|
107
|
+
background-color:white;
|
108
|
+
border:1px solid #888;
|
109
|
+
margin:0px;
|
110
|
+
padding:0px;
|
111
|
+
}
|
112
|
+
div.completions-popup ul {
|
113
|
+
list-style-type:none;
|
114
|
+
margin:0px;
|
115
|
+
padding:0px;
|
116
|
+
}
|
117
|
+
div.completions-popup ul li.selected { background-color: #ffb;}
|
118
|
+
div.completions-popup ul li {
|
119
|
+
list-style-type:none;
|
120
|
+
display:block;
|
121
|
+
margin:0;
|
122
|
+
padding:2px;
|
123
|
+
cursor:pointer;
|
124
|
+
}
|
125
|
+
|
126
|
+
|
127
|
+
.field-list {width:100%;}
|
128
|
+
.field-list td {vertical-align: middle; width: 75%;}
|
129
|
+
.field-list th {font-weight: bold;}
|
130
|
+
.field-list th, .field-list td {padding: 5px 0;}
|
131
|
+
.field-list th {padding-right: 10px;}
|
132
|
+
|
133
|
+
.field-list td.field-label {
|
134
|
+
text-align: left; width: 1px; white-space: nowrap; vertical-align: top;
|
135
|
+
padding-top: 10px; padding-bottom: 10px;
|
136
|
+
}
|
137
|
+
.field-list textarea, .field-list input.string, .field-list input.password { width: 100%; margin: 0; }
|
138
|
+
|
139
|
+
/*input[type=text].wide { width: 100%; }*/
|
140
|
+
textarea { height: 170px; }
|
141
|
+
textarea.wide { width: 100%; }
|
142
|
+
textarea.tall { height: 350px; }
|
143
|
+
|
144
|
+
.field-list input.percentage {width: 25px; display: inline; margin-right: 5px; padding: 1px 3px;}
|
@@ -3,32 +3,29 @@ class <%= class_name %> < ActiveRecord::Base
|
|
3
3
|
hobo_user_model
|
4
4
|
|
5
5
|
fields do
|
6
|
-
username :string
|
6
|
+
username :string, :login => true, :name => true
|
7
|
+
administrator :boolean
|
7
8
|
timestamps
|
8
9
|
end
|
9
10
|
|
10
|
-
|
11
|
+
set_admin_on_first_user
|
11
12
|
|
12
|
-
alias_attribute :to_s, :username
|
13
|
-
|
14
13
|
# --- Hobo Permissions --- #
|
15
14
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
# login == 'admin'
|
20
|
-
end
|
15
|
+
# It is possible to override the permission system entirely by
|
16
|
+
# returning true from super_user?
|
17
|
+
# def super_user?; true; end
|
21
18
|
|
22
19
|
def creatable_by?(creator)
|
23
20
|
true
|
24
21
|
end
|
25
22
|
|
26
23
|
def updatable_by?(updater, new)
|
27
|
-
|
24
|
+
updater.administrator?
|
28
25
|
end
|
29
26
|
|
30
27
|
def deletable_by?(deleter)
|
31
|
-
|
28
|
+
deleter.administrator?
|
32
29
|
end
|
33
30
|
|
34
31
|
def viewable_by?(viewer, field)
|