hobo 1.3.0.pre19 → 1.3.0.pre20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/CHANGES.txt +282 -234
  2. data/VERSION +1 -1
  3. data/lib/generators/hobo/admin_subsite/templates/controller.rb.erb +5 -5
  4. data/lib/generators/hobo/assets/templates/dryml-support.js +2 -2
  5. data/lib/generators/hobo/i18n/templates/hobo.it.yml +1 -1
  6. data/lib/generators/hobo/rapid/templates/hobo-rapid.js +64 -64
  7. data/lib/generators/hobo/rapid/templates/ie7-recalc.js +21 -21
  8. data/lib/generators/hobo/rapid/templates/lowpro.js +31 -31
  9. data/lib/generators/hobo/rapid/templates/reset.css +1 -1
  10. data/lib/generators/hobo/rapid/templates/themes/clean/public/stylesheets/clean.css +15 -15
  11. data/lib/generators/hobo/rapid/templates/themes/clean/public/stylesheets/rapid-ui.css +3 -3
  12. data/lib/generators/hobo/rapid/templates/themes/clean/views/clean.dryml +1 -1
  13. data/lib/generators/hobo/setup_wizard/setup_wizard_generator.rb +15 -14
  14. data/lib/generators/hobo/subsite/templates/controller.rb.erb +1 -1
  15. data/lib/generators/hobo/user_controller/templates/controller.rb.erb +2 -2
  16. data/lib/hobo.rb +1 -0
  17. data/lib/hobo/controller.rb +6 -6
  18. data/lib/hobo/controller/authentication_support.rb +1 -1
  19. data/lib/hobo/controller/model.rb +10 -10
  20. data/lib/hobo/controller/user.rb +6 -6
  21. data/lib/hobo/engine.rb +6 -0
  22. data/lib/hobo/extensions/action_view/translation_helper.rb +20 -0
  23. data/lib/hobo/extensions/active_model/translation.rb +1 -1
  24. data/lib/hobo/extensions/i18n.rb +16 -0
  25. data/lib/hobo/helper.rb +2 -2
  26. data/lib/hobo/helper/translations.rb +61 -80
  27. data/lib/hobo/model/lifecycles/lifecycle.rb +5 -1
  28. data/lib/hobo/model/lifecycles/transition.rb +1 -0
  29. data/lib/hobo/rapid/generators/rapid/cards.dryml.erb +2 -2
  30. data/lib/hobo/rapid/generators/rapid/forms.dryml.erb +2 -2
  31. data/lib/hobo/rapid/generators/rapid/pages.dryml.erb +7 -7
  32. data/lib/hobo/rapid/taglibs/rapid.dryml +1 -1
  33. data/lib/hobo/rapid/taglibs/rapid_core.dryml +8 -8
  34. data/lib/hobo/rapid/taglibs/rapid_document_tags.dryml +2 -2
  35. data/lib/hobo/rapid/taglibs/rapid_forms.dryml +9 -9
  36. data/lib/hobo/rapid/taglibs/rapid_generics.dryml +1 -1
  37. data/lib/hobo/rapid/taglibs/rapid_i18n.dryml +0 -17
  38. data/lib/hobo/rapid/taglibs/rapid_lifecycles.dryml +5 -5
  39. data/lib/hobo/rapid/taglibs/rapid_navigation.dryml +1 -1
  40. data/lib/hobo/rapid/taglibs/rapid_plus.dryml +6 -6
  41. data/lib/hobo/rapid/taglibs/rapid_user_pages.dryml +8 -8
  42. data/test/permissions/test_permissions.rb +103 -103
  43. metadata +15 -14
  44. data/lib/hobo/rapid/taglibs/rapid_translations.dryml +0 -36
@@ -5,24 +5,24 @@
5
5
 
