spiderfw 0.5.19 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (255) hide show
  1. data/CHANGELOG +7 -0
  2. data/VERSION +1 -1
  3. data/apps/core/auth/lib/rbac.rb +7 -2
  4. data/apps/core/auth/models/mixins/rbac_provider.rb +66 -4
  5. data/apps/core/components/assets.rb +63 -33
  6. data/apps/core/components/public/js/jquery/{jquery-1.4.3.js → jquery-1.5.2.js} +2617 -1126
  7. data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/overlay/overlay.apple.js +155 -0
  8. data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/overlay/overlay.js +293 -0
  9. data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/scrollable/scrollable.js +335 -0
  10. data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/tabs/tabs.css +59 -0
  11. data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/tabs/tabs.js +283 -0
  12. data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/toolbox/toolbox.expose.js +224 -0
  13. data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.dynamic.js +150 -0
  14. data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.js +343 -0
  15. data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.slide.js +78 -0
  16. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/button_bg.png +0 -0
  17. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/datepicker.gif +0 -0
  18. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/icon_sprite.png +0 -0
  19. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/progress_bar.gif +0 -0
  20. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/slider_h_bg.gif +0 -0
  21. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/slider_handles.png +0 -0
  22. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/slider_v_bg.gif +0 -0
  23. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/tab_bg.gif +0 -0
  24. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/the_gradient.gif +0 -0
  25. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-anim_basic_16x16.gif +0 -0
  26. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  27. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  28. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_flat_10_000000_40x100.png +0 -0
  29. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  30. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  31. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  32. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  33. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  34. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  35. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-icons_222222_256x240.png +0 -0
  36. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-icons_228ef1_256x240.png +0 -0
  37. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-icons_ef8c08_256x240.png +0 -0
  38. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-icons_ffd27a_256x240.png +0 -0
  39. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-icons_ffffff_256x240.png +0 -0
  40. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/jquery-ui.custom.css +0 -0
  41. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-af.js +0 -0
  42. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-ar-DZ.js +23 -0
  43. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ar.js +7 -8
  44. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-az.js +0 -0
  45. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-bg.js +0 -0
  46. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-bs.js +0 -0
  47. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ca.js +0 -0
  48. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-cs.js +0 -0
  49. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-da.js +0 -0
  50. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-de.js +0 -0
  51. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-el.js +0 -0
  52. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-en-AU.js +23 -0
  53. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-en-GB.js +0 -0
  54. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-en-NZ.js +23 -0
  55. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-eo.js +0 -0
  56. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-es.js +0 -0
  57. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-et.js +0 -0
  58. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-eu.js +0 -0
  59. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-fa.js +0 -0
  60. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-fi.js +0 -0
  61. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-fo.js +0 -0
  62. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-fr-CH.js +0 -0
  63. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-fr.js +12 -10
  64. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-gl.js +23 -0
  65. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-he.js +0 -0
  66. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-hr.js +0 -0
  67. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-hu.js +1 -1
  68. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-hy.js +0 -0
  69. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-id.js +0 -0
  70. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-is.js +0 -0
  71. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-it.js +0 -0
  72. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ja.js +0 -0
  73. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ko.js +0 -0
  74. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-kz.js +23 -0
  75. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-lt.js +0 -0
  76. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-lv.js +0 -0
  77. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-ml.js +23 -0
  78. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ms.js +0 -0
  79. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-nl.js +0 -0
  80. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-no.js +23 -0
  81. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-pl.js +0 -0
  82. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-pt-BR.js +0 -0
  83. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-pt.js +22 -0
  84. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-rm.js +21 -0
  85. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ro.js +0 -0
  86. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ru.js +1 -1
  87. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sk.js +0 -0
  88. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sl.js +0 -0
  89. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sq.js +0 -0
  90. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sr-SR.js +0 -0
  91. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sr.js +0 -0
  92. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sv.js +0 -0
  93. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ta.js +0 -0
  94. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-th.js +1 -1
  95. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-tj.js +23 -0
  96. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-tr.js +0 -0
  97. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-uk.js +0 -0
  98. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-vi.js +0 -0
  99. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-zh-CN.js +0 -0
  100. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-zh-HK.js +0 -0
  101. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-zh-TW.js +0 -0
  102. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.blind.js +3 -3
  103. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.bounce.js +3 -3
  104. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.clip.js +3 -3
  105. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.core.js +48 -15
  106. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.drop.js +3 -3
  107. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.explode.js +2 -2
  108. data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/jquery.effects.fade.js +32 -0
  109. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.fold.js +3 -3
  110. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.highlight.js +2 -2
  111. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.pulsate.js +2 -2
  112. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.scale.js +4 -4
  113. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.shake.js +3 -3
  114. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.slide.js +4 -4
  115. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.transfer.js +2 -2
  116. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.accordion.js +33 -20
  117. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.autocomplete.js +104 -42
  118. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.button.js +35 -13
  119. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.core.js +111 -84
  120. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.datepicker.js +87 -46
  121. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.dialog.js +105 -75
  122. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.draggable.js +17 -15
  123. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.droppable.js +5 -5
  124. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.mouse.js +16 -11
  125. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.position.js +51 -32
  126. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.progressbar.js +24 -10
  127. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.resizable.js +7 -7
  128. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.selectable.js +3 -3
  129. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.slider.js +9 -7
  130. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.sortable.js +22 -20
  131. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.tabs.js +15 -14
  132. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.widget.js +50 -25
  133. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → plugins/bsmselect}/GPL-LICENSE.txt +1 -1
  134. data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → plugins/bsmselect}/MIT-LICENSE.txt +3 -7
  135. data/apps/core/components/public/js/jquery/plugins/bsmselect/README.md +185 -0
  136. data/apps/core/components/public/js/jquery/plugins/bsmselect/css/jquery.bsmselect.css +64 -0
  137. data/apps/core/components/public/js/jquery/plugins/bsmselect/js/jquery.bsmselect.compatibility.js +60 -0
  138. data/apps/core/components/public/js/jquery/plugins/bsmselect/js/jquery.bsmselect.js +381 -0
  139. data/apps/core/components/public/js/jquery/plugins/bsmselect/js/jquery.bsmselect.sortable.js +49 -0
  140. data/apps/core/components/public/js/plugins/sortable.js +16 -7
  141. data/apps/core/components/public/js/spider.js +60 -41
  142. data/apps/core/components/widgets/admin/admin.shtml +1 -1
  143. data/apps/core/components/widgets/list/list.shtml +2 -2
  144. data/apps/core/components/widgets/month_calendar/month_calendar.shtml +23 -20
  145. data/apps/core/components/widgets/switcher/switcher.rb +77 -21
  146. data/apps/core/components/widgets/switcher/templates/default.shtml +8 -0
  147. data/apps/core/components/widgets/switcher/templates/table.shtml +15 -0
  148. data/apps/core/components/widgets/table/table.rb +4 -1
  149. data/apps/core/components/widgets/table/table.shtml +10 -8
  150. data/apps/core/forms/public/css/form.css +9 -1
  151. data/apps/core/forms/public/date_time.js +14 -2
  152. data/apps/core/forms/public/input.js +1 -1
  153. data/apps/core/forms/public/select.js +4 -3
  154. data/apps/core/forms/tags/element_row.erb +11 -2
  155. data/apps/core/forms/widgets/inputs/date_time/date_time.rb +9 -0
  156. data/apps/core/forms/widgets/inputs/date_time/date_time.shtml +1 -1
  157. data/apps/core/forms/widgets/inputs/html_area/html_area.shtml +2 -2
  158. data/apps/core/forms/widgets/inputs/input/input.rb +0 -3
  159. data/apps/core/forms/widgets/inputs/select/select.shtml +2 -2
  160. data/apps/messenger/backends/email/sendmail.rb +20 -0
  161. data/apps/messenger/backends/email/smtp.rb +12 -14
  162. data/apps/messenger/backends/email/test.rb +20 -0
  163. data/apps/messenger/config/options.rb +9 -9
  164. data/apps/messenger/config/test.config.yml +2 -0
  165. data/apps/messenger/controllers/mixins/messenger_helper.rb +41 -15
  166. data/apps/messenger/lib/email_backend.rb +10 -0
  167. data/apps/messenger/messenger.rb +45 -26
  168. data/apps/messenger/test/features/attachments.feature +26 -0
  169. data/apps/messenger/test/features/messenger_helper.feature +31 -0
  170. data/apps/messenger/test/features/sending_email.feature +10 -0
  171. data/apps/messenger/test/features/step_definitions/common_steps.rb +11 -0
  172. data/apps/messenger/test/features/step_definitions/email_steps.rb +98 -0
  173. data/apps/messenger/test/features/support/env.rb +11 -0
  174. data/apps/messenger/test/files/test_file1.txt +1 -0
  175. data/apps/messenger/test/lib/controllers/mail_test_controller.rb +34 -0
  176. data/apps/messenger/test/templates/email/multipart.html.erb +1 -0
  177. data/apps/messenger/test/templates/email/multipart.txt.erb +1 -0
  178. data/apps/messenger/test/templates/email/simple.erb +1 -0
  179. data/apps/messenger/test/templates/email/vars.erb +1 -0
  180. data/lib/spiderfw/cmd/cmd.rb +4 -0
  181. data/lib/spiderfw/cmd/commands/webserver.rb +12 -59
  182. data/lib/spiderfw/config/configuration.rb +4 -0
  183. data/lib/spiderfw/config/options/spider.rb +25 -8
  184. data/lib/spiderfw/controller/controller.rb +10 -4
  185. data/lib/spiderfw/controller/first_responder.rb +6 -20
  186. data/lib/spiderfw/controller/http_controller.rb +2 -1
  187. data/lib/spiderfw/controller/mixins/http_mixin.rb +12 -1
  188. data/lib/spiderfw/controller/mixins/visual.rb +3 -16
  189. data/lib/spiderfw/env.rb +1 -1
  190. data/lib/spiderfw/http/server.rb +178 -2
  191. data/lib/spiderfw/model/base_model.rb +142 -111
  192. data/lib/spiderfw/model/data_type.rb +15 -0
  193. data/lib/spiderfw/model/datatypes/decimal.rb +8 -0
  194. data/lib/spiderfw/model/datatypes/pk.rb +29 -0
  195. data/lib/spiderfw/model/datatypes.rb +1 -0
  196. data/lib/spiderfw/model/element.rb +5 -1
  197. data/lib/spiderfw/model/extended_models/managed.rb +1 -1
  198. data/lib/spiderfw/model/junction.rb +23 -0
  199. data/lib/spiderfw/model/mappers/db_mapper.rb +96 -80
  200. data/lib/spiderfw/model/mappers/document_mapper.rb +315 -0
  201. data/lib/spiderfw/model/mappers/mapper.rb +164 -75
  202. data/lib/spiderfw/model/mixins/list.rb +1 -0
  203. data/lib/spiderfw/model/mixins/versioned.rb +63 -27
  204. data/lib/spiderfw/model/model.rb +36 -9
  205. data/lib/spiderfw/model/query_funcs.rb +3 -0
  206. data/lib/spiderfw/model/query_set.rb +21 -1
  207. data/lib/spiderfw/model/storage/base_storage.rb +259 -6
  208. data/lib/spiderfw/model/storage/{db/db_connection_pool.rb → connection_pool.rb} +25 -21
  209. data/lib/spiderfw/model/storage/db/adapters/mysql.rb +25 -5
  210. data/lib/spiderfw/model/storage/db/adapters/oracle.rb +1 -1
  211. data/lib/spiderfw/model/storage/db/connectors/jdbc_oracle.rb +2 -2
  212. data/lib/spiderfw/model/storage/db/connectors/oci8.rb +3 -4
  213. data/lib/spiderfw/model/storage/db/db_storage.rb +18 -219
  214. data/lib/spiderfw/model/storage/document/adapters/mongodb.rb +307 -0
  215. data/lib/spiderfw/model/storage/document/document.rb +7 -0
  216. data/lib/spiderfw/model/storage/document/document_storage.rb +34 -0
  217. data/lib/spiderfw/model/storage.rb +23 -11
  218. data/lib/spiderfw/model/unit_of_work.rb +45 -22
  219. data/lib/spiderfw/spider.rb +660 -0
  220. data/lib/spiderfw/templates/blocks/html.rb +4 -2
  221. data/lib/spiderfw/templates/blocks/run.rb +1 -1
  222. data/lib/spiderfw/templates/blocks/tag_if.rb +1 -1
  223. data/lib/spiderfw/templates/blocks/widget.rb +1 -1
  224. data/lib/spiderfw/templates/layout.rb +29 -5
  225. data/lib/spiderfw/templates/template.rb +72 -7
  226. data/lib/spiderfw/templates/template_blocks.rb +1 -1
  227. data/lib/spiderfw/test/capybara.rb +7 -0
  228. data/lib/spiderfw/test/cucumber.rb +12 -0
  229. data/lib/spiderfw/test/page_object.rb +29 -0
  230. data/lib/spiderfw/test/spec.rb +20 -0
  231. data/lib/spiderfw/test/stubs/mapper_stub.rb +18 -0
  232. data/lib/spiderfw/test/stubs/storage_stub.rb +23 -0
  233. data/lib/spiderfw/test/unit.rb +23 -0
  234. data/lib/spiderfw/test.rb +89 -0
  235. data/lib/spiderfw/utils/json.rb +6 -0
  236. data/lib/spiderfw/utils/logger.rb +17 -4
  237. data/lib/spiderfw/utils/loggers/apache_commons_logger.rb +61 -0
  238. data/lib/spiderfw/utils/monkey/date_time.rb +2 -2
  239. data/lib/spiderfw/utils/monkey/module.rb +3 -1
  240. data/lib/spiderfw/utils/profiling.rb +2 -2
  241. data/lib/spiderfw/widget/widget.rb +31 -13
  242. data/lib/spiderfw.rb +1 -597
  243. data/spider.gemspec +9 -10
  244. metadata +193 -132
  245. data/apps/admin/_init.rb +0 -9
  246. data/apps/admin/controllers/admin_controller.rb +0 -12
  247. data/apps/admin/widgets/dashboard_widget/dashboard_widget.rb +0 -8
  248. data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/AUTHORS.txt +0 -30
  249. data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery-ui-i18n.js +0 -1176
  250. data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-no.js +0 -23
  251. data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/version.txt +0 -1
  252. data/apps/core/components/public/js/jquery/plugins/asmselect/jquery.asmselect.css +0 -64
  253. data/apps/core/components/public/js/jquery/plugins/asmselect/jquery.asmselect.js +0 -407
  254. data/apps/core/components/widgets/switcher/switcher.shtml +0 -17
  255. data/apps/master/po/master.pot +0 -400
