lipsiadmin 2.9
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +90 -0
- data/MIT-LICENSE +20 -0
- data/README +60 -0
- data/Rakefile +90 -0
- data/init.rb +1 -0
- data/lib/access_control/authentication.rb +105 -0
- data/lib/access_control/base.rb +227 -0
- data/lib/controller/ext.rb +168 -0
- data/lib/controller/lipsiadmin_controller.rb +18 -0
- data/lib/controller/pdf_builder.rb +67 -0
- data/lib/controller/rescue.rb +72 -0
- data/lib/controller/responds_to_parent.rb +56 -0
- data/lib/data_base/attachment.rb +351 -0
- data/lib/data_base/attachment/attach.rb +515 -0
- data/lib/data_base/attachment/geometry.rb +117 -0
- data/lib/data_base/attachment/iostream.rb +62 -0
- data/lib/data_base/attachment/processor.rb +49 -0
- data/lib/data_base/attachment/storage.rb +223 -0
- data/lib/data_base/attachment/thumbnail.rb +72 -0
- data/lib/data_base/attachment/upfile.rb +45 -0
- data/lib/data_base/attachment_table.rb +142 -0
- data/lib/data_base/translate_attributes.rb +30 -0
- data/lib/data_base/utility_scopes.rb +40 -0
- data/lib/data_base/without_table.rb +62 -0
- data/lib/generator.rb +114 -0
- data/lib/lipsiadmin.rb +77 -0
- data/lib/lipsiadmin_tasks.rb +3 -0
- data/lib/locale/en.yml +16 -0
- data/lib/locale/it.yml +16 -0
- data/lib/mailer/exception/exception.html.erb +11 -0
- data/lib/mailer/exception_notifier.rb +46 -0
- data/lib/mailer/pdf_builder.rb +66 -0
- data/lib/utils/html_entities.rb +63 -0
- data/lib/utils/literal.rb +20 -0
- data/lib/version.rb +9 -0
- data/lib/view/helpers/active_record_helper.rb +11 -0
- data/lib/view/helpers/backend_helper.rb +132 -0
- data/lib/view/helpers/ext/column_model.rb +73 -0
- data/lib/view/helpers/ext/component.rb +163 -0
- data/lib/view/helpers/ext/configuration.rb +36 -0
- data/lib/view/helpers/ext/grid.rb +281 -0
- data/lib/view/helpers/ext/store.rb +103 -0
- data/lib/view/helpers/ext/templates/grid_functions.js.erb +51 -0
- data/lib/view/helpers/ext/tool_bar.rb +40 -0
- data/lib/view/helpers/ext_helper.rb +150 -0
- data/lib/view/helpers/view_helper.rb +222 -0
- data/lipsiadmin_generators/attachment/REMEMBER +21 -0
- data/lipsiadmin_generators/attachment/attachment_generator.rb +27 -0
- data/lipsiadmin_generators/attachment/templates/migration.rb +14 -0
- data/lipsiadmin_generators/attachment/templates/model.rb +4 -0
- data/lipsiadmin_generators/backend/REMEMBER +18 -0
- data/lipsiadmin_generators/backend/backend_generator.rb +58 -0
- data/lipsiadmin_generators/backend/templates/config/config.yml +14 -0
- data/lipsiadmin_generators/backend/templates/config/initializers/config.rb +7 -0
- data/lipsiadmin_generators/backend/templates/config/initializers/emails.rb +2 -0
- data/lipsiadmin_generators/backend/templates/config/initializers/exception_notifier.rb +7 -0
- data/lipsiadmin_generators/backend/templates/config/locales/backend/en.yml +204 -0
- data/lipsiadmin_generators/backend/templates/config/locales/backend/it.yml +203 -0
- data/lipsiadmin_generators/backend/templates/config/locales/frontend/en.yml +5 -0
- data/lipsiadmin_generators/backend/templates/config/locales/frontend/it.yml +5 -0
- data/lipsiadmin_generators/backend/templates/config/locales/models/en.yml +31 -0
- data/lipsiadmin_generators/backend/templates/config/locales/models/it.yml +23 -0
- data/lipsiadmin_generators/backend/templates/config/locales/rails/en.yml +148 -0
- data/lipsiadmin_generators/backend/templates/config/locales/rails/it.yml +109 -0
- data/lipsiadmin_generators/backend/templates/controllers/backend/accounts_controller.rb +53 -0
- data/lipsiadmin_generators/backend/templates/controllers/backend/base_controller.rb +8 -0
- data/lipsiadmin_generators/backend/templates/controllers/backend/sessions_controller.rb +21 -0
- data/lipsiadmin_generators/backend/templates/controllers/backend_controller.rb +2 -0
- data/lipsiadmin_generators/backend/templates/controllers/frontend_controller.rb +4 -0
- data/lipsiadmin_generators/backend/templates/controllers/javascripts_controller.rb +17 -0
- data/lipsiadmin_generators/backend/templates/exceptions/template.html.haml +5 -0
- data/lipsiadmin_generators/backend/templates/helpers/backend_helper.rb +2 -0
- data/lipsiadmin_generators/backend/templates/helpers/frontend_helper.rb +2 -0
- data/lipsiadmin_generators/backend/templates/images/backend/back.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/background.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/bg-content.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/bg-hd-slate.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/bg-hd.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/bg-intro.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/bg-login.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/bg-menu-slate.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/bg-menu.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/bg.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/btn-login.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/delete.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/download.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/duplicate.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/edit.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/hd-bg-slate.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/hd-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/it.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/loader.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/logo-loader.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/logo-small.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/new.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/no-image.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/preview.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/print.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/save.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/support.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/backend/us.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/box/corners-blue.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/box/corners.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/box/l-blue.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/box/l.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/box/r-blue.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/box/r.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/box/tb-blue.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/box/tb-slate.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/box/tb.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/button/btn-arrow.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/button/btn-sprite.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/dd/drop-add.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/dd/drop-no.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/dd/drop-yes.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/editor/tb-sprite.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/form/clear-trigger.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/form/clear-trigger.psd +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/form/date-trigger.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/form/date-trigger.psd +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/form/error-tip-corners.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/form/exclamation.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/form/search-trigger.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/form/search-trigger.psd +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/form/text-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/form/trigger-tpl.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/form/trigger.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/form/trigger.psd +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/gradient-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/Thumbs.db +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/arrow-left-white.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/arrow-right-white.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/col-move-bottom.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/col-move-top.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/columns.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/dirty.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/done.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/drop-no.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/drop-yes.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/footer-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid-blue-hd.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid-blue-split.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid-hrow.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid-loading.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid-split.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid-vista-hd.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid3-hd-btn.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid3-hrow-over.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid3-hrow.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid3-special-col-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/grid3-special-col-sel-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/group-by.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/group-expand-sprite.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/hd-pop.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/hmenu-asc.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/hmenu-desc.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/hmenu-lock.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/hmenu-lock.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/hmenu-unlock.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/hmenu-unlock.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/invalid_line.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/loading.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/mso-hd.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/nowait.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-first-disabled.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-first.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-last-disabled.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-last.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-next-disabled.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-next.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-prev-disabled.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/page-prev.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/pick-button.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/refresh.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/row-check-sprite.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/row-expand-sprite.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/row-over.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/row-sel.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/sort_asc.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/sort_desc.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/grid/wait.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/layout/collapse.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/layout/expand.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/layout/gradient-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/layout/mini-bottom.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/layout/mini-left.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/layout/mini-right.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/layout/mini-top.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/layout/ns-collapse.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/layout/ns-expand.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/layout/panel-close.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/layout/panel-title-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/layout/panel-title-light-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/layout/stick.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/layout/stuck.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/layout/tab-close-on.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/layout/tab-close.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/menu/checked.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/menu/group-checked.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/menu/item-over.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/menu/menu-parent.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/menu/menu.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/menu/unchecked.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/panel/corners-sprite.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/panel/left-right.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/panel/light-hd.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/panel/tool-sprite-tpl.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/panel/tool-sprites.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/panel/tools-sprites-trans.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/panel/top-bottom.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/panel/top-bottom.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/panel/white-corners-sprite.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/panel/white-left-right.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/panel/white-top-bottom.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/progress/progress-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/qtip/bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/qtip/close.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/qtip/tip-sprite.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/s.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/shadow-c.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/shadow-lr.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/shadow.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/shared/blue-loading.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/shared/calendar.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/shared/glass-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/shared/hd-sprite.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/shared/large-loading.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/shared/left-btn.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/shared/loading-balls.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/shared/right-btn.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/shared/warning.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/e-handle-dark.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/e-handle.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/ne-handle-dark.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/ne-handle.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/nw-handle-dark.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/nw-handle.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/s-handle-dark.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/s-handle.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/se-handle-dark.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/se-handle.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/square.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/sw-handle-dark.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/sizer/sw-handle.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/slider/slider-bg.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/slider/slider-thumb.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/slider/slider-v-bg.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/slider/slider-v-thumb.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/scroll-left.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/scroll-right.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/scroller-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-btm-inactive-left-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-btm-inactive-right-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-btm-left-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-btm-right-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-close.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-strip-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-strip-bg.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tab-strip-btm-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tabs/tabs-sprite.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/toolbar/bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/toolbar/btn-arrow-light.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/toolbar/btn-arrow.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/toolbar/btn-over-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/toolbar/gray-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/toolbar/tb-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/toolbar/tb-btn-sprite.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/arrows.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/drop-add.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/drop-between.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/drop-no.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/drop-over.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/drop-under.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/drop-yes.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-end-minus-nl.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-end-minus.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-end-plus-nl.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-end-plus.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-end.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-line.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-minus-nl.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-minus.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-plus-nl.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow-plus.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/elbow.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/folder-open.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/folder.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/leaf.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/loading.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/tree/s.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/window/icon-error.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/window/icon-info.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/window/icon-question.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/window/icon-warning.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/window/left-corners.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/window/left-corners.psd +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/window/left-right.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/window/left-right.psd +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/window/right-corners.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/window/right-corners.psd +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/window/top-bottom.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/default/window/top-bottom.psd +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/button/btn-arrow.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/button/btn-sprite.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/editor/tb-sprite.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/form/checkbox.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/form/clear-trigger.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/form/date-trigger.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/form/radio.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/form/search-trigger.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/form/trigger-tpl.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/form/trigger.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/gradient-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/arrow-left-white.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/arrow-right-white.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/col-move-bottom.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/col-move-top.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/footer-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid-blue-hd.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid-blue-split.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid-hrow.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid-split.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid-vista-hd.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid3-hd-btn.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid3-hrow-over.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid3-hrow.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid3-special-col-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/grid3-special-col-sel-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/group-expand-sprite.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/mso-hd.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-first-disabled.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-first.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-last-disabled.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-last.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-next-disabled.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-next.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-prev-disabled.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/page-prev.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/refresh.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/row-over.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/row-sel.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/sort_asc.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/grid/sort_desc.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/menu/checked.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/menu/group-checked.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/menu/item-over - Copy.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/menu/item-over.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/menu/menu-parent.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/menu/menu.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/menu/unchecked.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/corners-sprite.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/left-right.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/light-hd.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/tool-sprite-tpl.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/tool-sprites.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/tools-sprites-trans.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/top-bottom.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/top-bottom.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/white-corners-sprite.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/white-left-right.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/panel/white-top-bottom.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/progress/progress-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/qtip/bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/qtip/close.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/qtip/tip-sprite.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/s.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/shared/glass-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/shared/hd-sprite.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/shared/left-btn.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/shared/right-btn.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/e-handle-dark.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/e-handle.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/ne-handle-dark.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/ne-handle.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/nw-handle-dark.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/nw-handle.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/s-handle-dark.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/s-handle.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/se-handle-dark.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/se-handle.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/square.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/sw-handle-dark.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/sizer/sw-handle.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/slider/slider-bg.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/slider/slider-thumb.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/slider/slider-v-bg.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/slider/slider-v-thumb.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/scroll-left.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/scroll-right.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/scroller-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-btm-inactive-left-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-btm-inactive-right-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-btm-left-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-btm-right-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-close.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-strip-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-strip-bg.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tab-strip-btm-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/tabs/tabs-sprite.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/bg-menu.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/btn-arrow-light.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/btn-arrow.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/btn-over-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/gray-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/tb-bg.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/toolbar/tb-btn-sprite.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/tree/arrows.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/window/icon-error.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/window/icon-info.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/window/icon-question.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/window/icon-warning.gif +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/window/left-corners.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/window/left-right.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/window/right-corners.png +0 -0
- data/lipsiadmin_generators/backend/templates/images/ext/slate/window/top-bottom.png +0 -0
- data/lipsiadmin_generators/backend/templates/javascripts/controls.js +3 -0
- data/lipsiadmin_generators/backend/templates/javascripts/dragdrop.js +3 -0
- data/lipsiadmin_generators/backend/templates/javascripts/effects.js +4 -0
- data/lipsiadmin_generators/backend/templates/javascripts/ext.js +76 -0
- data/lipsiadmin_generators/backend/templates/javascripts/prototype.js +12 -0
- data/lipsiadmin_generators/backend/templates/layouts/backend.html.haml +12 -0
- data/lipsiadmin_generators/backend/templates/layouts/frontend.html.haml +7 -0
- data/lipsiadmin_generators/backend/templates/migrations/create_accounts.rb +20 -0
- data/lipsiadmin_generators/backend/templates/models/account.rb +116 -0
- data/lipsiadmin_generators/backend/templates/models/account_access.rb +17 -0
- data/lipsiadmin_generators/backend/templates/models/notifier.rb +15 -0
- data/lipsiadmin_generators/backend/templates/stylesheets/backend-slate.css +105 -0
- data/lipsiadmin_generators/backend/templates/stylesheets/backend.css +74 -0
- data/lipsiadmin_generators/backend/templates/stylesheets/ext-slate.css +241 -0
- data/lipsiadmin_generators/backend/templates/stylesheets/ext.css +904 -0
- data/lipsiadmin_generators/backend/templates/stylesheets/login.css +22 -0
- data/lipsiadmin_generators/backend/templates/stylesheets/print.css +11 -0
- data/lipsiadmin_generators/backend/templates/stylesheets/standard.css +62 -0
- data/lipsiadmin_generators/backend/templates/views/backend/accounts/_form.html.haml +21 -0
- data/lipsiadmin_generators/backend/templates/views/backend/accounts/edit.html.haml +3 -0
- data/lipsiadmin_generators/backend/templates/views/backend/accounts/index.rjs +16 -0
- data/lipsiadmin_generators/backend/templates/views/backend/accounts/new.html.haml +3 -0
- data/lipsiadmin_generators/backend/templates/views/backend/base/index.html.haml +17 -0
- data/lipsiadmin_generators/backend/templates/views/backend/base/welcome.html.haml +2 -0
- data/lipsiadmin_generators/backend/templates/views/backend/sessions/new.html.haml +12 -0
- data/lipsiadmin_generators/backend/templates/views/javascripts/backend.js.erb +346 -0
- data/lipsiadmin_generators/backend/templates/views/javascripts/locale.js.erb +135 -0
- data/lipsiadmin_generators/backend/templates/views/notifier/registration.html.erb +2 -0
- data/lipsiadmin_generators/backend/templates/views/notifier/support_request.html.erb +1 -0
- data/lipsiadmin_generators/backend_page/REMEMBER +7 -0
- data/lipsiadmin_generators/backend_page/backend_page_generator.rb +212 -0
- data/lipsiadmin_generators/backend_page/templates/controller.rb +61 -0
- data/lipsiadmin_generators/backend_page/templates/form.html.haml +5 -0
- data/lipsiadmin_generators/backend_page/templates/form_scaffolding.html.haml +1 -0
- data/lipsiadmin_generators/backend_page/templates/functional_test.rb +45 -0
- data/lipsiadmin_generators/backend_page/templates/helper.rb +2 -0
- data/lipsiadmin_generators/backend_page/templates/view_edit.html.haml +3 -0
- data/lipsiadmin_generators/backend_page/templates/view_index.rjs.erb +16 -0
- data/lipsiadmin_generators/backend_page/templates/view_new.html.haml +3 -0
- data/lipsiadmin_generators/pdf/pdf_generator.rb +50 -0
- data/lipsiadmin_generators/pdf/templates/layout.html.erb +18 -0
- data/lipsiadmin_generators/pdf/templates/stylesheets/print.css +11 -0
- data/lipsiadmin_generators/pdf/templates/view.html.haml +7 -0
- data/resources/Pd4Ruby.class +0 -0
- data/resources/Pd4Ruby.java +52 -0
- data/resources/javascripts/ux.js +1102 -0
- data/resources/pd4ml.jar +0 -0
- data/resources/rdoc/horo.rb +613 -0
- data/resources/ss_css2.jar +0 -0
- data/tasks/lipsiadmin_tasks.rake +14 -0
- metadata +604 -0
@@ -0,0 +1,135 @@
|
|
1
|
+
Ext.namespace('Backend');
|
2
|
+
|
3
|
+
Backend.locale = <%= I18n.t("backend.javascripts").to_json %>
|
4
|
+
|
5
|
+
Ext.UpdateManager.defaults.indicatorText = '<div class="loading-indicator"><%= I18n.t('extjs.msg') %></div>';
|
6
|
+
|
7
|
+
if(Ext.View){
|
8
|
+
Ext.View.prototype.emptyText = "<%= I18n.t('extjs.emptyText') %>";
|
9
|
+
}
|
10
|
+
|
11
|
+
if(Ext.grid.Grid){
|
12
|
+
Ext.grid.Grid.prototype.ddText = "<%= I18n.t('extjs.ddText') %>";
|
13
|
+
}
|
14
|
+
|
15
|
+
if(Ext.TabPanelItem){
|
16
|
+
Ext.TabPanelItem.prototype.closeText = "<%= I18n.t('extjs.closeText') %>";
|
17
|
+
}
|
18
|
+
|
19
|
+
if(Ext.form.Field){
|
20
|
+
Ext.form.Field.prototype.invalidText = "<%= I18n.t('extjs.invalidText') %>";
|
21
|
+
}
|
22
|
+
|
23
|
+
if(Ext.LoadMask){
|
24
|
+
Ext.LoadMask.prototype.msg = "<%= I18n.t('extjs.msg') %>";
|
25
|
+
}
|
26
|
+
|
27
|
+
Date.monthNames = [<%= I18n.t('date.month_names').compact.to_json %>];
|
28
|
+
|
29
|
+
Date.getShortMonthName = function(month) {
|
30
|
+
return Date.monthNames[month].substring(0, 3);
|
31
|
+
};
|
32
|
+
|
33
|
+
Date.monthNumbers = {
|
34
|
+
Jan : 0,
|
35
|
+
Feb : 1,
|
36
|
+
Mar : 2,
|
37
|
+
Apr : 3,
|
38
|
+
May : 4,
|
39
|
+
Jun : 5,
|
40
|
+
Jul : 6,
|
41
|
+
Aug : 7,
|
42
|
+
Sep : 8,
|
43
|
+
Oct : 9,
|
44
|
+
Nov : 10,
|
45
|
+
Dec : 11
|
46
|
+
};
|
47
|
+
|
48
|
+
Date.getMonthNumber = function(name) {
|
49
|
+
return Date.monthNumbers[name.substring(0, 1).toUpperCase() + name.substring(1, 3).toLowerCase()];
|
50
|
+
};
|
51
|
+
|
52
|
+
Date.dayNames = [<%= I18n.t('date.day_names').compact.to_json %>];
|
53
|
+
|
54
|
+
Date.getShortDayName = function(day) {
|
55
|
+
return Date.dayNames[day].substring(0, 3);
|
56
|
+
};
|
57
|
+
|
58
|
+
if(Ext.MessageBox){
|
59
|
+
Ext.MessageBox.buttonText = {
|
60
|
+
ok: "<%= I18n.t('extjs.messageBox.ok') %>",
|
61
|
+
cancel: "<%= I18n.t('extjs.messageBox.cancel') %>",
|
62
|
+
yes: "<%= I18n.t('extjs.messageBox.yesse') %>",
|
63
|
+
no: "<%= I18n.t('extjs.messageBox.none') %>"
|
64
|
+
};
|
65
|
+
}
|
66
|
+
|
67
|
+
if(Ext.util.Format){
|
68
|
+
Ext.util.Format.date = function(v, format){
|
69
|
+
if(!v) return "";
|
70
|
+
if(!(v instanceof Date)) v = new Date(Date.parse(v));
|
71
|
+
return v.dateFormat(format || "<%= I18n.t('extjs.dateFormat') %>");
|
72
|
+
};
|
73
|
+
Ext.util.Format.dateTimeRenderer = function(format){
|
74
|
+
return function(v){
|
75
|
+
return Ext.util.Format.date(v, format || "<%= I18n.t('extjs.dateTimeFormat') %>");
|
76
|
+
};
|
77
|
+
};
|
78
|
+
Ext.util.Format.dateRenderer = function(format){
|
79
|
+
return function(v){
|
80
|
+
return Ext.util.Format.date(v, format || "<%= I18n.t('extjs.dateFormat') %>");
|
81
|
+
};
|
82
|
+
};
|
83
|
+
}
|
84
|
+
|
85
|
+
if(Ext.DatePicker){
|
86
|
+
Ext.apply(Ext.DatePicker.prototype, <%= I18n.t('extjs.datePicker').to_json %>);
|
87
|
+
}
|
88
|
+
|
89
|
+
if(Ext.PagingToolbar){
|
90
|
+
Ext.apply(Ext.PagingToolbar.prototype, <%= I18n.t('extjs.pagingToolbar').to_json %>);
|
91
|
+
}
|
92
|
+
|
93
|
+
if(Ext.form.TextField){
|
94
|
+
Ext.apply(Ext.form.TextField.prototype, <%= I18n.t('extjs.form.textField').to_json %>);
|
95
|
+
}
|
96
|
+
|
97
|
+
if(Ext.form.NumberField){
|
98
|
+
Ext.apply(Ext.form.NumberField.prototype, <%= I18n.t('extjs.form.numberField').to_json %>);
|
99
|
+
}
|
100
|
+
|
101
|
+
if(Ext.form.DateField){
|
102
|
+
Ext.apply(Ext.form.DateField.prototype, <%= I18n.t('extjs.form.dateField').to_json %>);
|
103
|
+
}
|
104
|
+
|
105
|
+
if(Ext.form.ComboBox){
|
106
|
+
Ext.apply(Ext.form.ComboBox.prototype, <%= I18n.t('extjs.form.comboBox').to_json %>);
|
107
|
+
}
|
108
|
+
|
109
|
+
if(Ext.form.VTypes){
|
110
|
+
Ext.apply(Ext.form.VTypes, <%= I18n.t('extjs.form.vTypes').to_json %>);
|
111
|
+
}
|
112
|
+
|
113
|
+
if(Ext.form.HtmlEditor){
|
114
|
+
Ext.apply(Ext.form.HtmlEditor.prototype, <%= I18n.t('extjs.form.htmlEditor').to_json %>);
|
115
|
+
}
|
116
|
+
|
117
|
+
if(Ext.grid.GridView){
|
118
|
+
Ext.apply(Ext.grid.GridView.prototype, <%= I18n.t('extjs.grid.gridView').to_json %>);
|
119
|
+
}
|
120
|
+
|
121
|
+
if(Ext.grid.GroupingView){
|
122
|
+
Ext.apply(Ext.grid.GroupingView.prototype, <%= I18n.t('extjs.grid.groupingView').to_json %>);
|
123
|
+
}
|
124
|
+
|
125
|
+
if(Ext.grid.Search){
|
126
|
+
Ext.apply(Ext.grid.Search.prototype, <%= I18n.t('extjs.grid.search').to_json %>);
|
127
|
+
}
|
128
|
+
|
129
|
+
if(Ext.grid.PropertyColumnModel){
|
130
|
+
Ext.apply(Ext.grid.PropertyColumnModel.prototype, <%= I18n.t('extjs.grid.propertyColumnModel').to_json %>);
|
131
|
+
}
|
132
|
+
|
133
|
+
if(Ext.layout.BorderLayout.SplitRegion){
|
134
|
+
Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype, <%= I18n.t('extjs.splitRegion').to_json %>);
|
135
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= @message %>
|
@@ -0,0 +1,212 @@
|
|
1
|
+
class ScaffoldingSandbox
|
2
|
+
include ActionView::Helpers::ActiveRecordHelper
|
3
|
+
|
4
|
+
attr_accessor :form_action, :singular_name, :suffix, :model_instance
|
5
|
+
|
6
|
+
INVALID_COLUMNS = ["_file_name","_content_type","_file_size","created_at","updated_at"]
|
7
|
+
|
8
|
+
def all_input_tags(record, record_name, options)
|
9
|
+
input_block = options[:input_block] || default_input_block
|
10
|
+
record.class.content_columns.collect{ |column| input_block.call(record_name, column) if is_valid?(column) }.compact.join("\n")
|
11
|
+
end
|
12
|
+
|
13
|
+
def sandbox_binding
|
14
|
+
binding
|
15
|
+
end
|
16
|
+
|
17
|
+
def default_input_block
|
18
|
+
Proc.new do |record, column|
|
19
|
+
" %tr
|
20
|
+
%td #{model_instance.class.human_attribute_name(column.name)}
|
21
|
+
%td#{input(record, column.name)}"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def is_valid?(column)
|
26
|
+
!INVALID_COLUMNS.find { |c| column.name.include?(c) }
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
class ActionView::Helpers::InstanceTag
|
31
|
+
def to_input_field_tag(field_type, options={})
|
32
|
+
field_meth = "#{field_type}_field"
|
33
|
+
"=#{field_meth} :#{@object_name}, :#{@method_name}#{options.empty? ? '' : ', '+options.inspect}"
|
34
|
+
end
|
35
|
+
|
36
|
+
def to_text_area_tag(options = {})
|
37
|
+
"=text_area :#{@object_name}, :#{@method_name}#{options.empty? ? '' : ', '+ options.inspect}"
|
38
|
+
end
|
39
|
+
|
40
|
+
def to_date_select_tag(options = {})
|
41
|
+
"=ext_date_select :#{@object_name}, :#{@method_name}#{options.empty? ? '' : ', '+ options.inspect}"
|
42
|
+
end
|
43
|
+
|
44
|
+
def to_datetime_select_tag(options = {})
|
45
|
+
"=ext_datetime_select :#{@object_name}, :#{@method_name}#{options.empty? ? '' : ', '+ options.inspect}"
|
46
|
+
end
|
47
|
+
|
48
|
+
def to_time_select_tag(options = {})
|
49
|
+
"=time_select :#{@object_name}, :#{@method_name}#{options.empty? ? '' : ', '+ options.inspect}"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
class BackendPageGenerator < Rails::Generator::NamedBase
|
54
|
+
attr_reader :controller_name,
|
55
|
+
:controller_class_path,
|
56
|
+
:controller_file_path,
|
57
|
+
:controller_class_nesting,
|
58
|
+
:controller_class_nesting_depth,
|
59
|
+
:controller_class_name,
|
60
|
+
:controller_underscore_name,
|
61
|
+
:controller_singular_name,
|
62
|
+
:controller_plural_name,
|
63
|
+
:files, :images,
|
64
|
+
:with_files, :with_images, :with_attachments
|
65
|
+
alias_method :controller_file_name, :controller_underscore_name
|
66
|
+
alias_method :controller_table_name, :controller_plural_name
|
67
|
+
|
68
|
+
def initialize(runtime_args, runtime_options = {})
|
69
|
+
super
|
70
|
+
@controller_name = @name.pluralize
|
71
|
+
@with_images = options[:with_images]
|
72
|
+
@with_files = options[:with_files]
|
73
|
+
base_name, @controller_class_path, @controller_file_path, @controller_class_nesting, @controller_class_nesting_depth = extract_modules(@controller_name)
|
74
|
+
@controller_class_name_without_nesting, @controller_underscore_name, @controller_plural_name = inflect_names(base_name)
|
75
|
+
@controller_singular_name=base_name.singularize
|
76
|
+
|
77
|
+
if @controller_class_nesting.empty?
|
78
|
+
@controller_class_name = @controller_class_name_without_nesting
|
79
|
+
else
|
80
|
+
@controller_class_name = "#{@controller_class_nesting}::#{@controller_class_name_without_nesting}"
|
81
|
+
end
|
82
|
+
|
83
|
+
@with_images, @images = (options[:images] && options[:images].size > 0), options[:images] ||= []
|
84
|
+
@with_files, @files = (options[:files] && options[:files].size > 0), options[:files] ||= []
|
85
|
+
|
86
|
+
@with_attachments = (@with_images || @with_files)
|
87
|
+
end
|
88
|
+
|
89
|
+
|
90
|
+
def manifest
|
91
|
+
record do |m|
|
92
|
+
# Check for class naming collisions.
|
93
|
+
m.class_collisions controller_class_path, "#{controller_class_name}Controller", "#{controller_class_name}ControllerTest", "#{controller_class_name}Helper"
|
94
|
+
|
95
|
+
attachments = []
|
96
|
+
attachments.concat(@images).compact!
|
97
|
+
attachments.concat(@files).compact!
|
98
|
+
|
99
|
+
# Adding new permissions
|
100
|
+
permissions = <<-CODE
|
101
|
+
role.project_module "#{model_instance.class.human_name}" do |project|
|
102
|
+
project.menu :list, "/backend/#{@controller_name}.js" do |submenu|
|
103
|
+
submenu.add :new, "/backend/#{@controller_name}/new"
|
104
|
+
end
|
105
|
+
end
|
106
|
+
CODE
|
107
|
+
|
108
|
+
routes = " backend.resources :#{singular_name.pluralize}"
|
109
|
+
# Adding a new permission
|
110
|
+
m.append("app/models/account_access.rb", permissions, "# Please don't remove this comment! It's used for auto adding project modules")
|
111
|
+
# Adding a new route
|
112
|
+
m.append("config/routes.rb", routes, "map.namespace(:backend) do |backend|")
|
113
|
+
# Controller, helper, views, and test directories.
|
114
|
+
m.directory File.join('app/controllers/backend', controller_class_path)
|
115
|
+
m.directory File.join('app/views/backend', controller_class_path, controller_file_name)
|
116
|
+
m.directory File.join('test/functional/backend', controller_class_path)
|
117
|
+
|
118
|
+
# Depend on model generator but skip if the model exists.
|
119
|
+
m.dependency 'model', [singular_name], :collision => :skip, :skip_migration => true
|
120
|
+
|
121
|
+
# Scaffolded forms.
|
122
|
+
m.complex_template "form.html.haml",
|
123
|
+
File.join('app/views/backend',
|
124
|
+
controller_class_path,
|
125
|
+
controller_file_name,
|
126
|
+
"_form.html.haml"),
|
127
|
+
:insert => 'form_scaffolding.html.haml',
|
128
|
+
:sandbox => lambda { create_sandbox }
|
129
|
+
|
130
|
+
|
131
|
+
# Scaffolded views.
|
132
|
+
scaffold_views.each do |action|
|
133
|
+
m.template "view_#{action}.html.haml",
|
134
|
+
File.join('app/views/backend',
|
135
|
+
controller_class_path,
|
136
|
+
controller_file_name,
|
137
|
+
"#{action}.html.haml"),
|
138
|
+
:assigns => { :action => action }
|
139
|
+
end
|
140
|
+
# Scaffolded Index Javascript
|
141
|
+
m.template "view_index.rjs.erb",
|
142
|
+
File.join('app/views/backend',
|
143
|
+
controller_class_path,
|
144
|
+
controller_file_name,
|
145
|
+
"index.rjs")
|
146
|
+
|
147
|
+
# Controller class, functional test, helper, and views.
|
148
|
+
m.template 'controller.rb',
|
149
|
+
File.join('app/controllers/backend',
|
150
|
+
controller_class_path,
|
151
|
+
"#{controller_file_name}_controller.rb")
|
152
|
+
|
153
|
+
m.template 'functional_test.rb',
|
154
|
+
File.join('test/functional/backend',
|
155
|
+
controller_class_path,
|
156
|
+
"#{controller_file_name}_controller_test.rb")
|
157
|
+
|
158
|
+
m.readme "../REMEMBER"
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
protected
|
163
|
+
# Override with your own usage banner.
|
164
|
+
def banner
|
165
|
+
"Usage: #{$0} backend_page ModelName"
|
166
|
+
end
|
167
|
+
|
168
|
+
def scaffold_views
|
169
|
+
%w(new edit)
|
170
|
+
end
|
171
|
+
|
172
|
+
def scaffold_actions
|
173
|
+
scaffold_views + %w(index create update destroy)
|
174
|
+
end
|
175
|
+
|
176
|
+
def model_name
|
177
|
+
class_name.demodulize
|
178
|
+
end
|
179
|
+
|
180
|
+
def unscaffolded_actions
|
181
|
+
[]
|
182
|
+
end
|
183
|
+
|
184
|
+
def suffix
|
185
|
+
"_#{singular_name}" if options[:suffix]
|
186
|
+
end
|
187
|
+
|
188
|
+
def create_sandbox
|
189
|
+
sandbox = ScaffoldingSandbox.new
|
190
|
+
sandbox.singular_name = singular_name
|
191
|
+
begin
|
192
|
+
sandbox.model_instance = model_instance
|
193
|
+
sandbox.instance_variable_set("@#{singular_name}", sandbox.model_instance)
|
194
|
+
rescue ActiveRecord::StatementInvalid => e
|
195
|
+
logger.error "Before updating backend_page from new DB schema, try creating a table for your model (#{class_name})"
|
196
|
+
raise SystemExit
|
197
|
+
end
|
198
|
+
sandbox.suffix = suffix
|
199
|
+
sandbox
|
200
|
+
end
|
201
|
+
|
202
|
+
def model_instance
|
203
|
+
base = class_nesting.split('::').inject(Object) do |base, nested|
|
204
|
+
break base.const_get(nested) if base.const_defined?(nested)
|
205
|
+
base.const_set(nested, Module.new)
|
206
|
+
end
|
207
|
+
unless base.const_defined?(@class_name_without_nesting)
|
208
|
+
base.const_set(@class_name_without_nesting, Class.new(ActiveRecord::Base))
|
209
|
+
end
|
210
|
+
class_name.constantize.new
|
211
|
+
end
|
212
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
class Backend::<%= controller_class_name %>Controller < BackendController
|
2
|
+
|
3
|
+
def index
|
4
|
+
params[:limit] ||= 50
|
5
|
+
|
6
|
+
@column_store = column_store_for <%= model_name %> do |cm|
|
7
|
+
<%- model_instance.class.content_columns.collect do |column| -%>
|
8
|
+
cm.add :<%= column.name.downcase %>, "<%= model_instance.class.human_attribute_name(column.name) %>", :sortable => true<% if column.type == :date %>, :renderer => :date <% elsif column.type == :datetime %>, :renderer => :datetime <% end %>
|
9
|
+
<%- end -%>
|
10
|
+
end
|
11
|
+
|
12
|
+
respond_to do |format|
|
13
|
+
format.js
|
14
|
+
format.json do
|
15
|
+
render :json => @column_store.store_data(params)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
<% for action in unscaffolded_actions -%>
|
21
|
+
def <%= action %><%= suffix %>
|
22
|
+
end
|
23
|
+
|
24
|
+
<% end -%>
|
25
|
+
|
26
|
+
def new<%= suffix %>
|
27
|
+
@<%= singular_name %> = <%= model_name %>.new
|
28
|
+
end
|
29
|
+
|
30
|
+
def create<%= suffix %>
|
31
|
+
@<%= singular_name %> = <%= model_name %>.new(params[:<%= singular_name %>])
|
32
|
+
if @<%= singular_name %>.save
|
33
|
+
redirect_parent_to(:action => "edit", :id => @<%= singular_name %>)
|
34
|
+
else
|
35
|
+
render_to_parent(:action => "new")
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def edit<%= suffix %>
|
40
|
+
@<%= singular_name %> = <%= model_name %>.find(params[:id])
|
41
|
+
end
|
42
|
+
|
43
|
+
def update
|
44
|
+
@<%= singular_name %> = <%= model_name %>.find(params[:id])
|
45
|
+
if @<%= singular_name %>.update_attributes(params[:<%= singular_name %>])
|
46
|
+
redirect_parent_to(:action => "edit", :id => @<%= singular_name %>)
|
47
|
+
else
|
48
|
+
render_to_parent(:action => "edit")
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
# Add in your model before_destroy and if the callback returns false,
|
53
|
+
# all the later callbacks and the associated action are cancelled.
|
54
|
+
def destroy<%= suffix %>
|
55
|
+
if <%= model_name %>.find(params[:id]).destroy
|
56
|
+
render :json => { :success => true }
|
57
|
+
else
|
58
|
+
render :json => { :success => false, :msg => I18n.t("backend.general.cantDelete") }
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= all_input_tags(@model_instance, @singular_name, {}) %>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class Backend::<%= controller_class_name %>ControllerTest < ActionController::TestCase
|
4
|
+
test "should get index" do
|
5
|
+
get :index
|
6
|
+
assert_response :success
|
7
|
+
assert_not_nil assigns(:<%= table_name %>)
|
8
|
+
end
|
9
|
+
|
10
|
+
test "should get new" do
|
11
|
+
get :new
|
12
|
+
assert_response :success
|
13
|
+
end
|
14
|
+
|
15
|
+
test "should create <%= file_name %>" do
|
16
|
+
assert_difference('<%= class_name %>.count') do
|
17
|
+
post :create, :<%= file_name %> => { }
|
18
|
+
end
|
19
|
+
|
20
|
+
assert_redirected_to <%= file_name %>_path(assigns(:<%= file_name %>))
|
21
|
+
end
|
22
|
+
|
23
|
+
test "should show <%= file_name %>" do
|
24
|
+
get :show, :id => <%= table_name %>(:one).id
|
25
|
+
assert_response :success
|
26
|
+
end
|
27
|
+
|
28
|
+
test "should get edit" do
|
29
|
+
get :edit, :id => <%= table_name %>(:one).id
|
30
|
+
assert_response :success
|
31
|
+
end
|
32
|
+
|
33
|
+
test "should update <%= file_name %>" do
|
34
|
+
put :update, :id => <%= table_name %>(:one).id, :<%= file_name %> => { }
|
35
|
+
assert_redirected_to <%= file_name %>_path(assigns(:<%= file_name %>))
|
36
|
+
end
|
37
|
+
|
38
|
+
test "should destroy <%= file_name %>" do
|
39
|
+
assert_difference('<%= class_name %>.count', -1) do
|
40
|
+
delete :destroy, :id => <%= table_name %>(:one).id
|
41
|
+
end
|
42
|
+
|
43
|
+
assert_redirected_to <%= table_name %>_path
|
44
|
+
end
|
45
|
+
end
|