6
6
  (function() {
7
7
  /* ---------------------------------------------------------------------
8
-
8
+
9
9
  This allows refreshing of IE7 style rules. If you modify the DOM
10
10
  you can update IE7 by calling document.recalc().
11
-
11
+
12
12
  This should be the LAST module included.
13
-
13
+
14
14
  --------------------------------------------------------------------- */
15
-
15
+
16
16
  if (!IE7.loaded) return;
17
-
17
+
18
18
  // remove all IE7 classes from an element
19
19
  CLASSES = /\sie7_class\d+/g;
20
-
20
+
21
21
  IE7.CSS.extend({
22
22
  // store for elements that have style properties calculated
23
23
  elements: {},
24
24
  handlers: [],
25
-
25
+
26
26
  // clear IE7 classes and styles
27
27
  reset: function() {
28
28
  this.removeEventHandlers();
@@ -37,7 +37,7 @@
37
37
  }
38
38
  IE7.Rule.elements = {};
39
39
  },
40
-
40
+
41
41
  reload: function() {
42
42
  this.rules = [];
43
43
  this.getInlineStyles();
@@ -46,7 +46,7 @@
46
46
  this.refresh();
47
47
  this.trash();
48
48
  },
49
-
49
+
50
50
  addRecalc: function(propertyName, test, handler, replacement) {
51
51
  // call the ancestor method to add a wrapped recalc method
52
52
  this.base(propertyName, test, function(element) {
@@ -56,27 +56,27 @@
56
56
  IE7.CSS.elements[element.uniqueID] = element;
57
57
  }, replacement);
58
58
  },
59
-
59
+
60
60
  recalc: function() {
61
61
  // clear IE7 styles and classes
62
62
  this.reset();
63
63
  // execute the ancestor method to perform recalculations
64
64
  this.base();
65
65
  },
66
-
66
+
67
67
  addEventHandler: function(element, type, handler) {
68
68
  element.attachEvent(type, handler);
69
69
  // store the handler so it can be detached later
70
70
  this.handlers.push(arguments);
71
71
  },
72
-
72
+
73
73
  removeEventHandlers: function() {
74
74
  var handler;
75
75
  while (handler = this.handlers.pop()) {
76
76
  handler[0].detachEvent(handler[1], handler[2]);
77
77
  }
78
78
  },
79
-
79
+
80
80
  getInlineStyles: function() {
81
81
  // load inline styles
82
82
  var styleSheets = document.getElementsByTagName("style"), styleSheet;
@@ -88,7 +88,7 @@
88
88
  }
89
89
  }
90
90
  },
91
-
91
+
92
92
  trash: function() {
93
93
  // trash the old style sheets
94
94
  var styleSheets = document.styleSheets, styleSheet, i;
@@ -100,17 +100,17 @@
100
100
  }
101
101
  this.base();
102
102
  },
103
-
103
+
104
104
  getText: function(styleSheet) {
105
105
  return styleSheet.cssText || this.base(styleSheet);
106
106
  }
107
107
  });
108
-
108
+
109
109
  // remove event handlers (they eat memory)
110
110
  IE7.CSS.addEventHandler(window, "onunload", function() {
111
111
  IE7.CSS.removeEventHandlers();
112
112
  });
113
-
113
+
114
114
  // store all elements with an IE7 class assigned
115
115
  IE7.Rule.elements = {};
116
116
 
@@ -126,7 +126,7 @@
126
126
  // store created pseudo elements
127
127
  if (IE7.PseudoElement) {
128
128
  IE7.PseudoElement.hash = {};
129
-
129
+
130
130
  IE7.PseudoElement.prototype.extend({
131
131
  create: function(target) {
132
132
  var key = this.selector + ":" + target.uniqueID;
@@ -137,10 +137,10 @@
137
137
  }
138
138
  });
139
139
  }
140
-
140
+
141
141
  IE7.HTML.extend({
142
142
  elements: {},
143
-
143
+
144
144
  addRecalc: function(selector, handler) {
145
145
  // call the ancestor method to add a wrapped recalc method
146
146
  this.base(selector, function(element) {
@@ -154,7 +154,7 @@
154
154
  });
155
155
  }
156
156
  });
157
-
157
+
158
158
  // allow refreshing of IE7 fixes
