lipsiadmin 2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (467) hide show
  1. data/CHANGELOG +90 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README +60 -0
  4. data/Rakefile +90 -0
  5. data/init.rb +1 -0
  6. data/lib/access_control/authentication.rb +105 -0
  7. data/lib/access_control/base.rb +227 -0
  8. data/lib/controller/ext.rb +168 -0
  9. data/lib/controller/lipsiadmin_controller.rb +18 -0
  10. data/lib/controller/pdf_builder.rb +67 -0
  11. data/lib/controller/rescue.rb +72 -0
  12. data/lib/controller/responds_to_parent.rb +56 -0
  13. data/lib/data_base/attachment.rb +351 -0
  14. data/lib/data_base/attachment/attach.rb +515 -0
  15. data/lib/data_base/attachment/geometry.rb +117 -0
  16. data/lib/data_base/attachment/iostream.rb +62 -0
  17. data/lib/data_base/attachment/processor.rb +49 -0
  18. data/lib/data_base/attachment/storage.rb +223 -0
  19. data/lib/data_base/attachment/thumbnail.rb +72 -0
  20. data/lib/data_base/attachment/upfile.rb +45 -0
  21. data/lib/data_base/attachment_table.rb +142 -0
  22. data/lib/data_base/translate_attributes.rb +30 -0
  23. data/lib/data_base/utility_scopes.rb +40 -0
  24. data/lib/data_base/without_table.rb +62 -0
  25. data/lib/generator.rb +114 -0
  26. data/lib/lipsiadmin.rb +77 -0
  27. data/lib/lipsiadmin_tasks.rb +3 -0
  28. data/lib/locale/en.yml +16 -0
  29. data/lib/locale/it.yml +16 -0
  30. data/lib/mailer/exception/exception.html.erb +11 -0
  31. data/lib/mailer/exception_notifier.rb +46 -0
  32. data/lib/mailer/pdf_builder.rb +66 -0
  33. data/lib/utils/html_entities.rb +63 -0
  34. data/lib/utils/literal.rb +20 -0
  35. data/lib/version.rb +9 -0
  36. data/lib/view/helpers/active_record_helper.rb +11 -0
  37. data/lib/view/helpers/backend_helper.rb +132 -0
  38. data/lib/view/helpers/ext/column_model.rb +73 -0
  39. data/lib/view/helpers/ext/component.rb +163 -0
  40. data/lib/view/helpers/ext/configuration.rb +36 -0
  41. data/lib/view/helpers/ext/grid.rb +281 -0
  42. data/lib/view/helpers/ext/store.rb +103 -0
  43. data/lib/view/helpers/ext/templates/grid_functions.js.erb +51 -0
  44. data/lib/view/helpers/ext/tool_bar.rb +40 -0
  45. data/lib/view/helpers/ext_helper.rb +150 -0
  46. data/lib/view/helpers/view_helper.rb +222 -0
  47. data/lipsiadmin_generators/attachment/REMEMBER +21 -0
  48. data/lipsiadmin_generators/attachment/attachment_generator.rb +27 -0
  49. data/lipsiadmin_generators/attachment/templates/migration.rb +14 -0
  50. data/lipsiadmin_generators/attachment/templates/model.rb +4 -0
  51. data/lipsiadmin_generators/backend/REMEMBER +18 -0
  52. data/lipsiadmin_generators/backend/backend_generator.rb +58 -0
  53. data/lipsiadmin_generators/backend/templates/config/config.yml +14 -0
  54. data/lipsiadmin_generators/backend/templates/config/initializers/config.rb +7 -0
  55. data/lipsiadmin_generators/backend/templates/config/initializers/emails.rb +2 -0
  56. data/lipsiadmin_generators/backend/templates/config/initializers/exception_notifier.rb +7 -0
  57. data/lipsiadmin_generators/backend/templates/config/locales/backend/en.yml +204 -0
  58. data/lipsiadmin_generators/backend/templates/config/locales/backend/it.yml +203 -0
  59. data/lipsiadmin_generators/backend/templates/config/locales/frontend/en.yml +5 -0
  60. data/lipsiadmin_generators/backend/templates/config/locales/frontend/it.yml +5 -0
  61. data/lipsiadmin_generators/backend/templates/config/locales/models/en.yml +31 -0
  62. data/lipsiadmin_generators/backend/templates/config/locales/models/it.yml +23 -0
  63. data/lipsiadmin_generators/backend/templates/config/locales/rails/en.yml +148 -0
  64. data/lipsiadmin_generators/backend/templates/config/locales/rails/it.yml +109 -0
  65. data/lipsiadmin_generators/backend/templates/controllers/backend/accounts_controller.rb +53 -0
  66. data/lipsiadmin_generators/backend/templates/controllers/backend/base_controller.rb +8 -0
  67. data/lipsiadmin_generators/backend/templates/controllers/backend/sessions_controller.rb +21 -0
  68. data/lipsiadmin_generators/backend/templates/controllers/backend_controller.rb +2 -0
  69. data/lipsiadmin_generators/backend/templates/controllers/frontend_controller.rb +4 -0
  70. data/lipsiadmin_generators/backend/templates/controllers/javascripts_controller.rb +17 -0
  71. data/lipsiadmin_generators/backend/templates/exceptions/template.html.haml +5 -0
  72. data/lipsiadmin_generators/backend/templates/helpers/backend_helper.rb +2 -0
  73. data/lipsiadmin_generators/backend/templates/helpers/frontend_helper.rb +2 -0
  74. data/lipsiadmin_generators/backend/templates/images/backend/back.gif +0 -0
  75. data/lipsiadmin_generators/backend/templates/images/backend/background.png +0 -0
  76. data/lipsiadmin_generators/backend/templates/images/backend/bg-content.png +0 -0
  77. data/lipsiadmin_generators/backend/templates/images/backend/bg-hd-slate.png +0 -0
  78. data/lipsiadmin_generators/backend/templates/images/backend/bg-hd.png +0 -0
  79. data/lipsiadmin_generators/backend/templates/images/backend/bg-intro.png +0 -0
  80. data/lipsiadmin_generators/backend/templates/images/backend/bg-login.png +0 -0
  81. data/lipsiadmin_generators/backend/templates/images/backend/bg-menu-slate.png +0 -0
  82. data/lipsiadmin_generators/backend/templates/images/backend/bg-menu.png +0 -0
  83. data/lipsiadmin_generators/backend/templates/images/backend/bg.png +0 -0
  84. data/lipsiadmin_generators/backend/templates/images/backend/btn-login.png +0 -0
  85. data/lipsiadmin_generators/backend/templates/images/backend/delete.gif +0 -0
  86. data/lipsiadmin_generators/backend/templates/images/backend/download.gif +0 -0
  87. data/lipsiadmin_generators/backend/templates/images/backend/duplicate.gif +0 -0
  88. data/lipsiadmin_generators/backend/templates/images/backend/edit.gif +0 -0
  89. data/lipsiadmin_generators/backend/templates/images/backend/hd-bg-slate.gif +0 -0
  90. data/lipsiadmin_generators/backend/templates/images/backend/hd-bg.gif +0 -0
  91. data/lipsiadmin_generators/backend/templates/images/backend/it.gif +0 -0
  92. data/lipsiadmin_generators/backend/templates/images/backend/loader.gif +0 -0
  93. data/lipsiadmin_generators/backend/templates/images/backend/logo-loader.png +0 -0
  94. data/lipsiadmin_generators/backend/templates/images/backend/logo-small.png +0 -0
  95. data/lipsiadmin_generators/backend/templates/images/backend/new.gif +0 -0
  96. data/lipsiadmin_generators/backend/templates/images/backend/no-image.png +0 -0
  97. data/lipsiadmin_generators/backend/templates/images/backend/preview.gif +0 -0
  98. data/lipsiadmin_generators/backend/templates/images/backend/print.gif +0 -0
  99. data/lipsiadmin_generators/backend/templates/images/backend/save.gif +0 -0
  100. data/lipsiadmin_generators/backend/templates/images/backend/support.gif +0 -0
  101. data/lipsiadmin_generators/backend/templates/images/backend/us.gif +0 -0
  102. data/lipsiadmin_generators/backend/templates/images/ext/default/box/corners-blue.gif +0 -0
  103. data/lipsiadmin_generators/backend/templates/images/ext/default/box/corners.gif +0 -0
  104. data/lipsiadmin_generators/backend/templates/images/ext/default/box/l-blue.gif +0 -0
  105. data/lipsiadmin_generators/backend/templates/images/ext/default/box/l.gif +0 -0
  106. data/lipsiadmin_generators/backend/templates/images/ext/default/box/r-blue.gif +0 -0
  107. data/lipsiadmin_generators/backend/templates/images/ext/default/box/r.gif +0 -0
  108. data/lipsiadmin_generators/backend/templates/images/ext/default/box/tb-blue.gif +0 -0
  109. data/lipsiadmin_generators/backend/templates/images/ext/default/box/tb-slate.gif +0 -0
  110. data/lipsiadmin_generators/backend/templates/images/ext/default/box/tb.gif +0 -0
  111. data/lipsiadmin_generators/backend/templates/images/ext/default/button/btn-arrow.gif +0 -0
  112. data/lipsiadmin_generators/backend/templates/images/ext/default/button/btn-sprite.gif +0 -0
  113. data/lipsiadmin_generators/backend/templates/images/ext/default/dd/drop-add.gif +0 -0
  114. data/lipsiadmin_generators/backend/templates/images/ext/default/dd/drop-no.gif +0 -0
  115. data/lipsiadmin_generators/backend/templates/images/ext/default/dd/drop-yes.gif +0 -0
  116. data/lipsiadmin_generators/backend/templates/images/ext/default/editor/tb-sprite.gif +0 -0
  117. data/lipsiadmin_generators/backend/templates/images/ext/default/form/clear-trigger.gif +0 -0
  118. data/lipsiadmin_generators/backend/templates/images/ext/default/form/clear-trigger.psd +0 -0
  119. data/lipsiadmin_generators/backend/templates/images/ext/default/form/date-trigger.gif +0 -0
  120. data/lipsiadmin_generators/backend/templates/images/ext/default/form/date-trigger.psd +0 -0
  121. data/lipsiadmin_generators/backend/templates/images/ext/default/form/error-tip-corners.gif +0 -0
  122. data/lipsiadmin_generators/backend/templates/images/ext/default/form/exclamation.gif +0 -0
  123. data/lipsiadmin_generators/backend/templates/images/ext/default/form/search-trigger.gif +0 -0
  124. data/lipsiadmin_generators/backend/templates/images/ext/default/form/search-trigger.psd +0 -0
  125. data/lipsiadmin_generators/backend/templates/images/ext/default/form/text-bg.gif +0 -0
  126. data/lipsiadmin_generators/backend/templates/images/ext/default/form/trigger-tpl.gif +0 -0
  127. data/lipsiadmin_generators/backend/templates/images/ext/default/form/trigger.gif +0 -0
  128. data/lipsiadmin_generators/backend/templates/images/ext/default/form/trigger.psd +0 -0
  129. data/lipsiadmin_generators/backend/templates/images/ext/default/gradient-bg.gif +0 -0
  130. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/Thumbs.db +0 -0
  131. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/arrow-left-white.gif +0 -0
  132. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/arrow-right-white.gif +0 -0
  133. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/col-move-bottom.gif +0 -0
  134. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/col-move-top.gif +0 -0
  135. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/columns.gif +0 -0
  136. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/dirty.gif +0 -0
  137. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/done.gif +0 -0
  138. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/drop-no.gif +0 -0
  139. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/drop-yes.gif +0 -0
  140. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/footer-bg.gif +0 -0
  141. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid-blue-hd.gif +0 -0
  142. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid-blue-split.gif +0 -0
  143. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid-hrow.gif +0 -0
  144. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid-loading.gif +0 -0
  145. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid-split.gif +0 -0
  146. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid-vista-hd.gif +0 -0
  147. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid3-hd-btn.gif +0 -0
  148. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid3-hrow-over.gif +0 -0
  149. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid3-hrow.gif +0 -0
  150. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid3-special-col-bg.gif +0 -0
  151. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid3-special-col-sel-bg.gif +0 -0
  152. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/group-by.gif +0 -0
  153. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/group-expand-sprite.gif +0 -0
  154. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/hd-pop.gif +0 -0
  155. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/hmenu-asc.gif +0 -0
  156. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/hmenu-desc.gif +0 -0
  157. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/hmenu-lock.gif +0 -0
  158. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/hmenu-lock.png +0 -0
  159. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/hmenu-unlock.gif +0 -0
  160. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/hmenu-unlock.png +0 -0
  161. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/invalid_line.gif +0 -0
  162. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/loading.gif +0 -0
  163. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/mso-hd.gif +0 -0
  164. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/nowait.gif +0 -0
  165. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-first-disabled.gif +0 -0
  166. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-first.gif +0 -0
  167. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-last-disabled.gif +0 -0
  168. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-last.gif +0 -0
  169. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-next-disabled.gif +0 -0
  170. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-next.gif +0 -0
  171. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-prev-disabled.gif +0 -0
  172. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-prev.gif +0 -0
  173. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/pick-button.gif +0 -0
  174. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/refresh.gif +0 -0
  175. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/row-check-sprite.gif +0 -0
  176. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/row-expand-sprite.gif +0 -0
  177. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/row-over.gif +0 -0
  178. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/row-sel.gif +0 -0
  179. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/sort_asc.gif +0 -0
  180. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/sort_desc.gif +0 -0
  181. data/lipsiadmin_generators/backend/templates/images/ext/default/grid/wait.gif +0 -0
  182. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/collapse.gif +0 -0
  183. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/expand.gif +0 -0
  184. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/gradient-bg.gif +0 -0
  185. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/mini-bottom.gif +0 -0
  186. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/mini-left.gif +0 -0
  187. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/mini-right.gif +0 -0
  188. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/mini-top.gif +0 -0
  189. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/ns-collapse.gif +0 -0
  190. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/ns-expand.gif +0 -0
  191. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/panel-close.gif +0 -0
  192. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/panel-title-bg.gif +0 -0
  193. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/panel-title-light-bg.gif +0 -0
  194. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/stick.gif +0 -0
  195. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/stuck.gif +0 -0
  196. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/tab-close-on.gif +0 -0
  197. data/lipsiadmin_generators/backend/templates/images/ext/default/layout/tab-close.gif +0 -0
  198. data/lipsiadmin_generators/backend/templates/images/ext/default/menu/checked.gif +0 -0
  199. data/lipsiadmin_generators/backend/templates/images/ext/default/menu/group-checked.gif +0 -0
  200. data/lipsiadmin_generators/backend/templates/images/ext/default/menu/item-over.gif +0 -0
  201. data/lipsiadmin_generators/backend/templates/images/ext/default/menu/menu-parent.gif +0 -0
  202. data/lipsiadmin_generators/backend/templates/images/ext/default/menu/menu.gif +0 -0
  203. data/lipsiadmin_generators/backend/templates/images/ext/default/menu/unchecked.gif +0 -0
  204. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/corners-sprite.gif +0 -0
  205. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/left-right.gif +0 -0
  206. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/light-hd.gif +0 -0
  207. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/tool-sprite-tpl.gif +0 -0
  208. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/tool-sprites.gif +0 -0
  209. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/tools-sprites-trans.gif +0 -0
  210. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/top-bottom.gif +0 -0
  211. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/top-bottom.png +0 -0
  212. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/white-corners-sprite.gif +0 -0
  213. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/white-left-right.gif +0 -0
  214. data/lipsiadmin_generators/backend/templates/images/ext/default/panel/white-top-bottom.gif +0 -0
  215. data/lipsiadmin_generators/backend/templates/images/ext/default/progress/progress-bg.gif +0 -0
  216. data/lipsiadmin_generators/backend/templates/images/ext/default/qtip/bg.gif +0 -0
  217. data/lipsiadmin_generators/backend/templates/images/ext/default/qtip/close.gif +0 -0
  218. data/lipsiadmin_generators/backend/templates/images/ext/default/qtip/tip-sprite.gif +0 -0
  219. data/lipsiadmin_generators/backend/templates/images/ext/default/s.gif +0 -0
  220. data/lipsiadmin_generators/backend/templates/images/ext/default/shadow-c.png +0 -0
  221. data/lipsiadmin_generators/backend/templates/images/ext/default/shadow-lr.png +0 -0
  222. data/lipsiadmin_generators/backend/templates/images/ext/default/shadow.png +0 -0
  223. data/lipsiadmin_generators/backend/templates/images/ext/default/shared/blue-loading.gif +0 -0
  224. data/lipsiadmin_generators/backend/templates/images/ext/default/shared/calendar.gif +0 -0
  225. data/lipsiadmin_generators/backend/templates/images/ext/default/shared/glass-bg.gif +0 -0
  226. data/lipsiadmin_generators/backend/templates/images/ext/default/shared/hd-sprite.gif +0 -0
  227. data/lipsiadmin_generators/backend/templates/images/ext/default/shared/large-loading.gif +0 -0
  228. data/lipsiadmin_generators/backend/templates/images/ext/default/shared/left-btn.gif +0 -0
  229. data/lipsiadmin_generators/backend/templates/images/ext/default/shared/loading-balls.gif +0 -0
  230. data/lipsiadmin_generators/backend/templates/images/ext/default/shared/right-btn.gif +0 -0
  231. data/lipsiadmin_generators/backend/templates/images/ext/default/shared/warning.gif +0 -0
  232. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/e-handle-dark.gif +0 -0
  233. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/e-handle.gif +0 -0
  234. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/ne-handle-dark.gif +0 -0
  235. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/ne-handle.gif +0 -0
  236. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/nw-handle-dark.gif +0 -0
  237. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/nw-handle.gif +0 -0
  238. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/s-handle-dark.gif +0 -0
  239. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/s-handle.gif +0 -0
  240. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/se-handle-dark.gif +0 -0
  241. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/se-handle.gif +0 -0
  242. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/square.gif +0 -0
  243. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/sw-handle-dark.gif +0 -0
  244. data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/sw-handle.gif +0 -0
  245. data/lipsiadmin_generators/backend/templates/images/ext/default/slider/slider-bg.png +0 -0
  246. data/lipsiadmin_generators/backend/templates/images/ext/default/slider/slider-thumb.png +0 -0
  247. data/lipsiadmin_generators/backend/templates/images/ext/default/slider/slider-v-bg.png +0 -0
  248. data/lipsiadmin_generators/backend/templates/images/ext/default/slider/slider-v-thumb.png +0 -0
  249. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/scroll-left.gif +0 -0
  250. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/scroll-right.gif +0 -0
  251. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/scroller-bg.gif +0 -0
  252. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-btm-inactive-left-bg.gif +0 -0
  253. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-btm-inactive-right-bg.gif +0 -0
  254. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-btm-left-bg.gif +0 -0
  255. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-btm-right-bg.gif +0 -0
  256. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-close.gif +0 -0
  257. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-strip-bg.gif +0 -0
  258. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-strip-bg.png +0 -0
  259. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-strip-btm-bg.gif +0 -0
  260. data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tabs-sprite.gif +0 -0
  261. data/lipsiadmin_generators/backend/templates/images/ext/default/toolbar/bg.gif +0 -0
  262. data/lipsiadmin_generators/backend/templates/images/ext/default/toolbar/btn-arrow-light.gif +0 -0
  263. data/lipsiadmin_generators/backend/templates/images/ext/default/toolbar/btn-arrow.gif +0 -0
  264. data/lipsiadmin_generators/backend/templates/images/ext/default/toolbar/btn-over-bg.gif +0 -0
  265. data/lipsiadmin_generators/backend/templates/images/ext/default/toolbar/gray-bg.gif +0 -0
  266. data/lipsiadmin_generators/backend/templates/images/ext/default/toolbar/tb-bg.gif +0 -0
  267. data/lipsiadmin_generators/backend/templates/images/ext/default/toolbar/tb-btn-sprite.gif +0 -0
  268. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/arrows.gif +0 -0
  269. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/drop-add.gif +0 -0
  270. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/drop-between.gif +0 -0
  271. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/drop-no.gif +0 -0
  272. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/drop-over.gif +0 -0
  273. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/drop-under.gif +0 -0
  274. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/drop-yes.gif +0 -0
  275. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-end-minus-nl.gif +0 -0
  276. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-end-minus.gif +0 -0
  277. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-end-plus-nl.gif +0 -0
  278. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-end-plus.gif +0 -0
  279. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-end.gif +0 -0
  280. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-line.gif +0 -0
  281. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-minus-nl.gif +0 -0
  282. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-minus.gif +0 -0
  283. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-plus-nl.gif +0 -0
  284. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-plus.gif +0 -0
  285. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow.gif +0 -0
  286. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/folder-open.gif +0 -0
  287. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/folder.gif +0 -0
  288. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/leaf.gif +0 -0
  289. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/loading.gif +0 -0
  290. data/lipsiadmin_generators/backend/templates/images/ext/default/tree/s.gif +0 -0
  291. data/lipsiadmin_generators/backend/templates/images/ext/default/window/icon-error.gif +0 -0
  292. data/lipsiadmin_generators/backend/templates/images/ext/default/window/icon-info.gif +0 -0
  293. data/lipsiadmin_generators/backend/templates/images/ext/default/window/icon-question.gif +0 -0
  294. data/lipsiadmin_generators/backend/templates/images/ext/default/window/icon-warning.gif +0 -0
  295. data/lipsiadmin_generators/backend/templates/images/ext/default/window/left-corners.png +0 -0
  296. data/lipsiadmin_generators/backend/templates/images/ext/default/window/left-corners.psd +0 -0
  297. data/lipsiadmin_generators/backend/templates/images/ext/default/window/left-right.png +0 -0
  298. data/lipsiadmin_generators/backend/templates/images/ext/default/window/left-right.psd +0 -0
  299. data/lipsiadmin_generators/backend/templates/images/ext/default/window/right-corners.png +0 -0
  300. data/lipsiadmin_generators/backend/templates/images/ext/default/window/right-corners.psd +0 -0
  301. data/lipsiadmin_generators/backend/templates/images/ext/default/window/top-bottom.png +0 -0
  302. data/lipsiadmin_generators/backend/templates/images/ext/default/window/top-bottom.psd +0 -0
  303. data/lipsiadmin_generators/backend/templates/images/ext/slate/button/btn-arrow.gif +0 -0
  304. data/lipsiadmin_generators/backend/templates/images/ext/slate/button/btn-sprite.gif +0 -0
  305. data/lipsiadmin_generators/backend/templates/images/ext/slate/editor/tb-sprite.gif +0 -0
  306. data/lipsiadmin_generators/backend/templates/images/ext/slate/form/checkbox.gif +0 -0
  307. data/lipsiadmin_generators/backend/templates/images/ext/slate/form/clear-trigger.gif +0 -0
  308. data/lipsiadmin_generators/backend/templates/images/ext/slate/form/date-trigger.gif +0 -0
  309. data/lipsiadmin_generators/backend/templates/images/ext/slate/form/radio.gif +0 -0
  310. data/lipsiadmin_generators/backend/templates/images/ext/slate/form/search-trigger.gif +0 -0
  311. data/lipsiadmin_generators/backend/templates/images/ext/slate/form/trigger-tpl.gif +0 -0
  312. data/lipsiadmin_generators/backend/templates/images/ext/slate/form/trigger.gif +0 -0
  313. data/lipsiadmin_generators/backend/templates/images/ext/slate/gradient-bg.gif +0 -0
  314. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/arrow-left-white.gif +0 -0
  315. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/arrow-right-white.gif +0 -0
  316. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/col-move-bottom.gif +0 -0
  317. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/col-move-top.gif +0 -0
  318. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/footer-bg.gif +0 -0
  319. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid-blue-hd.gif +0 -0
  320. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid-blue-split.gif +0 -0
  321. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid-hrow.gif +0 -0
  322. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid-split.gif +0 -0
  323. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid-vista-hd.gif +0 -0
  324. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid3-hd-btn.gif +0 -0
  325. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid3-hrow-over.gif +0 -0
  326. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid3-hrow.gif +0 -0
  327. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid3-special-col-bg.gif +0 -0
  328. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid3-special-col-sel-bg.gif +0 -0
  329. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/group-expand-sprite.gif +0 -0
  330. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/mso-hd.gif +0 -0
  331. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-first-disabled.gif +0 -0
  332. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-first.gif +0 -0
  333. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-last-disabled.gif +0 -0
  334. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-last.gif +0 -0
  335. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-next-disabled.gif +0 -0
  336. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-next.gif +0 -0
  337. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-prev-disabled.gif +0 -0
  338. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-prev.gif +0 -0
  339. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/refresh.gif +0 -0
  340. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/row-over.gif +0 -0
  341. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/row-sel.gif +0 -0
  342. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/sort_asc.gif +0 -0
  343. data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/sort_desc.gif +0 -0
  344. data/lipsiadmin_generators/backend/templates/images/ext/slate/menu/checked.gif +0 -0
  345. data/lipsiadmin_generators/backend/templates/images/ext/slate/menu/group-checked.gif +0 -0
  346. data/lipsiadmin_generators/backend/templates/images/ext/slate/menu/item-over - Copy.gif +0 -0
  347. data/lipsiadmin_generators/backend/templates/images/ext/slate/menu/item-over.gif +0 -0
  348. data/lipsiadmin_generators/backend/templates/images/ext/slate/menu/menu-parent.gif +0 -0
  349. data/lipsiadmin_generators/backend/templates/images/ext/slate/menu/menu.gif +0 -0
  350. data/lipsiadmin_generators/backend/templates/images/ext/slate/menu/unchecked.gif +0 -0
  351. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/corners-sprite.gif +0 -0
  352. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/left-right.gif +0 -0
  353. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/light-hd.gif +0 -0
  354. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/tool-sprite-tpl.gif +0 -0
  355. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/tool-sprites.gif +0 -0
  356. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/tools-sprites-trans.gif +0 -0
  357. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/top-bottom.gif +0 -0
  358. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/top-bottom.png +0 -0
  359. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/white-corners-sprite.gif +0 -0
  360. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/white-left-right.gif +0 -0
  361. data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/white-top-bottom.gif +0 -0
  362. data/lipsiadmin_generators/backend/templates/images/ext/slate/progress/progress-bg.gif +0 -0
  363. data/lipsiadmin_generators/backend/templates/images/ext/slate/qtip/bg.gif +0 -0
  364. data/lipsiadmin_generators/backend/templates/images/ext/slate/qtip/close.gif +0 -0
  365. data/lipsiadmin_generators/backend/templates/images/ext/slate/qtip/tip-sprite.gif +0 -0
  366. data/lipsiadmin_generators/backend/templates/images/ext/slate/s.gif +0 -0
  367. data/lipsiadmin_generators/backend/templates/images/ext/slate/shared/glass-bg.gif +0 -0
  368. data/lipsiadmin_generators/backend/templates/images/ext/slate/shared/hd-sprite.gif +0 -0
  369. data/lipsiadmin_generators/backend/templates/images/ext/slate/shared/left-btn.gif +0 -0
  370. data/lipsiadmin_generators/backend/templates/images/ext/slate/shared/right-btn.gif +0 -0
  371. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/e-handle-dark.gif +0 -0
  372. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/e-handle.gif +0 -0
  373. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/ne-handle-dark.gif +0 -0
  374. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/ne-handle.gif +0 -0
  375. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/nw-handle-dark.gif +0 -0
  376. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/nw-handle.gif +0 -0
  377. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/s-handle-dark.gif +0 -0
  378. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/s-handle.gif +0 -0
  379. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/se-handle-dark.gif +0 -0
  380. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/se-handle.gif +0 -0
  381. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/square.gif +0 -0
  382. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/sw-handle-dark.gif +0 -0
  383. data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/sw-handle.gif +0 -0
  384. data/lipsiadmin_generators/backend/templates/images/ext/slate/slider/slider-bg.png +0 -0
  385. data/lipsiadmin_generators/backend/templates/images/ext/slate/slider/slider-thumb.png +0 -0
  386. data/lipsiadmin_generators/backend/templates/images/ext/slate/slider/slider-v-bg.png +0 -0
  387. data/lipsiadmin_generators/backend/templates/images/ext/slate/slider/slider-v-thumb.png +0 -0
  388. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/scroll-left.gif +0 -0
  389. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/scroll-right.gif +0 -0
  390. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/scroller-bg.gif +0 -0
  391. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-btm-inactive-left-bg.gif +0 -0
  392. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-btm-inactive-right-bg.gif +0 -0
  393. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-btm-left-bg.gif +0 -0
  394. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-btm-right-bg.gif +0 -0
  395. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-close.gif +0 -0
  396. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-strip-bg.gif +0 -0
  397. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-strip-bg.png +0 -0
  398. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-strip-btm-bg.gif +0 -0
  399. data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tabs-sprite.gif +0 -0
  400. data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/bg-menu.png +0 -0
  401. data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/bg.gif +0 -0
  402. data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/btn-arrow-light.gif +0 -0
  403. data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/btn-arrow.gif +0 -0
  404. data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/btn-over-bg.gif +0 -0
  405. data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/gray-bg.gif +0 -0
  406. data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/tb-bg.gif +0 -0
  407. data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/tb-btn-sprite.gif +0 -0
  408. data/lipsiadmin_generators/backend/templates/images/ext/slate/tree/arrows.gif +0 -0
  409. data/lipsiadmin_generators/backend/templates/images/ext/slate/window/icon-error.gif +0 -0
  410. data/lipsiadmin_generators/backend/templates/images/ext/slate/window/icon-info.gif +0 -0
  411. data/lipsiadmin_generators/backend/templates/images/ext/slate/window/icon-question.gif +0 -0
  412. data/lipsiadmin_generators/backend/templates/images/ext/slate/window/icon-warning.gif +0 -0
  413. data/lipsiadmin_generators/backend/templates/images/ext/slate/window/left-corners.png +0 -0
  414. data/lipsiadmin_generators/backend/templates/images/ext/slate/window/left-right.png +0 -0
  415. data/lipsiadmin_generators/backend/templates/images/ext/slate/window/right-corners.png +0 -0
  416. data/lipsiadmin_generators/backend/templates/images/ext/slate/window/top-bottom.png +0 -0
  417. data/lipsiadmin_generators/backend/templates/javascripts/controls.js +3 -0
  418. data/lipsiadmin_generators/backend/templates/javascripts/dragdrop.js +3 -0
  419. data/lipsiadmin_generators/backend/templates/javascripts/effects.js +4 -0
  420. data/lipsiadmin_generators/backend/templates/javascripts/ext.js +76 -0
  421. data/lipsiadmin_generators/backend/templates/javascripts/prototype.js +12 -0
  422. data/lipsiadmin_generators/backend/templates/layouts/backend.html.haml +12 -0
  423. data/lipsiadmin_generators/backend/templates/layouts/frontend.html.haml +7 -0
  424. data/lipsiadmin_generators/backend/templates/migrations/create_accounts.rb +20 -0
  425. data/lipsiadmin_generators/backend/templates/models/account.rb +116 -0
  426. data/lipsiadmin_generators/backend/templates/models/account_access.rb +17 -0
  427. data/lipsiadmin_generators/backend/templates/models/notifier.rb +15 -0
  428. data/lipsiadmin_generators/backend/templates/stylesheets/backend-slate.css +105 -0
  429. data/lipsiadmin_generators/backend/templates/stylesheets/backend.css +74 -0
  430. data/lipsiadmin_generators/backend/templates/stylesheets/ext-slate.css +241 -0
  431. data/lipsiadmin_generators/backend/templates/stylesheets/ext.css +904 -0
  432. data/lipsiadmin_generators/backend/templates/stylesheets/login.css +22 -0
  433. data/lipsiadmin_generators/backend/templates/stylesheets/print.css +11 -0
  434. data/lipsiadmin_generators/backend/templates/stylesheets/standard.css +62 -0
  435. data/lipsiadmin_generators/backend/templates/views/backend/accounts/_form.html.haml +21 -0
  436. data/lipsiadmin_generators/backend/templates/views/backend/accounts/edit.html.haml +3 -0
  437. data/lipsiadmin_generators/backend/templates/views/backend/accounts/index.rjs +16 -0
  438. data/lipsiadmin_generators/backend/templates/views/backend/accounts/new.html.haml +3 -0
  439. data/lipsiadmin_generators/backend/templates/views/backend/base/index.html.haml +17 -0
  440. data/lipsiadmin_generators/backend/templates/views/backend/base/welcome.html.haml +2 -0
  441. data/lipsiadmin_generators/backend/templates/views/backend/sessions/new.html.haml +12 -0
  442. data/lipsiadmin_generators/backend/templates/views/javascripts/backend.js.erb +346 -0
  443. data/lipsiadmin_generators/backend/templates/views/javascripts/locale.js.erb +135 -0
  444. data/lipsiadmin_generators/backend/templates/views/notifier/registration.html.erb +2 -0
  445. data/lipsiadmin_generators/backend/templates/views/notifier/support_request.html.erb +1 -0
  446. data/lipsiadmin_generators/backend_page/REMEMBER +7 -0
  447. data/lipsiadmin_generators/backend_page/backend_page_generator.rb +212 -0
  448. data/lipsiadmin_generators/backend_page/templates/controller.rb +61 -0
  449. data/lipsiadmin_generators/backend_page/templates/form.html.haml +5 -0
  450. data/lipsiadmin_generators/backend_page/templates/form_scaffolding.html.haml +1 -0
  451. data/lipsiadmin_generators/backend_page/templates/functional_test.rb +45 -0
  452. data/lipsiadmin_generators/backend_page/templates/helper.rb +2 -0
  453. data/lipsiadmin_generators/backend_page/templates/view_edit.html.haml +3 -0
  454. data/lipsiadmin_generators/backend_page/templates/view_index.rjs.erb +16 -0
  455. data/lipsiadmin_generators/backend_page/templates/view_new.html.haml +3 -0
  456. data/lipsiadmin_generators/pdf/pdf_generator.rb +50 -0
  457. data/lipsiadmin_generators/pdf/templates/layout.html.erb +18 -0
  458. data/lipsiadmin_generators/pdf/templates/stylesheets/print.css +11 -0
  459. data/lipsiadmin_generators/pdf/templates/view.html.haml +7 -0
  460. data/resources/Pd4Ruby.class +0 -0
  461. data/resources/Pd4Ruby.java +52 -0
  462. data/resources/javascripts/ux.js +1102 -0
  463. data/resources/pd4ml.jar +0 -0
  464. data/resources/rdoc/horo.rb +613 -0
  465. data/resources/ss_css2.jar +0 -0
  466. data/tasks/lipsiadmin_tasks.rake +14 -0
  467. metadata +604 -0