@@ -1,21 +1,24 @@
1
- <table class="{ @widget[:css_class] }">
1
+ <div>
2
2
  <tpl:asset type="css" src="css/month_calendar.css" />
3
- <thead>
4
- <tr>
5
- <th colspan="7">
6
- <a href="{ @request[:path] }?_w{ @widget[:param] }[d]={ @prev_link }"><span>&lt;&lt;</span></a>
7
- { @current_month_name } { @year }
8
- <a href="{ @request[:path] }?_w{ @widget[:param] }[d]={ @next_link }"><span>&gt;&gt;</span></a>
9
- </th>
10
- <tr>
11
- <th sp:each="@week_days |i|">{ @days_short_names[i] }</th>
12
- </tr>
13
- </thead>
14
- <tbody>
15
- <tr sp:each="@rows |row|">
16
- <td sp:each="row |col|" class="{ col[:classes] }">
17
- { col[:day] }
18
- </td>
19
- </tr>
20
- </tbody>
21
- </table>
3
+ <table class="{ @widget[:css_class] }">
4
+ <thead>
5
+ <tr>
6
+ <th colspan="7">
7
+ <a href="{ @request[:path] }?_w{ @widget[:param] }%5Bd%5D={ @prev_link }"><span>&lt;&lt;</span></a>
8
+ { @current_month_name } { @year }
9
+ <a href="{ @request[:path] }?_w{ @widget[:param] }%5Bd%5D={ @next_link }"><span>&gt;&gt;</span></a>
10
+ </th>
11
+ </tr>
12
+ <tr>
13
+ <th sp:each="@week_days |i|">{ @days_short_names[i] }</th>
14
+ </tr>
15
+ </thead>
16
+ <tbody>
17
+ <tr sp:each="@rows |row|">
18
+ <td sp:each="row |col|" class="{ col[:classes] }">
19
+ { col[:day] }
20
+ </td>
21
+ </tr>
22
+ </tbody>
23
+ </table>
24
+ </div>
@@ -7,13 +7,20 @@ module Spider; module Components
7
7
  is_attribute :default