159
159
  document.recalc = function(reload) {
160
160
  if (IE7.CSS.screen) {
@@ -3,10 +3,10 @@ LowPro.Version = '0.5';
3
3
  LowPro.CompatibleWithPrototype = '1.6';
4
4
 
5
5
  if (Prototype.Version.indexOf(LowPro.CompatibleWithPrototype) != 0 && window.console && window.console.warn)
6
- console.warn("This version of Low Pro is tested with Prototype " + LowPro.CompatibleWithPrototype +
6
+ console.warn("This version of Low Pro is tested with Prototype " + LowPro.CompatibleWithPrototype +
7
7
  " it may not work as expected with this version (" + Prototype.Version + ")");
8
8
 
9
- if (!Element.addMethods)
9
+ if (!Element.addMethods)
10
10
  Element.addMethods = function(o) { Object.extend(Element.Methods, o) };
11
11
 
12
12
  // Simple utility methods for working with the DOM
@@ -32,9 +32,9 @@ DOM.Builder = {
32
32
  create : function(tag, attrs, children) {
33
33
  attrs = attrs || {}; children = children || []; tag = tag.toLowerCase();
34
34
  var el = new Element(tag, attrs);
35
-
35
+
36
36
  for (var i=0; i<children.length; i++) {
37
- if (typeof children[i] == 'string')
37
+ if (typeof children[i] == 'string')
38
38
  children[i] = document.createTextNode(children[i]);
39
39
  el.appendChild(children[i]);
40
40
  }
@@ -43,14 +43,14 @@ DOM.Builder = {
43
43
  };
44
44
 
45
45
  // Automatically create node builders as $tagName.
46
- (function() {
47
- var els = ("p|div|span|strong|em|img|table|tr|td|th|thead|tbody|tfoot|pre|code|" +
48
- "h1|h2|h3|h4|h5|h6|ul|ol|li|form|input|textarea|legend|fieldset|" +
46
+ (function() {
47
+ var els = ("p|div|span|strong|em|img|table|tr|td|th|thead|tbody|tfoot|pre|code|" +
48
+ "h1|h2|h3|h4|h5|h6|ul|ol|li|form|input|textarea|legend|fieldset|" +
49
49
  "select|option|blockquote|cite|br|hr|dd|dl|dt|address|a|button|abbr|acronym|" +
50
- "script|link|style|bdo|ins|del|object|param|col|colgroup|optgroup|caption|" +
50
+ "script|link|style|bdo|ins|del|object|param|col|colgroup|optgroup|caption|" +
51
51
  "label|dfn|kbd|samp|var").split("|");
52
52
  var el, i=0;
53
- while (el = els[i++])
53
+ while (el = els[i++])
54
54
  window['$' + el] = DOM.Builder.tagFunc(el);
55
55
  })();
56
56
 
@@ -92,21 +92,21 @@ Object.extend(Event, {
92
92
  Event.addBehavior = function(rules) {
93
93
  var ab = this.addBehavior;
94
94
  Object.extend(ab.rules, rules);
95
-
95
+
96
96
  if (!ab.responderApplied) {
97
97
  Ajax.Responders.register({
98
- onComplete : function() {
99
- if (Event.addBehavior.reassignAfterAjax)
98
+ onComplete : function() {
99
+ if (Event.addBehavior.reassignAfterAjax)
100
100
  setTimeout(function() { ab.reload() }, 10);
101
101
  }
102
102
  });
103
103
  ab.responderApplied = true;
104
104
  }
105
-
105
+
106
106
  if (ab.autoTrigger) {
107
107
  this.onReady(ab.load.bind(ab, rules));
108
108
  }
109
-
109
+
110
110
  };
111
111
 
112
112
  Event.delegate = function(rules) {
@@ -121,7 +121,7 @@ Object.extend(Event.addBehavior, {
121
121
  rules : {}, cache : [],
122
122
  reassignAfterAjax : false,
123
123
  autoTrigger : true,
124
-
124
+
125
125
  load : function(rules) {
126
126
  for (var selector in rules) {
127
127
  var observer = rules[selector];
@@ -136,7 +136,7 @@ Object.extend(Event.addBehavior, {
136
136
  } else {
137
137
  if (!element.$$assigned || !element.$$assigned.include(observer)) {
138
138
  if (observer.attach) observer.attach(element);
139
-
139
+
140
140
  else observer.call($(element));
141
141
  element.$$assigned = element.$$assigned || [];
142
142
  element.$$assigned.push(observer);
@@ -146,26 +146,26 @@ Object.extend(Event.addBehavior, {
146
146
  });
147
147
  }
148
148
  },
149
-
149
+
150
150
  unload : function() {
151
151
  this.cache.each(function(c) {
152
152
  Event.stopObserving.apply(Event, c);
153
153
  });
154
154
  this.cache = [];
155
155
  },
156
-
156
+
157
157
  reload: function() {
158
158
  var ab = Event.addBehavior;
159
- ab.unload();
159
+ ab.unload();
160
160
  ab.load(ab.rules);
161
161
  },
162
-
162
+
163
163
  _wrapObserver: function(observer) {
164
164
  return function(event) {
165
- if (observer.call(this, event) === false) event.stop();
165
+ if (observer.call(this, event) === false) event.stop();
166
166
  }
167
167
  }
168
-
168
+
169
169
  });
170
170
 
171
171
  Event.observe(window, 'unload', Event.addBehavior.unload.bind(Event.addBehavior));
@@ -177,15 +177,15 @@ $$$ = Event.addBehavior.bind(Event);
177
177
  // and their behavior. Use Behavior.create() to make a new behavior class then use attach() to
178
178
  // glue it to an element. Each element then gets it's own instance of the behavior and any
179
179
  // methods called onxxx are bound to the relevent event.
180
- //
180
+ //
181
181
  // Usage:
182
- //
182
+ //
183
183
  // var MyBehavior = Behavior.create({
184
- // onmouseover : function() { this.element.addClassName('bong') }
184
+ // onmouseover : function() { this.element.addClassName('bong') }
185
185
  // });
186
186
  //
187
187
  // Event.addBehavior({ 'a.rollover' : MyBehavior });
188
- //
188
+ //
189
189
  // If you need to pass additional values to initialize use:
190
190
  //
191
191
  // Event.addBehavior({ 'a.rollover' : MyBehavior(10, { thing : 15 }) })
@@ -205,7 +205,7 @@ var Behavior = {
205
205
  if (Object.isFunction(properties[0]))
206
206
  parent = properties.shift();
207
207
 
208
- var behavior = function() {
208
+ var behavior = function() {
209
209
  if (!this.initialize) {
210
210
  var args = $A(arguments);
211
211
 
@@ -214,7 +214,7 @@ var Behavior = {
214
214
  behavior.attach.apply(behavior, initArgs);
215
215
  };
216
216
  } else {
217
- var args = (arguments.length == 2 && arguments[1] instanceof Array) ?
217
+ var args = (arguments.length == 2 && arguments[1] instanceof Array) ?
218
218
  arguments[1] : Array.prototype.slice.call(arguments, 1);
219
219
 
220
220
  this.element = $(arguments[0]);
@@ -275,7 +275,7 @@ Remote.Base = {
275
275
  this.options = Object.extend({
276
276
  evaluateScripts : true
277
277
  }, options || {});
278
-
278
+
279
279
  this._bindCallbacks();
280
280
  },
281
281
  _makeRequest : function(options) {
@@ -302,8 +302,8 @@ Remote.Link = Behavior.create(Remote.Base, {
302
302
  Remote.Form = Behavior.create(Remote.Base, {
303
303
  onclick : function(e) {
304
304
  var sourceElement = e.element();
305
-
306
- if (['input', 'button'].include(sourceElement.nodeName.toLowerCase()) &&
305
+
306
+ if (['input', 'button'].include(sourceElement.nodeName.toLowerCase()) &&
307
307
  sourceElement.type == 'submit')
308
308
  this._submitButton = sourceElement;
309
309
  },
@@ -28,7 +28,7 @@ code {
28
28
  font-weight: inherit;
29
29
  font-style: inherit;
30
30
  font-size: 100%;
31
- vertical-align: baseline;
31
+ vertical-align: baseline;
32
32
  }
33
33
 
34
34
  em {
@@ -28,7 +28,7 @@ html, body {color: #193440; background: url(../images/300-ACD3E6-fff.png) repeat
28
28
 
29
29
 
30
30
  body {
31
- width: 960px;
31
+ width: 960px;
32
32
  margin: 0 auto 20px;
33
33
  font: 12px "Lucida Grande", "Trebuchet MS", Arial, sans-serif; line-height: 18px;
34
34
  }
@@ -45,11 +45,11 @@ li {margin-left: 20px;}
45
45
  a {
46
46
  border-bottom: 1px dotted #ccc;
47
47
  color: #222; background: #fafafa;
48
- text-decoration: none;
48
+ text-decoration: none;
49
49
  }
50
50
  a:hover {
51
51
  border-bottom: 1px dotted #aaa;
52
- color: black; background: #f2f2f2;
52
+ color: black; background: #f2f2f2;
53
53
  }
54
54
  h1 a, h2 a, h3 a {border: none; background: none;}
55
55
 
@@ -116,30 +116,30 @@ form .actions input { margin: 0; }
116
116
  .field-list .input-help { color: #888;}
117
117
 
118
118
  .content-header, .content-body, .content-footer {margin: 0 45px 15px; padding: 0;}
119
- .content-header {padding: 5px 0;}
119
+ .content-header {padding: 5px 0;}
120
120
  .content-body {padding: 15px 0;}
121
121
  .content-footer {padding-bottom: 20px;}
122
122
 
123
123
  .page-header {margin-top: 25px; padding: 0 0 0;}
124
124
  .page-header h1 {
125
- margin: 0; padding: 20px 30px 30px;
125
+ margin: 0; padding: 20px 30px 30px;
126
126
  font-family: "Arial Black", Tahoma, Arial, sans-serif; font-size: 36px; letter-spacing: -1.5pt;
127
127
  }
128
128
  .page-header ul {zoom: 1; overflow: hidden;}
129
129
  .page-header li {float: left; margin-left: 0; list-style: none;}
130
130
 
131
- .page-header .navigation a,
131
+ .page-header .navigation a,
132
132
  .page-header .navigation a:hover,
133
- .page-header h1 a,
133
+ .page-header h1 a,
134
134
  .page-header h1 a:hover
135
135
  {border: none; color: white; background: none;}
136
136
 
137
137
  .page-header div.search {
138
138
  float: right;
139
- padding: 0 30px 8px 15px;
139
+ padding: 0 30px 8px 15px;
140
140
  }
141
141
  .page-header div.search label {
142
- padding-right: 10px;
142
+ padding-right: 10px;
143
143
  font: bold 9px Arial, sans-serif; text-transform: uppercase; letter-spacing: 1.0pt;
144
144
  }
145
145
  .page-header div.search input {
@@ -147,7 +147,7 @@ form .actions input { margin: 0; }
147
147
  }
148
148
  #search-results-panel {
149
149
  position: absolute; top: 35px; right: 25px; z-index: 50;
150
- width: 350px; height: 500px; overflow: auto;
150
+ width: 350px; height: 500px; overflow: auto;
151
151
  padding: 0 20px 20px; border: 1px solid #ddd;
152
152
  color: black; background: #f2f2f2;
153
153
  }
@@ -168,8 +168,8 @@ form .actions input { margin: 0; }
168
168
  font-size: 11px;
169
169
  }
170
170
  .account-nav li {
171
- float: left;
172
- margin-left: 0; padding-left: 20px;
171
+ float: left;
172
+ margin-left: 0; padding-left: 20px;
173
173
  color: #ddd;
174
174
  list-style: none;
175
175
  }
@@ -229,7 +229,7 @@ form .actions {margin: 30px 0; width: 100%; text-align: center;}
229
229
  .card h4 {margin-top: 0;}
230
230
  .card a {background: #f5f5f5;}
231
231
  .card .creation-details {
232
- display: block; color: #333; font-size: 11px;
232
+ display: block; color: #333; font-size: 11px;
233
233
  }
234
234
  .card .datetime {color: #666;}
235
235
  .card .actions { position:absolute; right: 10px; top: 10px; }
@@ -237,7 +237,7 @@ div.ordering-handle { float: left; background: #ccc; color: white; margin-right:
237
237
 
238
238
  .card.content.with-owner {
239
239
  padding: 0; margin: 10px 0 30px; border: none;
240
- background: none;
240
+ background: none;
241
241
  font-size: 11px;
242
242
  }
243
243
  .card.content .creation-details {
@@ -300,7 +300,7 @@ div.select-many .item .remove-item { float: right; }
300
300
  /* you can delete them if you over-ride it */
301
301
 
302
302
  .front-page .welcome-message {
303
- padding: 10px 20px 20px; border: 1px solid #e8e8e8;
303
+ padding: 10px 20px 20px; border: 1px solid #e8e8e8;
304
304
  color: #222;
305
305
  background: url(../images/50-ACD3E6-fff.png) repeat-x #fff;
306
306
  }
@@ -8,13 +8,13 @@
8
8
  background-repeat: no-repeat;
9
9
  }
10
10
 
11
- .inplaceeditor-form input, .inplaceeditor-form textarea,
11
+ .inplaceeditor-form input, .inplaceeditor-form textarea,
12
12
  table.new-record textarea, table.new-record input {
13
13
  border: 1px dotted #666;
14
14
  padding: 3px; width: 100%;
15
15
  }
16
16
  .inplaceeditor-form, .inplaceeditor-form input {
17
- display: inline;
17
+ display: inline;
18
18
  }
19
19
 
20
20
  /**** Admin ****/
@@ -99,4 +99,4 @@ optgroup.disabled-option {
99
99
  height: 1em;
100
100
  }
101
101
 
102
- input.nil-value { color:grey; }
102
+ input.nil-value { color:grey; }