spiderfw 0.6.25 → 0.6.26.pre1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/CHANGELOG +15 -0
  2. data/VERSION +1 -1
  3. data/apps/core/auth/controllers/login_controller.rb +2 -0
  4. data/apps/core/auth/controllers/mixins/auth_helper.rb +1 -1
  5. data/apps/core/auth/public/css/login.css +49 -0
  6. data/apps/core/auth/views/login.layout.shtml +14 -0
  7. data/apps/core/auth/views/login.shtml +1 -0
  8. data/apps/core/components/public/js/jquery/plugins/jquery.ui.nestedSortable.js +356 -0
  9. data/apps/core/forms/public/date_time.js +1 -1
  10. data/apps/core/forms/public/select.js +1 -1
  11. data/apps/core/forms/tags/element_row.erb +2 -2
  12. data/apps/core/forms/widgets/form/form.rb +34 -22
  13. data/apps/messenger/_init.rb +1 -0
  14. data/apps/messenger/views/admin/index.shtml +1 -1
  15. data/apps/messenger/views/index.shtml +1 -1
  16. data/blueprints/.DS_Store +0 -0
  17. data/blueprints/home/.DS_Store +0 -0
  18. data/blueprints/install/.DS_Store +0 -0
  19. data/data/keys/spider.rsa +27 -0
  20. data/data/keys/spider.rsa.pub +1 -0
  21. data/lib/spiderfw/app.rb +64 -4
  22. data/lib/spiderfw/autoload.rb +0 -1
  23. data/lib/spiderfw/cmd/commands/app.rb +2 -1
  24. data/lib/spiderfw/controller/controller.rb +189 -90
  25. data/lib/spiderfw/controller/dispatcher.rb +13 -3
  26. data/lib/spiderfw/controller/http_controller.rb +18 -4
  27. data/lib/spiderfw/controller/mixins/http_mixin.rb +37 -10
  28. data/lib/spiderfw/controller/mixins/visual.rb +14 -5
  29. data/lib/spiderfw/http/http.rb +5 -0
  30. data/lib/spiderfw/model/base_model.rb +1 -11
  31. data/lib/spiderfw/model/condition.rb +7 -4
  32. data/lib/spiderfw/model/mappers/mapper.rb +2 -2
  33. data/lib/spiderfw/requires.rb +1 -0
  34. data/lib/spiderfw/setup/app_manager.rb +7 -2
  35. data/lib/spiderfw/setup/setup_task.rb +1 -1
  36. data/lib/spiderfw/setup/spider_setup_wizard.rb +1 -1
  37. data/lib/spiderfw/spider.rb +4 -1
  38. data/lib/spiderfw/templates/layout.rb +8 -3
  39. data/lib/spiderfw/templates/template.rb +2 -1
  40. data/lib/spiderfw/test/rack_tester.rb +10 -0
  41. data/lib/spiderfw/widget/widget_plugin.rb +8 -1
  42. metadata +254 -157
  43. data/lib/spiderfw/model/storage/db/connectors/mysql.rb +0 -16
  44. data/lib/spiderfw/model/storage/db/connectors/mysql2.rb +0 -9
data/CHANGELOG CHANGED
@@ -1,3 +1,18 @@
1
+ == 0.6.26
2
+ * Added --no-rollback option to app update
3
+ * Routes by HTTP methods, as a main test or as :http_method option;
4
+ * Refactored Controller#url and related methods
5
+ * Fixed Etc.getpwuid error on Windows
6
+ * Condition#initialize now accepts a Proc, which must return the argument
7
+ * Various minor fixes
8
+
9
+ = 0.6.25
10
+ == 07 March, 2012
11
+ * Fixed error when starting irb console
12
+ * Dashes in widget ids are now replaced by underscores automatically (to allow widget paths)
13
+ * Fixes in app install
14
+ * Fixed GetText domain setting in overrides and JavaScript
15
+
1
16
  = 0.6.24
2
17
  == 24 February, 2012