8
8
  attr_reader :current, :current_label
9
9
 
10
+ default_template 'default'
11
+
12
+
10
13
  def init
11
- @items = []
12
14
  @sections = {}
13
15
  @labels = {}
14
16
  @links = {}
15
- @content_by_action = {}
17
+ @first_link = nil
18
+ @content_by_label = {}
19
+ @labels_by_action = {}
16
20
  @link_mode = :path
21
+ @current_action = nil
22
+ @inline_widgets = {}
23
+ @inline_w_order = []
17
24
  end
18
25
 
19
26
  def route_widget
@@ -23,23 +30,39 @@ module Spider; module Components
23
30
 
24
31
 
25
32
  def prepare(action='')
26
- if (@_action_local)
27
- act = @_action_local
28
- elsif @default
29
- act = @default
30
- else
31
- redirect(widget_request_path+'/'+@links[@items[0]]) unless @items.empty?
33
+ act = @_action_local || @default
34
+ @current_action = act
35
+ @scene.current_action = @current_action
36
+ if @labels_by_action[act] && content = @content_by_label[@labels_by_action[act]]
37
+ # must add the widget here so that it gets processed in super
38
+ add_widget(content) if content.is_a?(Spider::Widget)
32
39
  end
33
- content = @content_by_action[act]
40
+
41
+ init_widgets
42
+
43
+
44
+ # The widget object gets instantiated in super, so it is available now
45
+ @inline_w_order.each do |id|
46
+ iw = @inline_widgets[id]
47
+ add(iw[:label], @widgets[id], iw[:section])
48
+ end
49
+
50
+ redirect(widget_request_path+'/'+@first_link) if !act && @first_link
51
+
52
+ label = @labels_by_action[act]
53
+ content = @content_by_label[label]
34
54
  raise NotFound.new(request_path) unless content