@@ -0,0 +1,103 @@
1
+ module Lipsiadmin#:nodoc:
2
+ module Ext#:nodoc:
3
+ # Generate a new Ext.data.GroupingStore
4
+ #
5
+ # Examples:
6
+ #
7
+ # var store = new Ext.data.GroupingStore({
8
+ # reader: new Ext.data.JsonReader({
9
+ # id:'id',
10
+ # totalProperty:'count', root:'results',
11
+ # fields:[{
12
+ # name: "accounts.name"
13
+ # },{
14
+ # name: "accounts.categories.name"
15
+ # },{
16
+ # type: "date",
17
+ # renderer: Ext.util.Format.dateRenderer(),
18
+ # name: "accounts.date",
19
+ # dateFormat: "c"
20
+ # },{
21
+ # type: "date",
22
+ # renderer: Ext.util.Format.dateTimeRenderer(),
23
+ # name: "accounts.datetime",
24
+ # dateFormat: "c"
25
+ # } ]}),
26
+ # proxy: new Ext.data.HttpProxy({ url:'/backend/accounts.json' }),
27
+ # remoteSort: true
28
+ # });
29
+ #
30
+ # grid.store do |store|
31
+ # store.url "/backend/accounts.json"
32
+ # store.add "accounts.name"
33
+ # store.add "accounts.categories.name"
34
+ # store.add "accounts.date", :type => :date
35
+ # store.add "accounts.datetime", :type => :datetime
36
+ # end
37
+ #
38
+ class Store < Component
39
+ attr_accessor :items
40
+
41
+ def initialize(options={}, &block)#:nodoc:
42
+ @items = []
43
+ super("Ext.data.GroupingStore", options, &block)
44
+ remoteSort l(true) if config[:remoteSort].blank?
45
+ baseParams("_method" => "GET") if config[:baseParams].blank?
46
+ end
47
+
48
+ # The url for getting the json data
49
+ def url(value)
50
+ @url = value
51
+ end
52
+
53
+ # This add automatically fields from an array
54
+ def fields(fields)
55
+ fields.each { |options| add(nil, options) }
56
+ end
57
+
58
+ # Add fields to a Ext.data.JsonReader
59
+ #
60
+ # Examples:
61
+ #
62
+ # {
63
+ # type: "date",
64
+ # renderer: Ext.util.Format.dateTimeRenderer(),
65
+ # name: "accounts.datetime",
66
+ # dateFormat: "c"
67
+ # }
68
+ #
69
+ # add "accounts.datetime", :type => :datetime
70
+ #
71
+ def add(name=nil, options={})#:nodoc:
72
+ options[:name] = name if name
73
+ case options[:type]
74
+ when :date then options.merge!({ :type => "date", :dateFormat => "Y-m-d" })
75
+ when :datetime then options.merge!({ :type => "date", :dateFormat => "c" })
76
+ end
77
+ raise ComponentError, "You must provide a Name for all fields" if options[:name].blank?
78
+ @items << Configuration.new(options)
79
+ end
80
+
81
+ # Return the javascript for create a new Ext.data.GroupingStore
82
+ def to_s
83
+ raise ComponentError, "You must provide the correct var the store." if get_var.blank?
84
+ raise ComponentError, "You must provide the url for get the store data." if @url.blank? && config[:proxy].blank?
85
+ raise ComponentError, "You must provide some fields for get build store." if items.blank?
86
+ config[:proxy] = default_proxy if config[:proxy].blank?
87
+ config[:reader] = default_reader if config[:reader].blank?
88
+ super
89
+ end
90
+
91
+ private
92
+ def default_proxy
93
+ l("new Ext.data.HttpProxy(#{Configuration.new(:url => @url).to_s(2)})")
94
+ end
95
+
96
+ def default_reader
97
+ options = { :id => "id", :totalProperty => "count", :root => "results", :fields => l("["+items.collect { |i| i.to_s(3) }.join(",")+"]") }
98
+ l("new Ext.data.JsonReader(#{Configuration.new(options).to_s(2)})")
99
+ end
100
+
101
+ end
102
+ end
103
+ end
@@ -0,0 +1,51 @@
1
+ <%= @sm %>.on('selectionchange', function(){
2
+ var n = <%= @sm %>.getSelected();
3
+ var btns = <%= @tbar %>.items.map;
4
+
5
+ if(!n){
6
+ btns.remove.disable();
7
+ btns.edit.disable();
8
+ return;
9
+ } else {
10
+ btns.remove.enable();
11
+ btns.edit.enable();
12
+ return;
13
+ }
14
+ });
15
+
16
+ function add(){
17
+ Backend.app.load('<%= @new_path.blank? ? "#{@base_path}/new" : @new_path %>');
18
+ }
19
+
20
+ function edit(){
21
+ Backend.app.load('<%= @edit_path || @base_path %>/'+<%= @sm %>.getSelected().id+'/edit');
22
+ }
23
+
24
+ function remove(){
25
+ Ext.Msg.confirm(Backend.locale.messages.confirm.title, String.format(Backend.locale.messages.confirm.message, <%= @sm %>.getCount()), function(btn, text){
26
+ if (btn == 'yes'){
27
+ <%= @sm %>.each(function(r){
28
+ Backend.app.mask();
29
+ Ext.Ajax.request({
30
+ url: '<%= @destroy_path || @base_path %>/'+r.id,
31
+ method: 'DELETE',
32
+ params: {<%= @forgery_protection_token %>: '<%= @authenticity_token %>'},
33
+ success: function(result, request){
34
+ Backend.app.unmask();
35
+ var resultValue = Ext.decode(result.responseText);
36
+ if (resultValue.success == true){
37
+ <%= @store %>.remove(r);
38
+ } else {
39
+ Ext.MessageBox.alert(Backend.locale.messages.alert.title, resultValue.msg);
40
+ return;
41
+ }
42
+ },
43
+ failure: function(result, request) {
44
+ Backend.app.unmask();
45
+ Ext.Msg.alert(Backend.locale.messages.alert.title, Backend.locale.messages.alert.message);
46
+ }
47
+ });
48
+ })
49
+ }
50
+ });
51
+ }
@@ -0,0 +1,40 @@
1
+ module Lipsiadmin
2
+ module Ext
3
+ # Generate a new Ext.Toolbar
4
+ #
5
+ # Examples:
6
+ #
7
+ # var toolBar = new Ext.Toolbar([{
8
+ # handler: show();,
9
+ # text: "Add",
10
+ # other: "...",
11
+ # icon: "..."
12
+ # },{
13
+ # handler: Backend.app.loadHtml('/accounts/'+accounts_grid.getSelected().id+'/edit'),
14
+ # text: "Edit",
15
+ # other: "..."
16
+ # }]);
17
+ #
18
+ # grid.tbar do |bar|
19
+ # bar.add "Add", :handler => bar.l("show();"), :icon => "...", :other => "..."
20
+ # bar.add "Edit", :handler => bar.l("Backend.app.loadHtml('/accounts/'+accounts_grid.getSelected().id+'/edit')"), :other => "..."
21
+ # end
22
+ #
23
+ class ToolBar < Component
24
+ attr_accessor :items
25
+ def initialize(options={}, &block)#:nodoc:
26
+ super("Ext.Toolbar", { :items => [] }.merge(options), &block)
27
+ end
28
+
29
+ # Add new items to a Ext.Toolbar
30
+ #
31
+ # # Generates: { handler: show();, text: "Add", other: "...", icon: "..." }
32
+ # add "Add", :handler => bar.l("show();"), :icon => "...", :other => "..."
33
+ #
34
+ def add(name, options={})
35
+ options[:text] = name
36
+ config[:items] << Configuration.new(options)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,150 @@
1
+ require 'view/helpers/ext/component'
2
+ require 'view/helpers/ext/grid'
3
+ require 'view/helpers/ext/column_model'
4
+ require 'view/helpers/ext/tool_bar'
5
+ require 'view/helpers/ext/configuration'
6
+ require 'view/helpers/ext/store'
7
+
8
+ module Lipsiadmin
9
+ module View
10
+ module Helpers
11
+ # Module containing the methods useful for ext/prototype
12
+ module ExtHelper
13
+
14
+ def self.included(base)#:nodoc:
15
+ base.class_eval do
16
+ alias_method_chain :to_s, :refactoring
17
+ end
18
+ end
19
+
20
+ def to_s_with_refactoring #:nodoc:
21
+ returning javascript = @lines * $/ do
22
+ source = javascript.dup
23
+ end
24
+ end
25
+
26
+ # Hide all open dialogs
27
+ def hide_dialogs
28
+ record "Ext.Msg.getDialog().hide()"
29
+ end
30
+
31
+ # Replaces the inner HTML of the Main Panel of +Backend+.
32
+ #
33
+ # +options_for_render+ may be either a string of HTML to insert, or a hash
34
+ # of options to be passed to ActionView::Base#render. For example:
35
+ #
36
+ # # Replaces the inner HTML of the Main Panel of +Backend+.
37
+ # # Generates: Backend.app.update("-- Contents of 'person' partial --");
38
+ # page.update :partial => 'person', :object => @person
39
+ #
40
+ def update(*options_for_render)
41
+ call "Backend.app.update", render(*options_for_render), true
42
+ end
43
+
44
+ # Load html/js and eval it's code
45
+ #
46
+ # # Generates: Backend.app.loadJs('/my/javascript.js');
47
+ # load(:controller => :my, :action => :javascript, :format => :js)
48
+ #
49
+ def load(location, cache = false)
50
+ url = location.is_a?(String) ? location : @context.url_for(location)
51
+ call "Backend.app.load", url, cache
52
+ end
53
+
54
+ # Show errors (if they are) for the given +objects+ and show a Ext.Message
55
+ # with explanation of the errors or if errors are empty, a congratulation message.
56
+ #
57
+ # # Generates:
58
+ # # Ext.Msg.show({
59
+ # # title:Backend.locale.messages.alert.title,
60
+ # # msg: '<ul>Name can't be blank!</ul>',
61
+ # # buttons: Ext.Msg.OK,
62
+ # # minWidth: 400
63
+ # # })
64
+ # show_errors_for(@account)
65
+ #
66
+ def show_errors_for(*objects)
67
+ count = objects.inject(0) {|sum, object| sum + object.errors.count }
68
+ unless count.zero?
69
+ error_messages = objects.map {|object| object.errors.full_messages.map {|msg| "<li>#{msg}</li>" } }
70
+ record "Ext.Msg.show({
71
+ title: Backend.locale.messages.alert.title,
72
+ msg: '<ul>#{escape_javascript(error_messages.join)}</ul>',
73
+ buttons: Ext.Msg.OK,
74
+ minWidth: 400
75
+ });"
76
+ else
77
+ record "Ext.Msg.alert(Backend.locale.messages.compliments.title, Backend.locale.messages.compliments.message);"
78
+ end
79
+ end
80
+
81
+ # Show a Ext.alert popup
82
+ #
83
+ # # Generates: Ext.Msg.alert('Hey!', 'Hello World')
84
+ # ext_alert('Hey!', 'Hello World')
85
+ #
86
+ def ext_alert(title, message)
87
+ call "Ext.Msg.alert", title, message
88
+ end
89
+
90
+ # Unmask the Backend App
91
+ #
92
+ # # Generates: Backend.app.unmask()
93
+ # unmask
94
+ #
95
+ def unmask
96
+ call "Backend.app.unmask"
97
+ end
98
+
99
+ # Mask the Backend App
100
+ #
101
+ # # Generates: Backend.app.mask('Hello World')
102
+ # mask("Hello World")
103
+ #
104
+ def mask(title=nil)
105
+ call "Backend.app.mask", title
106
+ end
107
+
108
+ # Create a javascript function
109
+ #
110
+ # # Generates: function() { window.show(); };
111
+ # page.fn("window.show();")
112
+ # or
113
+ # page.fn { |p| p.call "window.show" }
114
+ #
115
+ def fn(function=nil, &block)
116
+ if function
117
+ record "function() { #{literal(function)} }"
118
+ else
119
+ record block_to_function(function || block)
120
+ end
121
+ end
122
+
123
+ # Generate a full customizable Ext.GridPanel
124
+ #
125
+ # Examples:
126
+ #
127
+ # page.grid do |grid|
128
+ # grid.id "grid-posts"
129
+ # grid.title "List all Post"
130
+ # grid.base_path "/backend/posts"
131
+ # grid.forgery_protection_token request_forgery_protection_token
132
+ # grid.authenticity_token form_authenticity_token
133
+ # grid.tbar :default
134
+ # grid.store do |store|
135
+ # store.url "/backend/posts.json"
136
+ # store.fields @column_store.store_fields
137
+ # end
138
+ # grid.columns do |columns|
139
+ # columns.fields @column_store.column_fields
140
+ # end
141
+ # grid.bbar :store => grid.get_store, :pageSize => params[:limit]
142
+ # end
143
+ #
144
+ def grid(&block)
145
+ self << Lipsiadmin::Ext::Grid.new(&block)
146
+ end
147
+ end
148
+ end
149
+ end
150
+ end
@@ -0,0 +1,222 @@
1
+ require "date"
2
+ require 'action_view/helpers/tag_helper'
3
+ module Lipsiadmin
4
+ module View
5
+ module Helpers#:nodoc:
6
+ # Returns text_area, text_field, password_field with
7
+ # a default extjs css style.
8
+ #
9
+ module FormHelper
10
+ def self.included(base)#:nodoc:
11
+ base.alias_method_chain :text_area, :style
12
+ base.alias_method_chain :text_field, :style
13
+ base.alias_method_chain :password_field, :style
14
+ end
15
+
16
+ # Returns text_area with extjs style
17
+ # alias for text_area, for use the original tag use:
18
+ #
19
+ # text_area_without_style
20
+ #
21
+ def text_area_with_style(name, value = nil, options = {})
22
+ options[:class] ||= "x-form-field"
23
+ options[:style] ||= "width:100%;height:80px"
24
+ text_area_without_style(name, value, options)
25
+ end
26
+
27
+ # Returns text_field with extjs style
28
+ # alias for text_field, for use the original tag use:
29
+ #
30
+ # text_field_without_style
31
+ #
32
+ def text_field_with_style(name, method, options = {})
33
+ options[:class] ||= "x-form-text"
34
+ options[:style] ||= "width:100%"
35
+ text_field_without_style(name, method, options)
36
+ end
37
+
38
+ # Returns password_field with extjs style
39
+ # alias for password_field, for use the original tag use:
40
+ #
41
+ # password_field_without_style
42
+ #
43
+ def password_field_with_style(name, method, options = {})
44
+ options[:class] ||= "x-form-text"
45
+ options[:style] ||= "width:100%"
46
+ password_field_without_style(name, method, options)
47
+ end
48
+ end
49
+
50
+ # Returns text_area_tag, text_field_tag, password_field_tag with
51
+ # a default extjs css style.
52
+ #
53
+ module FormTagHelper
54
+
55
+ def self.included(base)#:nodoc:
56
+ base.alias_method_chain :text_field_tag, :style
57
+ base.alias_method_chain :text_area_tag, :style
58
+ base.alias_method_chain :password_field_tag, :style
59
+ end
60
+
61
+ # Returns text_area_tag with extjs style
62
+ # alias for text_area_tag, for use the original tag use:
63
+ #
64
+ # text_area_tag_without_style
65
+ #
66
+ def text_area_tag_with_style(name, value = nil, options = {})
67
+ options[:class] ||= "x-form-field"
68
+ options[:style] ||= "width:100%;height:80px"
69
+ text_area_tag_without_style(name, value, options)
70
+ end
71
+
72
+ # Returns text_field_tag with extjs style
73
+ # alias for text_field_tag, for use the original tag use:
74
+ #
75
+ # text_field_tag_without_style
76
+ #
77
+ def text_field_tag_with_style(name, value = nil, options = {})
78
+ options[:class] ||= "x-form-text"
79
+ options[:style] ||= "width:100%"
80
+ text_field_tag_without_style(name, value, options)
81
+ end
82
+
83
+ # Returns password_field_tag with extjs style
84
+ # alias for password_field_tag, for use the original tag use:
85
+ #
86
+ # password_field_tag_style
87
+ #
88
+ def password_field_tag_with_style(name, value = nil, options = {})
89
+ options[:class] ||= "x-form-text"
90
+ options[:style] ||= "width:100%"
91
+ password_field_tag_without_style(name, value, options)
92
+ end
93
+ end
94
+
95
+ module DateHelper
96
+ # Returns an ExtJs Calendar
97
+ #
98
+ # Examples:
99
+ # =ext_date_select :post, :created_at
100
+ #
101
+ def ext_date_select(object_name, method, options = {}, html_options = {})
102
+ InstanceTag.new(object_name, method, self, options.delete(:object)).to_ext_date_select_tag(options, html_options)
103
+ end
104
+
105
+ # Returns an ExtJs Calendar and a Time selector
106
+ #
107
+ # Examples:
108
+ # =ext_datetime_select :post, :updated_at
109
+ #
110
+ def ext_datetime_select(object_name, method, options = {}, html_options = {})
111
+ InstanceTag.new(object_name, method, self, options.delete(:object)).to_ext_datetime_select_tag(options, html_options)
112
+ end
113
+ end
114
+
115
+ module CountrySelectHelper
116
+ # Return select and option tags for the given object and method, using country_options_for_select to generate the list of option tags.
117
+ def country_select(object, method, priority_countries = nil, options = {}, html_options = {})
118
+ InstanceTag.new(object, method, self, options.delete(:object)).to_country_select_tag(priority_countries, options, html_options)
119
+ end
120
+ # Returns a string of option tags for pretty much any country in the world. Supply a country name as +selected+ to
121
+ # have it marked as the selected option tag. You can also supply an array of countries as +priority_countries+, so
122
+ # that they will be listed above the rest of the (long) list.
123
+ #
124
+ # NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag.
125
+ def country_options_for_select(selected = nil, priority_countries = nil)
126
+ country_options = ""
127
+
128
+ if priority_countries
129
+ country_options += options_for_select(priority_countries, selected)
130
+ country_options += "<option value=\"\" disabled=\"disabled\">-------------</option>\n"
131
+ end
132
+
133
+ return country_options + options_for_select(COUNTRIES, selected)
134
+ end
135
+ # All the countries included in the country_options output.
136
+ COUNTRIES = ["Afghanistan", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Angola",
137
+ "Anguilla", "Antarctica", "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria",
138
+ "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin",
139
+ "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil",
140
+ "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia",
141
+ "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China",
142
+ "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo",
143
+ "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba",
144
+ "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "Ecuador", "Egypt",
145
+ "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands (Malvinas)",
146
+ "Faroe Islands", "Fiji", "Finland", "France", "French Guiana", "French Polynesia",
147
+ "French Southern Territories", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guernsey", "Guinea",
148
+ "Guinea-Bissau", "Guyana", "Haiti", "Heard and McDonald Islands", "Holy See (Vatican City State)",
149
+ "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran, Islamic Republic of", "Iraq",
150
+ "Ireland", "Isle of Man", "Israel", "Italy", "Jamaica", "Japan", "Jersey", "Jordan", "Kazakhstan", "Kenya",
151
+ "Kiribati", "Korea, Democratic People's Republic of", "Korea, Republic of", "Kuwait", "Kyrgyzstan",
152
+ "Lao People's Democratic Republic", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libyan Arab Jamahiriya",
153
+ "Liechtenstein", "Lithuania", "Luxembourg", "Macao", "Macedonia, The Former Yugoslav Republic Of",
154
+ "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique",
155
+ "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia, Federated States of", "Moldova, Republic of",
156
+ "Monaco", "Mongolia", "Montenegro", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru",
157
+ "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", "Nicaragua", "Niger",
158
+ "Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau",
159
+ "Palestinian Territory, Occupied", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines",
160
+ "Pitcairn", "Poland", "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russian Federation",
161
+ "Rwanda", "Saint Barthelemy", "Saint Helena", "Saint Kitts and Nevis", "Saint Lucia",
162
+ "Saint Pierre and Miquelon", "Saint Vincent and the Grenadines", "Samoa", "San Marino",
163
+ "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia", "Seychelles", "Sierra Leone", "Singapore",
164
+ "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa",
165
+ "South Georgia and the South Sandwich Islands", "Spain", "Sri Lanka", "Sudan", "Suriname",
166
+ "Svalbard and Jan Mayen", "Swaziland", "Sweden", "Switzerland", "Syrian Arab Republic",
167
+ "Taiwan, Province of China", "Tajikistan", "Tanzania, United Republic of", "Thailand", "Timor-Leste",
168
+ "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan",
169
+ "Turks and Caicos Islands", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom",
170
+ "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela",
171
+ "Viet Nam", "Virgin Islands, British", "Virgin Islands, U.S.", "Wallis and Futuna", "Western Sahara",
172
+ "Yemen", "Zambia", "Zimbabwe"] unless const_defined?("COUNTRIES")
173
+ end
174
+
175
+ class InstanceTag < ActionView::Helpers::InstanceTag#:nodoc:
176
+ include CountrySelectHelper
177
+
178
+ def to_ext_date_select_tag(options = {}, html_options = {})
179
+ to_ext_datetime_select_tag({ :hideTime => true.to_l }.merge(options), html_options)
180
+ end
181
+
182
+ def to_ext_datetime_select_tag(options = {}, html_options = {})
183
+ html_options = html_options.stringify_keys
184
+ html_options = DEFAULT_FIELD_OPTIONS.merge(html_options)
185
+ html_options["type"] = "hidden"
186
+ html_options["value"] ||= value_before_type_cast(object)
187
+ html_options["value"] &&= html_escape(html_options["value"])
188
+ add_default_name_and_id(html_options)
189
+ options = { :applyTo => html_options["id"], :dateFormat => I18n.t("extjs.dateFormat") }.merge(options)
190
+ tag("input", html_options) +
191
+ content_tag(:script, "new Ext.form.DateTimeField(#{options.to_json});", :type => Mime::JS)
192
+ end
193
+
194
+ def to_country_select_tag(priority_countries, options, html_options)
195
+ html_options = html_options.stringify_keys
196
+ add_default_name_and_id(html_options)
197
+ value = value(object)
198
+ content_tag("select",
199
+ add_options(
200
+ country_options_for_select(value, priority_countries),
201
+ options, value
202
+ ), html_options
203
+ )
204
+ end
205
+ end
206
+
207
+ module FormBuilder#:nodoc:
208
+ def ext_date_select(method, options = {}, html_options = {})
209
+ @template.ext_date_select(@object_name, method, options.merge(:object => @object), html_options)
210
+ end
211
+
212
+ def ext_datetime_select(method, options = {}, html_options = {})
213
+ @template.ext_datetime_select(@object_name, method, options.merge(:object => @object), html_options)
214
+ end
215
+
216
+ def country_select(method, priority_countries = nil, options = {}, html_options = {})
217
+ @template.country_select(@object_name, method, priority_countries, options.merge(:object => @object), html_options)
218
+ end
219
+ end
220
+ end
221
+ end
222
+ end