3
18
  * Use Rack instead of custom adapters for all servers
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.25
1
+ 0.6.26.pre1
@@ -5,6 +5,8 @@ module Spider; module Auth
5
5
  class LoginController < Spider::Controller
6
6
  include HTTPMixin
7
7
  include Visual
8
+
9
+ layout 'login'
8
10
 
9
11
  def self.default_redirect
10
12
  nil
@@ -75,7 +75,7 @@ module Spider; module Auth
75
75
  def try_rescue(exc)
76
76
  if (exc.is_a?(Unauthorized))
77
77
  base = @current_require[:redirect] ? @current_require[:redirect] : Spider::Auth.request_url+'/login/'
78
- base = request_path+'/'+base unless base[0].chr == '/'
78
+ base = self.class.url+'/'+base unless base[0].chr == '/'
79
79
  base += '?'
80
80
  redir_url = base + 'redirect='+URI.escape(@request.path)
81
81
  @request.session.flash[:unauthorized_exception] = {:class => exc.class.name, :message => exc.message}
@@ -0,0 +1,49 @@
1
+ body{
2
+ background-color: #C5C5C5;
3
+ }
4
+
5
+ #content{
6
+ text-align: center;
7
+ }
8
+
9
+ .login-page{
10
+ margin: 10px auto;
11
+ padding: 10px 10px 20px 10px;
12
+ background-color: #ebebeb;
13
+ overflow: hidden;
14
+ width: 20em;
15
+ -webkit-border-radius: 10px;
16
+ -moz-border-radius: 10px;
17
+ border-radius: 10px;
18
+ }
19
+
20
+ h3{
21
+ background-color: #d0cede;
22
+ padding: 5px 0;
23
+ color: #535353;
24
+ -webkit-border-radius: 4px;
25
+ -moz-border-radius: 4px;
26
+ border-radius: 4px;
27
+ }
28
+
29
+ form{
30
+ width: 10em;
31
+ display: block;
32
+ margin: auto;
33
+ }
34
+
35
+ form .row{
36
+ text-align: left;
37
+ margin-bottom: 15px;
38
+ }
39
+
40
+ form .row label{
41
+ text-align: left;
42
+ display: block;
43
+ color: #6a6a6a;
44
+ }
45
+
46
+ #login, #password{
47
+ width: 15em;
48
+
49
+ }
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2
+ "http://www.w3.org/TR/html4/strict.dtd">
3
+ <html>
4
+ <head>
5
+ <title>Login</title>
6
+ <script sp:each='@assets[:js] |script|' type="text/javascript" src="{ script }"></script>
7
+ <link sp:each='@assets[:css] |css_file|' rel='stylesheet' href='{ css_file }' />
8
+ </head>
9
+ <body>
10
+ <div id="content">
11
+ <sp:yield />
12
+ </div>
13
+ </body>
14
+ </html>
@@ -1,4 +1,5 @@
1
1
  <div class="login-page">
2
+ <tpl:asset type="css" src="css/login.css" />
2
3
  <h3 sp:if="@login_title">{ @login_title }</h3>
3
4
  <div class='error' sp:if='@failed_login'>
4
5
  Login errata