35
- add_widget(content) if content.is_a?(Spider::Widget)
36
- @current = content
37
- @current_label = @labels[content]
55
+
56
+ # content must not be set in inline, so it is not rendered by sp:run
57
+ @current = @inline_widgets[content.id.to_sym] ? nil : content
58
+ @current_label = label
59
+
38
60
  super
39
- @sections.each do |section, items|
40
- items.each do |item|
41
- menu_link = @link_mode == :path ? widget_request_path+'/'+@links[item] : "#{widget_request_path}?_wa[#{full_id}]=#{@links[item]}"
42
- @widgets[:menu].add(@labels[item], menu_link, section)
61
+
62
+ @sections.each do |section, labels|
63
+ labels.each do |label|
64
+ menu_link = @link_mode == :path ? widget_request_path+'/'+@links[label] : "#{widget_request_path}?_wa[#{full_id}]=#{@links[label]}"
65
+ @widgets[:menu].add(label, menu_link, section)
43
66
  end
44
67
  end
45
68
  @widgets[:menu].current = @current_label
@@ -47,13 +70,14 @@ module Spider; module Components
47
70
  end
48
71
 
49
72
  def add(label, content, section=nil)
50
- @items << content
51
73
  @sections[section] ||= []
52
- @sections[section] << content
74
+ @sections[section] << label
53
75
  @labels[content] = label
54
- w_action = self.class.label_to_link(label)
55
- @content_by_action[w_action] = content
56
- @links[content] = w_action
76
+ @content_by_label[label] = content
77
+ w_act = self.class.label_to_link(label)
78
+ @first_link ||= w_act
79
+ @links[label] = w_act
80
+ @labels_by_action[w_act] = label
57
81
  end
58
82
 
59
83
  def widget_assets
@@ -66,6 +90,38 @@ module Spider; module Components
66
90
  label.downcase.gsub(/\s+/, '_').gsub(/[^a-zA-Z_]/, '')
67
91
  end
68
92
 
93
+ def self.parse_content(doc)
94
+ ov = ""
95
+ @inline_widgets = []
96
+ doc.root.search('> [@id]').each do |w|
97
+ w_id = w.get_attribute('id')
98
+ w_label = w.get_attribute('switcher:label') || w_id
99
+ w_section = w.get_attribute('switcher:section')
100
+ w.remove_attribute('switcher:label')
101
+ w.remove_attribute('switcher:section')
102
+ ov += %Q{<tpl:pass sp:if="@current_action == '#{w_id}'">#{w.to_s}</tpl:pass>}
103
+ inline_attrs = %Q{id="#{w_id}" label="#{w_label}"}
104
+ inline_attrs += %Q{ section="#{w_section}"} if w_section
105
+ w.swap(%Q{<switcher:inline-widget #{inline_attrs}/>})
106
+ end
107
+ override = Hpricot(%Q{<tpl:append search="#content">#{ov}</tpl:append>}).root
108
+ parse_override(override)
109
+ runtime, soverrides = super(doc)
110
+ return [runtime, [override] + soverrides]
111
+ end
112
+
113
+ def parse_runtime_content(doc, src_path)
114
+ doc = super
115
+ @inline_widgets = {}
116
+ doc.search('switcher:inline-widget').each do |w|
117
+ w_id = w.get_attribute('id').to_sym
118
+ @inline_widgets[w_id] = {:label => w.get_attribute('label')}
119
+ @inline_w_order << w_id
120
+ end
121
+ doc.search('switcher:inline-widget').remove
122
+ doc
123
+ end
124
+
69
125
 
70
126
  end
71
127
 
@@ -0,0 +1,8 @@
1
+ <div>
2
+ <tpl:asset type="css" src="css/switcher.css" />
3
+ <core:menu id="menu"/>
4
+ <div id="content" class="content">
5
+ <sp:render sp:if="@current.is_a?(Spider::Template)" obj="@current" />
6
+ <sp:run sp:if="@current.is_a?(Spider::Widget)" obj="@current" />
7
+ </div>
8
+ </div>
@@ -0,0 +1,15 @@
1
+ <tpl:extend src="default.shtml">
2
+ <tpl:override-content>
3
+ <div id="switcher_top"></div>
4
+ <table width="100%">
5
+ <tr>
6
+ <td valign="top" width="18%">
7
+ <tpl:overridden search="#menu" />
8
+ </td>
9
+ <td valign="top">
10
+ <tpl:overridden search="#content" />
11
+ </td>
12
+ </tr>
13
+ </table>
14
+ </tpl:override-content>
15
+ </tpl:extend>
@@ -112,6 +112,7 @@ module Spider; module Components
112
112
  @scene.has_more = @rows.has_more?
113
113
  @scene.pages = (@rows.total_rows.to_f / @attributes[:row_limit]).ceil
114
114
  @scene.paginate_last = [@scene.paginate_first + 9, @scene.pages].min
115
+ @scene.columns = @elements.size
115
116
  super
116
117
  end
117
118
 
@@ -145,7 +146,9 @@ module Spider; module Components
145
146
  res_row[el] = list
146
147
  end
147
148
  else
148
- if (!row[el])
149
+ if element.type <= Spider::Bool
150
+ res_row[el] = row[el] ? _('Yes') : _('No')
151
+ elsif (!row[el])
149
152
  res_row[el] = ''
150
153
  elsif (element.type <= Date || element.type <= Time)
151
154
  res_row[el] = Spider::I18n.localize_date_time(@request.locale, row[el], :short)
@@ -12,17 +12,19 @@
12
12
  </tr>
13
13
  </thead>
14
14
  <tbody>
15
- <tr sp:each_index="@rows |row_i|" class="row { (row_i%2==0) ? 'odd' : 'even' }">
16
- <td sp:each="@elements |element|">
17
- <a sp:tag-if="@link_el && element == @link_el" href="{ @link }{ Spider::HTTP.urlencode(@rows[row_i][@link_id]) }">
18
- { @rows[row_i][element] }
19
- </a>
20
- </td>
21
- </tr>
15
+ <tpl:pass sp:each_index="@rows |row_i|">
16
+ <tr class="row { (row_i%2==0) ? 'odd' : 'even' }">
17
+ <td sp:each="@elements |element|">
18
+ <a sp:tag-if="@link_el && element == @link_el" href="{ @link }{ Spider::HTTP.urlencode(@rows[row_i][@link_id]) }">
19
+ { @rows[row_i][element] }
20
+ </a>
21
+ </td>
22
+ </tr>
23
+ </tpl:pass>
22
24
  </tbody>
23
25
  <tfoot>
24
26
  <tr class="paginator" sp:if="@paginate && @pages > 1">
25
- <td colspan="{ @elements.size }" >
27
+ <td colspan="{ @columns }" >
26
28
  <a sp:if="@page > 1" href="{ @request[:path] }?_w{ @widget[:param] }[page]={ @page-1 }">Indietro</a>
27
29
  <sp:pass sp:if="@paginate_first > 1">
28
30
  <a href="{ @request[:path] }?_w{ @widget[:param] }[page]=1" class="page">1</a> ...
@@ -87,6 +87,14 @@
87
87
  background-color: #F2F2F2;
88
88
  }
89
89
 
90
- .asmSelectTitle{
90
+ .bsmSelectTitle{
91
91
  color: #999999;
92
92
  }
93
+
94
+ .spider.forms.form .bsmContainer{
95
+ float: left;
96
+ }
97
+
98
+ .spider.forms.form .bsmListItem{
99
+ padding-right: 2em;
100
+ }
@@ -3,13 +3,25 @@ Spider.defineWidget('Spider.Forms.DateTime', {
3
3
  autoInit: true,
4
4
 
5
5
  ready: function(){
6
- if (this.el.is('.date')) this.el.datepicker();
6
+ var conf = {};
7
+ if (this.el.is('.change-month')) conf.changeMonth = true;
8
+ if (this.el.is('.change-year')) conf.changeYear = true;
9
+ var classes = this.el.attr('class').split(' ');
10
+ for (var i=0; i<classes.length; i++){
11
+ var cl = classes[i];
12
+ if (cl.substr(0, 10) == 'year-range'){
13
+ var range = cl.substr(11).split('-');
14
+ conf.yearRange = range[0].replace("m", "-")+":"+range[1].replace('p', '+');
15
+ a = 3;
16
+ }
17
+ }
18
+ if (this.el.is('.date')) this.el.datepicker(conf);
7
19
  else if (this.el.is('.date_time')){
8
20
  var el = this.el;
9
21
  el.hide();
10
22
  var val = el.val().split(' ');
11
23
  if (!val[1]) val[1] = '';
12
- var d = $('<input type="text" class="date" size="10" />').val(val[0]).insertAfter(el).datepicker();
24
+ var d = $('<input type="text" class="date" size="10" />').val(val[0]).insertAfter(el).datepicker(conf);
13
25
  var span = $('<span> </span>').insertAfter(d);
14
26
  var t = $('<input type="text" class="time" size="8" />').val(val[1]).insertAfter(span);
15
27
  var updateDt = function(){
@@ -22,7 +22,7 @@ Spider.defineWidget('Spider.Forms.Input', {
22
22
  },
23
23
 
24
24
  val: function(){
25
- this.el.val();
25
+ return this.el.val();
26
26
  }
27
27
 
28
28
 
@@ -5,12 +5,13 @@ Spider.defineWidget('Spider.Forms.Select', 'Spider.Forms.Input', {
5
5
  ready: function(){
6
6
  if (this.el.is('select[multiple]')){
7
7
  this.el.attr('title', 'Aggiungi...');
8
- this.el.asmSelect({
8
+ this.el.bsmSelect({
9
9
  removeLabel: 'togli',
10
10
  highlightAddedLabel: 'Aggiunto: ',
11
- highlightRemovedLabel: 'Tolto: '
11
+ highlightRemovedLabel: 'Tolto: ',
12
+ addItemTarget: 'top'
12
13
  });
13
- $('.asmSelect option:first', this.el.parent()).addClass('asmSelectTitle')
14
+ $('.bsmSelect option:first', this.el.parent()).addClass('bsmSelectTitle')
14
15
  .attr("selected", false)
15
16
  .attr("disabled", true);
16
17
  }
@@ -1,9 +1,18 @@
1
1
  <%
2
+ tag_attrs = ['required', 'element', 'error_condition']
2
3
  error_condition = @attributes['error_condition'] ? @attributes['error_condition'] : "@inputs[#{@attributes['element']}].error?"
3
4
  required = @attributes['required'] ? @attributes['required'] : "@inputs[#{@attributes['element']}].required?"
4
5
  %>
5
6
  <forms:row error_condition="<%=error_condition%>" required="<%=required%>">
6
7
  <forms:element_label element="<%=@attributes['element']%>" required="<%=required%>"/>
7
- <sp:run obj="@inputs[<%=@attributes['element']%>]" />
8
- <sp:attribute widget="<%=@attributes['element'][1..-1]%>" name="required" value="<%=(@attributes['required']=='true')? 'true' : ''%>" />
8
+ <sp:run obj="@inputs[<%=@attributes['element']%>]" widget="<%=@attributes['element']%>">
9
+ <sp:attribute widget="<%=@attributes['element'][1..-1]%>" name="required" value="<%=(@attributes['required']=='true')? 'true' : ''%>" />
10
+ <%
11
+ (@attributes.keys - tag_attrs).each do |k|
12
+ %>
13
+ <sp:attribute widget="<%=@attributes['element'][1..-1]%>" name="<%=k%>" value="<%=@attributes[k]%>" />
14
+ <%
15
+ end
16
+ %>
17
+ </sp:run>
9
18
  </forms:row>
@@ -6,6 +6,9 @@ module Spider; module Forms
6
6
  is_attr_accessor :mode, :type => Symbol, :default => :date
7
7
  i_attr_accessor :format, :type => String
8
8
  i_attr_accessor :lformat, :type => Symbol, :default => :short
9
+ attribute :"change-month", :type => Spider::Bool, :default => false
10
+ attribute :"change-year", :type => Spider::Bool, :default => false
11
+ attribute :"year-range", :type => String, :default => "150:10"
9
12
 
10
13
  def prepare_value(val)
11
14
  return val if val.respond_to?(:strftime)
@@ -31,6 +34,12 @@ module Spider; module Forms
31
34
  when :time then 8
32
35
  end
33
36
  end
37
+ @additional_classes = []
38
+ @additional_classes << 'change-month' if @attributes[:"change-month"]
39
+ @additional_classes << 'change-year' if @attributes[:"change-year"]
40
+ yr = @attributes[:"year-range"].sub('-', 'm').sub('+', 'p').sub(':', '-') if @attributes[:"change-year"]
41
+ @additional_classes << "year-range-#{yr}" if yr
42
+ @scene.additional_classes = @additional_classes
34
43
  super
35
44
  end
36
45
 
@@ -2,5 +2,5 @@
2
2
  <tpl:asset type="js" src="input.js" />
3
3
  <tpl:asset name="jquery-ui-datepicker" />
4
4
  <tpl:asset type="js" src="date_time.js" />
5
- <input type="text" name="{ @name }" value="{ @formatted_value }" size="{ @size }" class="{ @mode }">
5
+ <input type="text" name="{ @name }" value="{ @formatted_value }" size="{ @size }" class="{ @mode } { @additional_classes.join(' ') }">
6
6
  </sp:template>
@@ -1,11 +1,11 @@
1
1
  <div>
2
+ <tpl:asset type="js" src="ckeditor/ckeditor.js" compressed="true" copy_dir="true"/>
3
+ <tpl:asset type="js" src="ckeditor/adapters/jquery.js" compressed="true" />
2
4
  <tpl:asset name="jquery" />
3
5
  <tpl:asset type="js" src="input.js" />
4
6
  <tpl:asset type="js" src="html_area.js" /><tpl:asset type="js" src="text_area.js" />
5
7
  <!--- <tpl:asset type="css" src="jwysiwyg/jquery.wysiwyg.css" />
6
8
  <tpl:asset type="js" src="jwysiwyg/jquery.wysiwyg.js" /> -->
7
- <tpl:asset type="js" src="ckeditor/ckeditor.js" compressed="true"/>
8
- <tpl:asset type="js" src="ckeditor/adapters/jquery.js" />
9
9
  <div class="initial_html" style="display:none">{ @initial_html }</div>
10
10
  <div class="css" style="display:none">{ @css }</div>
11
11
  <div class="options" style="display:none">{ @options }</div>
@@ -7,9 +7,6 @@ module Spider; module Forms
7
7
  is_attr_accessor :label
8
8
  is_attr_accessor :required, :type => Spider::DataTypes::Bool
9
9
 
10
- def self.template_path_parent
11
- File.dirname(File.dirname(__FILE__))
12
- end
13
10
 
14
11
  def init
15
12
  @done = true
@@ -1,8 +1,8 @@
1
1
  <select name="{ @value_param }" sp:attr-if="@multiple,multiple" title="">
2
2
  <tpl:asset type="js" src="input.js" />
3
3
  <tpl:asset type="js" src="select.js" />
4
- <tpl:asset type="js" app="core/components" src="js/jquery/plugins/asmselect/jquery.asmselect.js" if="@multiple" />
5
- <tpl:asset type="css" app="core/components" src="js/jquery/plugins/asmselect/jquery.asmselect.css" if="@multiple" />
4
+ <tpl:asset type="js" app="core/components" src="js/jquery/plugins/bsmselect/js/jquery.bsmselect.js" if="@multiple" />
5
+ <tpl:asset type="css" app="core/components" src="js/jquery/plugins/bsmselect/css/jquery.bsmselect.css" if="@multiple" />
6
6
  <option sp:if="@blank_option"> </option>
7
7
  <option sp:each_index="@data |i|" value="{ @values[i] }" sp:attr-if="@selected[values[i]],selected">
8
8
  { @data[i].to_s }
@@ -0,0 +1,20 @@
1
+ require 'apps/messenger/lib/email_backend'
2
+
3
+ module Spider; module Messenger; module Backends; module Email
4
+
5
+ module Sendmail
6
+ include Messenger::EmailBackend
7
+
8
+ def self.send_message(msg)
9
+ Spider.logger.debug("Sending e-mail #{msg.ticket}")
10
+ mail = prepare_mail(msg)
11
+ mail.delivery_method :sendmail
12
+ mail.deliver
13
+ return true
14
+ end
15
+
16
+
17
+
18
+ end
19
+
20
+ end; end; end; end
@@ -1,5 +1,4 @@
1
1
  require 'apps/messenger/lib/email_backend'
2
- require 'net/smtp'
3
2
 
4
3
  module Spider; module Messenger; module Backends; module Email
5
4
 
@@ -8,19 +7,18 @@ module Spider; module Messenger; module Backends; module Email
8
7
 
9
8
  def self.send_message(msg)
10
9
  Spider.logger.debug("Sending e-mail #{msg.ticket}")
11
- res = false
12
- Net::SMTP.start(
13
- Spider.conf.get('messenger.smtp.address'),
14
- Spider.conf.get('messenger.smpt.port'),
15
- Spider.conf.get('messenger.smtp.domain'),
16
- Spider.conf.get('messenger.smtp.username'),
17
- Spider.conf.get('messenger.smtp.password'),
18
- Spider.conf.get('messenger.smtp.auth_scheme')
19
- ) do |smtp|
20
- msg_str = msg.headers+"\r\n\r\n"+msg.body
21
- res = smtp.send_message msg_str, msg.from, msg.to
22
- end
23
- return res.string
10
+ mail = prepare_mail(msg)
11
+ mail.delivery_method :smtp, {
12
+ :address => Spider.conf.get('messenger.smtp.address'),
13
+ :port => Spider.conf.get('messenger.smpt.port'),
14
+ :domain => Spider.conf.get('messenger.smtp.domain'),
15
+ :user_name => Spider.conf.get('messenger.smtp.username'),
16
+ :password => Spider.conf.get('messenger.smtp.password'),
17
+ :authentication => Spider.conf.get('messenger.smtp.auth_scheme'),
18
+ :enable_starttls_auto => Spider.conf.get('messenger.smpt.enable_starttls_auto')
19
+ }
20
+ mail.deliver
21
+ return true
24
22
  end
25
23
 
26
24
  def self.update_statuses
@@ -0,0 +1,20 @@
1
+ require 'apps/messenger/lib/email_backend'
2
+
3
+ module Spider; module Messenger; module Backends; module Email
4
+
5
+ module Test
6
+ include Messenger::EmailBackend
7
+
8
+ def self.send_message(msg)
9
+ Spider.logger.debug("Sending e-mail #{msg.ticket}")
10
+ res = false
11
+ mail = prepare_mail(msg)
12
+ mail.delivery_method :test
13
+ mail.deliver
14
+ end
15
+
16
+
17
+
18
+ end
19
+
20
+ end; end; end; end
@@ -7,6 +7,7 @@ module Spider
7
7
  config_option 'messenger.smtp.password', _("SMTP authentication password"), :default => nil
8
8
  config_option 'messenger.smtp.auth_scheme', _("SMTP authentication scheme"), :default => nil, :type => Symbol,
9
9
  :choices => [nil, :plain, :login, :cram_md5]
10
+ config_option 'messenger.smpt.enable_starttls_auto', _("Automatically start TLS for SMTP"), :default => false, :type => Spider::Bool
10
11
  config_option 'messenger.smtp.log_path', _("Smtp logfile (e.g. /var/log/mail.log)"), :default => nil
11
12
 
12
13
  config_option 'messenger.email.retries', _("How many times to retry sending an e-mail"), :type => Fixnum, :default => 5
@@ -14,15 +15,13 @@ module Spider
14
15
  :type => Fixnum, :default => 10
15
16
  config_option 'messenger.queue.run_every', _("Time in seconds between queue runs"), :type => Fixnum, :default => 60
16
17
 
17
- config_option 'messenger.email.backends', _("The backends to use for sending mail (if more than one)"), :type => Array, :default => ['smtp']
18
- config_option 'messenger.email.backend', _("The backend to use for sending sms"), :type => String, :do => lambda{ |val|
19
- Spider.conf.set('messenger.email.backends', [val])
20
- }
18
+ config_option 'messenger.email.backends', _("The backends to use for sending mail (if more than one)"), :type => Array,
19
+ :default => lambda{ Spider.conf.get('messenger.email.backend') ? [Spider.conf.get('messenger.email.backend')] : [] }
20
+ config_option 'messenger.email.backend', _("The backend to use for sending sms"), :type => String, :default => 'smtp'
21
21
 
22
- config_option 'messenger.sms.backends', _("The backends to use for sending sms (if more than one)"), :type => Array, :default => []
23
- config_option 'messenger.sms.backend', _("The backend to use for sending sms"), :type => String, :do => lambda{ |val|
24
- Spider.conf.set('messenger.sms.backends', [val])
25
- }
22
+ config_option 'messenger.sms.backends', _("The backends to use for sending sms (if more than one)"), :type => Array,
23
+ :default => lambda{ Spider.conf.get('messenger.sms.backend') ? [Spider.conf.get('messenger.sms.backend')] : [] }
24
+ config_option 'messenger.sms.backend', _("The backend to use for sending sms"), :type => String
26
25
  config_option 'messenger.sms.retries', _("How many times to retry sending an sms"), :type => Fixnum, :default => 5
27
26
  config_option 'messenger.sms.retry_time', _("Seconds to wait until retry (will be incremented at each retry)"),
28
27
  :type => Fixnum, :default => 10
@@ -38,6 +37,7 @@ module Spider
38
37
  config_option 'messenger.smstools.remove_sent', _("Whether to remove failed messages from the smstools sent folder"),
39
38
  :type => Spider::Bool, :default => true
40
39
  config_option 'messenger.smstools.log_path', _("Smsd logfile"), :default => '/var/log/smsd.log'
41
-
40
+ config_option 'messenger.send_immediate', _("Send messages right after the controller action instead of waiting for worker"),
41
+ :type => Spider::Bool, :default => true
42
42
 
43
43
  end
@@ -0,0 +1,2 @@
1
+ set test:
2
+ messenger.email.backend: test
@@ -1,5 +1,5 @@
1
1
  require 'erb'
2
- require 'mailfactory'
2
+ require 'mail'
3
3
 
4
4
  Spider.register_resource_type(:email, :extensions => ['erb'], :path => 'templates/email')
5
5
 
@@ -11,14 +11,20 @@ module Spider; module Messenger
11
11
  # #Messenger::email
12
12
  # template is the template name (found in templates/email), without the extension
13
13
  # will use template.html.erb and template.txt.erb if they exist, template.erb otherwise.
14
- # attachments must be an array of hashes like
15
- # {:file => '/full/file/path', :type => 'mime type', :file_name => 'optional email file name',
16
- # :headers => 'optional string or array of additional headers'}
14
+ # attachments must be an array, which items can be strings (the path to the file)
15
+ # or Hashes:
16
+ # {:filename => 'filename.png', :content => File.read('/path/to/file.jpg'),
17
+ # :mime_type => 'mime/type'}
18
+ # Attachments will be passed to the Mail gem (https://github.com/mikel/mail), so any syntax allowed by Mail
19
+ # can be used
17
20
  def send_email(template, scene, from, to, headers={}, attachments=[], params={})
18
21
  klass = self.class if self.class.respond_to?(:find_resouce_path)
19
22
  klass ||= self.class.app if self.class.respond_to?(:app)
20
23
  klass ||= Spider.home
21
- Spider::Messenger::MessengerHelper.send_email(klass, template, scene, from, to, headers, attachments, params)
24
+ msg = Spider::Messenger::MessengerHelper.send_email(klass, template, scene, from, to, headers, attachments, params)
25
+ @messenger_sent ||= {}
26
+ @messenger_sent[:email] ||= []
27
+ @messenger_sent[:email] << msg.ticket
22
28
  end
23
29
 
24
30
  def self.send_email(klass, template, scene, from, to, headers={}, attachments=[], params={})
@@ -34,20 +40,33 @@ module Spider; module Messenger
34
40
  path = klass.find_resource_path(:email, template)
35
41
  text = ERB.new(IO.read(path)).result(scene_binding)
36
42
  end
37
- mail = MailFactory.new
38
- mail.To = to
39
- mail.From = from
43
+ mail = Mail.new
44
+ mail[:to] = to
45
+ mail[:from] = from
46
+ mail.charset = "UTF-8"
40
47
  headers.each do |key, value|
41
- mail.add_header(key, value)
48
+ mail[key] = value
42
49
  end
43
- mail.html = html if html
44
- mail.text = text if text
45
- if (attachments && !attachments.empty?)
50
+
51
+ if html
52
+ mail.text_part do
53
+ body text
54
+ end
55
+ mail.html_part do
56
+ content_type 'text/html; charset=UTF-8'
57
+ body html
58
+ end
59
+ else
60
+ mail.body = text
61
+ end
62
+
63
+ if attachments && !attachments.empty?
46
64
  attachments.each do |att|
47
- if (att[:file_name])
48
- mail.add_attachment_as(att[:file], att[:file_name], att[:type], att[:headers])
65
+ if att.is_a?(Hash)
66
+ filename = att.delete(:filename)
67
+ mail.attachments[filename] = att
49
68
  else
50
- mail.add_attachment(att[:file], att[:type], att[:headers])
69
+ mail.add_file(att)
51
70
  end
52
71
  end
53
72
  end
@@ -55,6 +74,13 @@ module Spider; module Messenger
55
74
  mail_headers += "\r\n"
56
75
  Messenger.email(from, to, mail_headers, mail_body, params)
57
76
  end
77
+
78
+ def after(action='', *params)
79
+ return super unless Spider.conf.get('messenger.send_immediate') && @messenger_sent
80
+ Spider::Messenger.process_queue(:email, @messenger_sent[:email]) if @messenger_sent[:email]
81
+ Spider::Messenger.process_queue(:sms, @messenger_sent[:sms]) if @messenger_sent[:sms]
82
+ end
83
+
58
84
  end
59
85
 
60
86
  end; end