@@ -0,0 +1,356 @@
1
+ /*
2
+ * jQuery UI Nested Sortable
3
+ * v 1.3.4 / 28 apr 2011
4
+ * http://mjsarfatti.com/sandbox/nestedSortable
5
+ *
6
+ * Depends:
7
+ * jquery.ui.sortable.js 1.8+
8
+ *
9
+ * License CC BY-SA 3.0
10
+ * Copyright 2010-2011, Manuele J Sarfatti
11
+ */
12
+
13
+ (function($) {
14
+
15
+ $.widget("ui.nestedSortable", $.extend({}, $.ui.sortable.prototype, {
16
+
17
+ options: {
18
+ tabSize: 20,
19
+ disableNesting: 'ui-nestedSortable-no-nesting',
20
+ errorClass: 'ui-nestedSortable-error',
21
+ listType: 'ol',
22
+ maxLevels: 0,
23
+ noJumpFix: 0
24
+ },
25
+
26
+ _create: function(){
27
+ if (this.noJumpFix == false)
28
+ this.element.height(this.element.height());
29
+ this.element.data('sortable', this.element.data('nestedSortable'));
30
+ return $.ui.sortable.prototype._create.apply(this, arguments);
31
+ },
32
+
33
+
34
+
35
+ _mouseDrag: function(event) {
36
+
37
+ //Compute the helpers position
38
+ this.position = this._generatePosition(event);
39
+ this.positionAbs = this._convertPositionTo("absolute");
40
+
41
+ if (!this.lastPositionAbs) {
42
+ this.lastPositionAbs = this.positionAbs;
43
+ }
44
+
45
+ //Do scrolling
46
+ if(this.options.scroll) {
47
+ var o = this.options, scrolled = false;
48
+ if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {
49
+
50
+ if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
51
+ this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
52
+ else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)
53
+ this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
54
+
55
+ if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
56
+ this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
57
+ else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)
58
+ this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
59
+
60
+ } else {
61
+
62
+ if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
63
+ scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
64
+ else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
65
+ scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
66
+
67
+ if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
68
+ scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
69
+ else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
70
+ scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
71
+
72
+ }
73
+
74
+ if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
75
+ $.ui.ddmanager.prepareOffsets(this, event);
76
+ }
77
+
78
+ //Regenerate the absolute position used for position checks
79
+ this.positionAbs = this._convertPositionTo("absolute");
80
+
81
+ //Set the helper position
82
+ if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
83
+ if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
84
+
85
+ //Rearrange
86
+ for (var i = this.items.length - 1; i >= 0; i--) {
87
+
88
+ //Cache variables and intersection, continue if no intersection
89
+ var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);
90
+ if (!intersection) continue;
91
+
92
+ if(itemElement != this.currentItem[0] //cannot intersect with itself
93
+ && this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before
94
+ && !$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked
95
+ && (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true)
96
+ //&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container
97
+ ) {
98
+
99
+ this.direction = intersection == 1 ? "down" : "up";
100
+
101
+ if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) {
102
+ this._rearrange(event, item);
103
+ } else {
104
+ break;
105
+ }
106
+
107
+ // Clear emtpy ul's/ol's
108
+ this._clearEmpty(itemElement);
109
+
110
+ this._trigger("change", event, this._uiHash());
111
+ break;
112
+ }
113
+ }
114
+
115
+ var parentItem = (this.placeholder[0].parentNode.parentNode && $(this.placeholder[0].parentNode.parentNode).closest('.ui-sortable').length) ? $(this.placeholder[0].parentNode.parentNode) : null;
116
+ var level = this._getLevel(this.placeholder);
117
+ var childLevels = this._getChildLevels(this.helper);
118
+ var previousItem = this.placeholder[0].previousSibling ? $(this.placeholder[0].previousSibling) : null;
119
+ if (previousItem != null) {
120
+ while (previousItem[0].nodeName.toLowerCase() != 'li' || previousItem[0] == this.currentItem[0]) {
121
+ if (previousItem[0].previousSibling) {
122
+ previousItem = $(previousItem[0].previousSibling);
123
+ } else {
124
+ previousItem = null;
125
+ break;
126
+ }
127
+ }
128
+ }
129
+
130
+ newList = document.createElement(o.listType);
131
+
132
+ this.beyondMaxLevels = 0;
133
+
134
+ // If the item is moved to the left, send it to its parent level
135
+ if (parentItem != null && this.positionAbs.left < parentItem.offset().left) {
136
+ parentItem.after(this.placeholder[0]);
137
+ this._clearEmpty(parentItem[0]);
138
+ this._trigger("change", event, this._uiHash());
139
+ }
140
+ // If the item is below another one and is moved to the right, make it a children of it
141
+ else if (previousItem != null && this.positionAbs.left > previousItem.offset().left + o.tabSize) {
142
+ this._isAllowed(previousItem, level+childLevels+1);
143
+ if (!previousItem.children(o.listType).length) {
144
+ previousItem[0].appendChild(newList);
145
+ }
146
+ previousItem.children(o.listType)[0].appendChild(this.placeholder[0]);
147
+ this._trigger("change", event, this._uiHash());
148
+ }
149
+ else {
150
+ this._isAllowed(parentItem, level+childLevels);
151
+ }
152
+
153
+ //Post events to containers
154
+ this._contactContainers(event);
155
+
156
+ //Interconnect with droppables
157
+ if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
158
+
159
+ //Call callbacks
160
+ this._trigger('sort', event, this._uiHash());
161
+
162
+ this.lastPositionAbs = this.positionAbs;
163
+ return false;
164
+
165
+ },
166
+
167
+ _mouseStop: function(event, noPropagation) {
168
+
169
+ // If the item is in a position not allowed, send it back
170
+ if (this.beyondMaxLevels) {
171
+ var parent = this.placeholder.parent().closest(this.options.items);
172
+
173
+ for (var i = this.beyondMaxLevels - 1; i > 0; i--) {
174
+ parent = parent.parent().closest(this.options.items);
175
+ }
176
+
177
+ this.placeholder.removeClass(this.options.errorClass);
178
+ parent.after(this.placeholder);
179
+ this._trigger("change", event, this._uiHash());
180
+ }
181
+
182
+ $.ui.sortable.prototype._mouseStop.apply(this, arguments);
183
+
184
+ },
185
+
186
+ serialize: function(o) {
187
+
188
+ var items = this._getItemsAsjQuery(o && o.connected);
189
+ var str = []; o = o || {};
190
+
191
+ $(items).each(function() {
192
+ var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
193
+ var pid = ($(o.item || this).parent(o.listType).parent('li').attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
194
+ if(res) str.push((o.key || res[1]+'['+(o.key && o.expression ? res[1] : res[2])+']')+'='+(pid ? (o.key && o.expression ? pid[1] : pid[2]) : 'root'));
195
+ });
196
+
197
+ if(!str.length && o.key) {
198
+ str.push(o.key + '=');
199
+ }
200
+
201
+ return str.join('&');
202
+
203
+ },
204
+
205
+ toHierarchy: function(o) {
206
+
207
+ o = o || {};
208
+ var sDepth = o.startDepthCount || 0;
209
+ var ret = [];
210
+
211
+ $(this.element).children('li').each(function() {
212
+ var level = _recursiveItems($(this));
213
+ ret.push(level);
214
+ });
215
+
216
+ return ret;
217
+
218
+ function _recursiveItems(li) {
219
+ var id = ($(li).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
220
+ if (id != null) {
221
+ var item = {"id" : id[2]};
222
+ if ($(li).children(o.listType).children('li').length > 0) {
223
+ item.children = [];
224
+ $(li).children(o.listType).children('li').each(function () {
225
+ var level = _recursiveItems($(this));
226
+ item.children.push(level);
227
+ });
228
+ }
229
+ return item;
230
+ }
231
+ }
232
+ },
233
+
234
+ toArray: function(o) {
235
+
236
+ o = o || {};
237
+ var sDepth = o.startDepthCount || 0;
238
+ var ret = [];
239
+ var left = 2;
240
+
241
+ ret.push({"item_id": 'root', "parent_id": 'none', "depth": sDepth, "left": '1', "right": ($('li', this.element).length + 1) * 2});
242
+
243
+ $(this.element).children('li').each(function () {
244
+ left = _recursiveArray(this, sDepth + 1, left);
245
+ });
246
+
247
+ function _sortByLeft(a,b) {
248
+ return a['left'] - b['left'];
249
+ }
250
+ ret = ret.sort(_sortByLeft);
251
+
252
+ return ret;
253
+
254
+ function _recursiveArray(item, depth, left) {
255
+
256
+ right = left + 1;
257
+
258
+ if ($(item).children(o.listType).children('li').length > 0) {
259
+ depth ++;
260
+ $(item).children(o.listType).children('li').each(function () {
261
+ right = _recursiveArray($(this), depth, right);
262
+ });
263
+ depth --;
264
+ }
265
+
266
+ id = ($(item).attr(o.attribute || 'id')).match(o.expression || (/(.+)[-=_](.+)/));
267
+
268
+ if (depth === sDepth + 1) pid = 'root';
269
+ else {
270
+ parentItem = ($(item).parent(o.listType).parent('li').attr('id')).match(o.expression || (/(.+)[-=_](.+)/));
271
+ pid = parentItem[2];
272
+ }
273
+
274
+ if (id != null) {
275
+ ret.push({"item_id": id[2], "parent_id": pid, "depth": depth, "left": left, "right": right});
276
+ }
277
+
278
+ return left = right + 1;
279
+ }
280
+
281
+ },
282
+
283
+ _clear: function(event, noPropagation) {
284
+
285
+ $.ui.sortable.prototype._clear.apply(this, arguments);
286
+
287
+ // Clean last empty ul/ol
288
+ for (var i = this.items.length - 1; i >= 0; i--) {
289
+ var item = this.items[i].item[0];
290
+ this._clearEmpty(item);
291
+ }
292
+ return true;
293
+
294
+ },
295
+
296
+ _clearEmpty: function(item) {
297
+
298
+ if (item.children[1] && item.children[1].children.length == 0) {
299
+ item.removeChild(item.children[1]);
300
+ }
301
+
302
+ },
303
+
304
+ _getLevel: function(item) {
305
+
306
+ var level = 1;
307
+
308
+ if (this.options.listType) {
309
+ var list = item.closest(this.options.listType);
310
+ while (!list.is('.ui-sortable')/* && level < this.options.maxLevels*/) {
311
+ level++;
312
+ list = list.parent().closest(this.options.listType);
313
+ }
314
+ }
315
+
316
+ return level;
317
+ },
318
+
319
+ _getChildLevels: function(parent, depth) {
320
+ var self = this,
321
+ o = this.options,
322
+ result = 0;
323
+ depth = depth || 0;
324
+
325
+ $(parent).children(o.listType).children(o.items).each(function (index, child) {
326
+ result = Math.max(self._getChildLevels(child, depth + 1), result);
327
+ });
328
+
329
+ return depth ? result + 1 : result;
330
+ },
331
+
332
+ _isAllowed: function(parentItem, levels) {
333
+ var o = this.options
334
+ // Are we trying to nest under a no-nest or are we nesting too deep?
335
+ if (parentItem == null || !(parentItem.hasClass(o.disableNesting))) {
336
+ if (o.maxLevels < levels && o.maxLevels != 0) {
337
+ this.placeholder.addClass(o.errorClass);
338
+ this.beyondMaxLevels = levels - o.maxLevels;
339
+ } else {
340
+ this.placeholder.removeClass(o.errorClass);
341
+ this.beyondMaxLevels = 0;
342
+ }
343
+ } else {
344
+ this.placeholder.addClass(o.errorClass);
345
+ if (o.maxLevels < levels && o.maxLevels != 0) {
346
+ this.beyondMaxLevels = levels - o.maxLevels;
347
+ } else {
348
+ this.beyondMaxLevels = 1;
349
+ }
350
+ }
351
+ }
352
+
353
+ }));
354
+
355
+ $.ui.nestedSortable.prototype.options = $.extend({}, $.ui.sortable.prototype.options, $.ui.nestedSortable.prototype.options);
356
+ })(jQuery);
@@ -4,7 +4,7 @@ Spider.defineWidget('Spider.Forms.DateTime', {
4
4
 
5
5
  ready: function(){
6
6
  var conf = {};
7
- this.input = this.el.find('input');
7
+ this.input = this.el;
8
8
  if (this.el.is('.change-month')) conf.changeMonth = true;
9
9
  if (this.el.is('.change-year')) conf.changeYear = true;
10
10
  var classes = this.el.attr('class').split(' ');
@@ -3,7 +3,7 @@ Spider.defineWidget('Spider.Forms.Select', 'Spider.Forms.Input', {
3
3
  autoInit: true,
4
4
 
5
5
  ready: function(){
6
- var sel = this.el.find('select');
6
+ var sel = this.el;
7
7
  if (sel.is('select[multiple]')){
8
8
  sel.attr('title', 'Aggiungi...');
9
9
  sel.bsmSelect({
@@ -17,8 +17,8 @@
17
17
  end
18
18
  %>
19
19
  </sp:run>
20
- <p sp:if="!@model.elements[<%=@attributes['element']%>].attributes[:description].blank?" class="help-block">
20
+ <p sp:if="@model.elements[<%=@attributes['element']%>] && !@model.elements[<%=@attributes['element']%>].attributes[:description].blank?" class="help-block">
21
21
  { @model.elements[<%=@attributes['element']%>].attributes[:description] }
22
22
  </p>
23
23
  </div>
24
- </forms:row>
24
+ </forms:row>
@@ -148,30 +148,42 @@ module Spider; module Forms
148
148
 
149
149
  def load_widgets(template=@template)
150
150
  super
151
- if (@action == :sub)
152
- @crud = Spider::Components::Crud.new(@request, @response)
153
- @crud.id = "crud_#{@sub_element.name.to_s}"
154
- @crud.model = @sub_element.model
155
- add_widget(@crud)
156
- @scene.crud = @crud
157
- @obj = load
158
- cond = {}
159
- if @sub_element.integrated?
160
- @sub_element.integrated_from.model.primary_keys.each do |key|
161
- cond[@sub_element.reverse.to_s+'.'+key.name.to_s] = @obj.get("#{@sub_element.integrated_from.name}.#{key.name}")
151
+ if @action == :sub
152
+ if @sub_element.multiple?
153
+ @crud = Spider::Components::Crud.new(@request, @response)
154
+ @crud.id = "crud_#{@sub_element.name.to_s}"
155
+ @crud.model = @sub_element.model
156
+ add_widget(@crud)
157
+ @scene.crud = @crud
158
+ @obj = load
159
+ cond = {}
160
+ debugger
161
+ if @sub_element.integrated?
162
+ @sub_element.integrated_from.model.primary_keys.each do |key|
163
+ cond[@sub_element.reverse.to_s+'.'+key.name.to_s] = @obj.get("#{@sub_element.integrated_from.name}.#{key.name}")
164
+ end
165
+ else
166
+ @model.primary_keys.each do |key|
167
+ cond[@sub_element.reverse.to_s+'.'+key.name.to_s] = @obj.get(key)
168
+ end
162
169
  end
163
- else
164
- @model.primary_keys.each do |key|
165
- cond[@sub_element.reverse.to_s+'.'+key.name.to_s] = @obj.get(key)
170
+ @crud.fixed = cond
171
+ sub_elements = []
172
+ #sub_elements += @sub_element.model.primary_keys.map{ |k| k.name }
173
+ @sub_element.model.elements_array.each do |el|
174
+ sub_elements << el.name unless el.integrated? || el.model == @model
166
175
  end
176
+ @crud.attributes[:table_elements] = sub_elements
177
+ # else
178
+ # @crud = Spider::Forms::Form.new(@request, @response)
179
+ # @form.id = "crud_#{@sub_element.name.to_s}"
180
+ # @form.model = @sub_element.model
181
+ # add_widget(@crud)
182
+ # @scene.crud = @crud
183
+ # @obj.load
184
+ # debugger
185
+ # @form.pk = @obj.get(@sub_element).id
167
186
  end
168
- @crud.fixed = cond
169
- sub_elements = []
170
- #sub_elements += @sub_element.model.primary_keys.map{ |k| k.name }
171
- @sub_element.model.elements_array.each do |el|
172
- sub_elements << el.name unless el.integrated? || el.model == @model
173
- end
174
- @crud.attributes[:table_elements] = sub_elements
175
187
  else
176
188
  create_inputs
177
189
  end
@@ -251,7 +263,7 @@ module Spider; module Forms
251
263
  if ([:choice, :multiple_choice, :state, :multiple_state].include?(el.association) && !el.extended?)
252
264
  widget_type = el.type.attributes[:estimated_size] && el.type.attributes[:estimated_size] > 30 ?
253
265
  SearchSelect : Select
254
- elsif @attributes[:show_related] && @pk && el.multiple?
266
+ elsif @attributes[:show_related] && @pk
255
267
  @sub_links[el.name] = sub_link(el)
256
268
  end
257
269
  end
@@ -31,6 +31,7 @@ end
31
31
  require File.join('apps/messenger/backends/sms/', backend)
32
32
  end
33
33
 
34
+ Spider.register_resource_type(:sms, :extensions => ['erb'], :path => 'templates/sms')
34
35
 
35
36
  Spider::Admin.register_app(Spider::Messenger, Spider::Messenger::AdminController, {
36
37
  :icon => 'app_icon.png', :priority => 1
@@ -2,7 +2,7 @@
2
2
  <h3>_(Queues)</h3>
3
3
  <ul>
4
4
  <li sp:each="@queues |name|">
5
- <a href="{ @controller[:request_path] }/{ name }">{ @queue_info[name][:label] }</a>:
5
+ <a href="{ @controller[:url] }/{ name }">{ @queue_info[name][:label] }</a>:
6
6
  <ul>
7
7
  <li>_(Sent messages): <span class="label success">{ @queue_info[name][:sent] }</span></li>
8
8
  <li>_(Queued messages): <span class="label warning">{ @queue_info[name][:queued] }</span></li>
@@ -2,7 +2,7 @@
2
2
  _(Queues):
3
3
  <ul>
4
4
  <li sp:each="@queues |name|">
5
- <a href="{ @controller[:request_path] }/{ name }">{ @queue_info[name][:label] }</a>:
5
+ <a href="{ @controller[:url] }/{ name }">{ @queue_info[name][:label] }</a>:
6
6
  <ul>
7
7
  <li>_(Sent messages): <span class="label success">{ @queue_info[name][:sent] }</span></li>
8
8
  <li>_(Queued messages): <span class="label warning">{ @queue_info[name][:queued] }</span></li>
Binary file
Binary file
Binary file
@@ -0,0 +1,27 @@
1
+ -----BEGIN RSA PRIVATE KEY-----
2
+ MIIEpQIBAAKCAQEAxq4+mlIi6yi7tPZhrs0X2mYzltmKZuPB06RXsOvTsycb6q6a
3
+ k4svlkbw+yHBkmegkBTUaTTR9VZ+YWNRjpts4TXcgmTQRdi9R2LFEP8OXd7QrEt4
4
+ oJ8ah4LXbkVZMxcf83spIzSfk/1vqWOVEFs8cCTTATNLzwGbSMl7p+aIJ+px2VDU
5
+ f2E/1apICmQyF20h1sobZMjUysDC1fLpRNKBVDtLMCorEttnXEJOEF55aefJDCSN
6
+ bkPLszF+vMFCD0bbIAjoVp7ts8EQsl9951tUpr0zw0vFf1p9qi8ikF4yJIgI1u2M
7
+ ECUHu32lZ4XLLaKmI9Lz5L++CG28YFQI20GpkwIDAQABAoIBAQCAXoTEYN1+40qk
8
+ maxzrMAEtJQQm235HJ9Xh4/BGB4oWtSGxVnKitusVRnOqPjRB3OOpGa5sw8VXVU6
9
+ x1kisvmeaZaYCVsoRenF/eMmICXAMP7S09CUtzgE5l0bOmNvxzk1sBXcUVvp2o4S
10
+ ++yMLObX7nMHC4WnsnoKhWQID8NZRdRoqsAA/kzzhfdPPMug/abLWVk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