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,73 @@
|
|
1
|
+
module Lipsiadmin
|
2
|
+
module Ext
|
3
|
+
# Generate a new Ext.grid.ColumnModel
|
4
|
+
#
|
5
|
+
# Examples:
|
6
|
+
#
|
7
|
+
# var columnModel = new Ext.grid.ColumnModel({
|
8
|
+
# columns: [{
|
9
|
+
# header: "Name",
|
10
|
+
# dataIndex: "name"
|
11
|
+
# },{
|
12
|
+
# header: "Category",
|
13
|
+
# dataIndex: "category_name",
|
14
|
+
# query: "categories.name LIKE {query}"
|
15
|
+
# },{
|
16
|
+
# header: "Date",
|
17
|
+
# dataIndex: "date"
|
18
|
+
# },{
|
19
|
+
# header: "Created At",
|
20
|
+
# dataIndex: "created_at"
|
21
|
+
# }]});
|
22
|
+
#
|
23
|
+
# ColumnModel.new do |columns|
|
24
|
+
# columns.add :name, "Name"
|
25
|
+
# columns.add :category_name, "Category", :dataIndex => "categories.name"
|
26
|
+
# columns.add :date, "Date"
|
27
|
+
# columns.add :created_at, "Created At"
|
28
|
+
# end
|
29
|
+
#
|
30
|
+
class ColumnModel < Component
|
31
|
+
def initialize(options={}, &block)#:nodoc:
|
32
|
+
super("Ext.grid.ColumnModel", { :columns => [] }.merge(options), &block)
|
33
|
+
end
|
34
|
+
|
35
|
+
# This add automatically fields from an array
|
36
|
+
def fields(fields)
|
37
|
+
fields.each { |options| add(nil, nil, options) }
|
38
|
+
end
|
39
|
+
|
40
|
+
# Add columns to a Ext.grid.ColumnModel
|
41
|
+
#
|
42
|
+
# # Generates: { header: "Created At", dataIndex: "accounts.datetime", sortable => true }
|
43
|
+
# add "Created At", "accounts.datetime", :sortable => l(true)
|
44
|
+
#
|
45
|
+
# You can pass :renderer
|
46
|
+
#
|
47
|
+
# # Generates: Ext.util.Format.dateRenderer()
|
48
|
+
# :renderer => :date
|
49
|
+
# # Generates: Ext.util.Format.dateTimeRenderer()
|
50
|
+
# :renderer => :datetime
|
51
|
+
# # Generates: Ext.util.Format.eurMoney
|
52
|
+
# :renderer => :eur_money
|
53
|
+
# # Generates: Ext.util.Format.usMoney
|
54
|
+
# :renderer => :us_money
|
55
|
+
# # Generates: Ext.util.Format.boolRenderer
|
56
|
+
# :renderer => :boolean
|
57
|
+
#
|
58
|
+
def add(name=nil, data=nil, options={})
|
59
|
+
options[:header] = name if name
|
60
|
+
options[:dataIndex] = data if data
|
61
|
+
case options[:renderer]
|
62
|
+
when :date then options.merge!(:renderer => l("Ext.util.Format.dateRenderer()"))
|
63
|
+
when :datetime then options.merge!(:renderer => l("Ext.util.Format.dateTimeRenderer()"))
|
64
|
+
when :eur_money then options.merge!(:renderer => l("Ext.util.Format.eurMoney"))
|
65
|
+
when :us_money then options.merge!(:renderer => l("Ext.util.Format.usMoney"))
|
66
|
+
when :boolean then options.merge!(:renderer => l("Ext.util.Format.boolRenderer"))
|
67
|
+
end
|
68
|
+
raise ComponentError, "You must provide header and dataIndex for generate a column model" if options[:header].blank? || options[:dataIndex].blank?
|
69
|
+
config[:columns] << Configuration.new(options)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,163 @@
|
|
1
|
+
module Lipsiadmin#:nodoc:
|
2
|
+
module Ext#:nodoc:
|
3
|
+
|
4
|
+
class ComponentError < StandardError; end#:nodoc:
|
5
|
+
|
6
|
+
# This is the base class of ext components
|
7
|
+
#
|
8
|
+
# You can generate your custom ExtJs objects like:
|
9
|
+
#
|
10
|
+
# # Generates:
|
11
|
+
# # var groupingView = Ext.grid.GroupingView({
|
12
|
+
# # forceFit: true
|
13
|
+
# # });
|
14
|
+
#
|
15
|
+
# Component.new("Ext.grid.GroupingView", { :forceFit => true });
|
16
|
+
#
|
17
|
+
class Component
|
18
|
+
|
19
|
+
def initialize(klass, options={}, &block)#:nodoc:
|
20
|
+
@klass = klass
|
21
|
+
@config = Configuration.new(options)
|
22
|
+
@before, @after = [], []
|
23
|
+
yield self if block_given?
|
24
|
+
end
|
25
|
+
|
26
|
+
# The id of the component
|
27
|
+
#
|
28
|
+
def id(new_id)
|
29
|
+
@config[:id] = new_id
|
30
|
+
end
|
31
|
+
|
32
|
+
# Set var used by the component
|
33
|
+
#
|
34
|
+
# Generates: var myVar = new Ext.Grid({...});
|
35
|
+
# store.var "myVar"
|
36
|
+
#
|
37
|
+
def var(var)
|
38
|
+
@var = var
|
39
|
+
end
|
40
|
+
|
41
|
+
# Get the var used by the component defaults is the id of the component
|
42
|
+
#
|
43
|
+
def get_var
|
44
|
+
# I will nillify obj if they are blank
|
45
|
+
@var = nil if @var == ""
|
46
|
+
@config[:var] if @config[:var] == ""
|
47
|
+
# Return a correct var
|
48
|
+
@var || @config[:var] || (@klass.split(".").last.demodulize.slice(0..0).downcase + @klass.split(".").last.demodulize.slice(1..-1))
|
49
|
+
end
|
50
|
+
|
51
|
+
# Write the the configuration of object from an hash
|
52
|
+
#
|
53
|
+
def config=(options={})
|
54
|
+
@config = Configuration.new(options)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Read the the configuration of object from an hash
|
58
|
+
#
|
59
|
+
def config
|
60
|
+
@config
|
61
|
+
end
|
62
|
+
|
63
|
+
def method_missing(method, arg=nil)#:nodoc:
|
64
|
+
if method.to_s.start_with?("get_")
|
65
|
+
@config[method.to_s.gsub("get_", "").to_sym]
|
66
|
+
else
|
67
|
+
@config[method.to_sym] = arg
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
# Returns an array of javascripts to add before component is rendered.
|
72
|
+
#
|
73
|
+
def before
|
74
|
+
@before
|
75
|
+
end
|
76
|
+
|
77
|
+
# Returns the javascript to add before component is rendered.
|
78
|
+
#
|
79
|
+
def before_js
|
80
|
+
@before.uniq.compact.join("\n\n") + "\n\n"
|
81
|
+
end
|
82
|
+
|
83
|
+
# Returns an array of javascripts to add afters component is rendered.
|
84
|
+
#
|
85
|
+
def after
|
86
|
+
@after
|
87
|
+
end
|
88
|
+
|
89
|
+
# Returns the javascript to add after component is rendered.
|
90
|
+
#
|
91
|
+
def after_js
|
92
|
+
"\n\n" + @after.uniq.compact.join("\n\n")
|
93
|
+
end
|
94
|
+
|
95
|
+
|
96
|
+
# Generates a new handler for the given component
|
97
|
+
#
|
98
|
+
# Examples:
|
99
|
+
#
|
100
|
+
# # Generates:
|
101
|
+
# # grid.on("dblclick", function() {
|
102
|
+
# # edit();
|
103
|
+
# # new();
|
104
|
+
# # Ext.Msg.alert("Hello", "world");
|
105
|
+
# # });
|
106
|
+
#
|
107
|
+
# grid.on :dblclick do |p|
|
108
|
+
# p.call "edit"
|
109
|
+
# p.call "new"
|
110
|
+
# p.ext_alert "Hello", "world"
|
111
|
+
# end
|
112
|
+
def on(event, function=nil, scope=nil, &block)
|
113
|
+
# Remove old handlers
|
114
|
+
@after.delete_if { |s| s.start_with?("#{get_var}.on(#{event.to_json}") if s.is_a?(String) }
|
115
|
+
scope = ", #{scope}" unless scope.blank?
|
116
|
+
if function
|
117
|
+
after << "#{get_var}.on(#{event.to_json}, #{function}#{scope});"
|
118
|
+
else
|
119
|
+
generator = ActionView::Helpers::PrototypeHelper::JavaScriptGenerator.new(self, &block)
|
120
|
+
after << "#{get_var}.on(#{event.to_json}, function() { \n #{generator.to_s.gsub("\n", "\n ")}\n}#{scope});"
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
def with_output_buffer(buf = '')#:nodoc:
|
125
|
+
yield
|
126
|
+
end
|
127
|
+
|
128
|
+
|
129
|
+
# Returns the javascript example
|
130
|
+
#
|
131
|
+
# # Generates: var rowSelectionModel = Ext.grid.RowSelectionModel();
|
132
|
+
# Component.new("Ext.grid.RowSelectionModel")
|
133
|
+
#
|
134
|
+
def to_s
|
135
|
+
"var #{get_var} = new #{@klass}(#{config.to_s});"
|
136
|
+
end
|
137
|
+
|
138
|
+
def raise_error(error)#:nodoc:
|
139
|
+
raise ComponentError, error
|
140
|
+
end
|
141
|
+
|
142
|
+
# Returns an object whose <tt>to_json</tt> evaluates to +code+. Use this to pass a literal JavaScript
|
143
|
+
# expression as an argument to another JavaScriptGenerator method.
|
144
|
+
#
|
145
|
+
def literal(code)
|
146
|
+
ActiveSupport::JSON::Variable.new(code.to_s)
|
147
|
+
end
|
148
|
+
alias_method :l, :literal
|
149
|
+
|
150
|
+
private
|
151
|
+
def javascript_object_for(object)
|
152
|
+
object.respond_to?(:to_json) ? object.to_json : object.inspect
|
153
|
+
end
|
154
|
+
alias_method :s, :javascript_object_for
|
155
|
+
|
156
|
+
def render_javascript(template, assigns)
|
157
|
+
assigns.each { |key, value| instance_variable_set("@#{key}", value) }
|
158
|
+
template = File.read("#{File.dirname(__FILE__)}/templates/#{template}.js.erb")
|
159
|
+
return ERB.new(template).result(binding)
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Lipsiadmin
|
2
|
+
module Ext
|
3
|
+
# Ext configuration used by components
|
4
|
+
#
|
5
|
+
# Generates: { name: 'name', handler: function(){ alert('Hello World') } }
|
6
|
+
#
|
7
|
+
class Configuration < Hash
|
8
|
+
|
9
|
+
def initialize(hash)#:nodoc:
|
10
|
+
hash.each { |k,v| self[k] = v }
|
11
|
+
end
|
12
|
+
|
13
|
+
# Returns the configuration as a string.
|
14
|
+
# Optionally you can specify the indentation spaces.
|
15
|
+
def to_s(indent=1)
|
16
|
+
return if self.empty?
|
17
|
+
i = (" "*indent)
|
18
|
+
s = self.size > 0 ? "\n" : " "
|
19
|
+
"{#{s}" + self.collect { |k,v| "#{i*2}#{k}: #{s(v)}" if k != :var }.join(",#{s}") + "#{s}#{i}}"
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
def javascript_object_for(object)
|
24
|
+
case object
|
25
|
+
when Configuration
|
26
|
+
object.to_s(2)
|
27
|
+
when Array
|
28
|
+
"[" + object.collect { |o| s(o) }.join(",") + "]"
|
29
|
+
else
|
30
|
+
object.respond_to?(:to_json) ? object.to_json : object.inspect
|
31
|
+
end
|
32
|
+
end
|
33
|
+
alias_method :s, :javascript_object_for
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,281 @@
|
|
1
|
+
module Lipsiadmin
|
2
|
+
module Ext
|
3
|
+
# Generate a full customizable Ext.GridPanel
|
4
|
+
#
|
5
|
+
# Examples:
|
6
|
+
#
|
7
|
+
# # Returns:
|
8
|
+
# # var grid = new Ext.grid.GridPanel({
|
9
|
+
# # clicksToEdit: 1,
|
10
|
+
# # border: false,
|
11
|
+
# # bodyBorder: false,
|
12
|
+
# # store: store,
|
13
|
+
# # view: groupingView,
|
14
|
+
# # region: "center",
|
15
|
+
# # sm: new Ext.grid.CheckboxSelectionModel(),
|
16
|
+
# # bbar: pagingToolbar,
|
17
|
+
# # plugins: [new Ext.grid.Search()],
|
18
|
+
# # viewConfig: { forceFit: true },
|
19
|
+
# # id: "grid-posts",
|
20
|
+
# # cm: columnModel,
|
21
|
+
# # tbar: toolBar
|
22
|
+
# # });
|
23
|
+
#
|
24
|
+
# page.grid do |grid|
|
25
|
+
# grid.id "grid-posts"
|
26
|
+
# grid.title "List all Post"
|
27
|
+
# grid.base_path "/backend/posts"
|
28
|
+
# grid.forgery_protection_token request_forgery_protection_token
|
29
|
+
# grid.authenticity_token form_authenticity_token
|
30
|
+
# grid.tbar :default
|
31
|
+
# grid.store do |store|
|
32
|
+
# store.url "/backend/posts.json"
|
33
|
+
# store.fields @column_store.store_fields
|
34
|
+
# end
|
35
|
+
# grid.columns do |columns|
|
36
|
+
# columns.fields @column_store.column_fields
|
37
|
+
# end
|
38
|
+
# grid.bbar :store => grid.get_store, :pageSize => params[:limit]
|
39
|
+
# end
|
40
|
+
#
|
41
|
+
class Grid < Component
|
42
|
+
def initialize(options={}, &block)#:nodoc:
|
43
|
+
# Call Super Class for initialize configuration
|
44
|
+
super("Ext.grid.GridPanel", options)
|
45
|
+
|
46
|
+
# Write default configuration if not specified
|
47
|
+
config[:plugins] ||= []
|
48
|
+
viewConfig l("{ forceFit: true }")
|
49
|
+
clicksToEdit l(1)
|
50
|
+
border l(false)
|
51
|
+
bodyBorder l(false)
|
52
|
+
region "center"
|
53
|
+
sm :checkbox
|
54
|
+
add_plugin l("new Ext.grid.Search()")
|
55
|
+
view :default
|
56
|
+
on(:dblclick, :edit, l("this"))
|
57
|
+
|
58
|
+
yield self if block_given?
|
59
|
+
end
|
60
|
+
|
61
|
+
# Define the selection model of this grid.
|
62
|
+
# You can pass:
|
63
|
+
#
|
64
|
+
# * :checkbox || :default
|
65
|
+
# * :row
|
66
|
+
# * custom (eg. Component.new("some"))
|
67
|
+
#
|
68
|
+
# It generate some like:
|
69
|
+
#
|
70
|
+
# new Ext.grid.CheckboxSelectionModel()
|
71
|
+
#
|
72
|
+
def sm(value)
|
73
|
+
selmodel = case value
|
74
|
+
when :default then Component.new("Ext.grid.CheckboxSelectionModel")
|
75
|
+
when :checkbox then Component.new("Ext.grid.CheckboxSelectionModel")
|
76
|
+
when :row then Component.new("Ext.grid.RowSelectionModel")
|
77
|
+
when Component then value
|
78
|
+
end
|
79
|
+
before << selmodel.to_s
|
80
|
+
config[:sm] = l(selmodel.get_var)
|
81
|
+
end
|
82
|
+
|
83
|
+
# Define the title of the grid
|
84
|
+
def title(title)
|
85
|
+
before << "Backend.app.setTitle(#{title.to_json});"
|
86
|
+
end
|
87
|
+
|
88
|
+
# Assign plugins for the current grid
|
89
|
+
def plugins(plugins)
|
90
|
+
config[:plugins] = plugins
|
91
|
+
end
|
92
|
+
|
93
|
+
# Add a single plugin to the grid plugins
|
94
|
+
def add_plugin(plugins)
|
95
|
+
config[:plugins] << plugins
|
96
|
+
end
|
97
|
+
|
98
|
+
# Generate or set a new Ext.Toolbar
|
99
|
+
# You can pass tbar :default options that will create
|
100
|
+
# defaults buttons for add, edit and remove records, it's generate also
|
101
|
+
# the javascript for manage them.
|
102
|
+
# for use this you need to set for the grid the: +base_path+, +forgery_protection_token+,
|
103
|
+
# +authenticity_token+ and +store+.
|
104
|
+
#
|
105
|
+
# Examples:
|
106
|
+
# var toolBar = new Ext.Toolbar([{
|
107
|
+
# handler: add,
|
108
|
+
# disabled: false,
|
109
|
+
# text: Backend.locale.buttons.add,
|
110
|
+
# cls: "x-btn-text-icon add",
|
111
|
+
# id: "add"
|
112
|
+
# },{
|
113
|
+
# handler: edit,
|
114
|
+
# disabled: true,
|
115
|
+
# text: Backend.locale.buttons.edit,
|
116
|
+
# cls: "x-btn-text-icon edit",
|
117
|
+
# id: "edit"
|
118
|
+
# },{
|
119
|
+
# handler: remove,
|
120
|
+
# disabled: true,
|
121
|
+
# text: Backend.locale.buttons.remove,
|
122
|
+
# cls: "x-btn-text-icon remove",
|
123
|
+
# id: "remove"
|
124
|
+
# }]);
|
125
|
+
#
|
126
|
+
# tbar :default
|
127
|
+
#
|
128
|
+
def tbar(obj=nil, &block)
|
129
|
+
tbar = obj.is_a?(ToolBar) ? obj : ToolBar.new
|
130
|
+
if obj == :default
|
131
|
+
tbar.add l("Backend.locale.buttons.add"), :id => "add", :disabled => literal(false), :cls => "x-btn-text-icon add", :handler => l("add")
|
132
|
+
tbar.add l("Backend.locale.buttons.edit"), :id => "edit", :disabled => literal(true), :cls => "x-btn-text-icon edit", :handler => l("edit")
|
133
|
+
tbar.add l("Backend.locale.buttons.remove"), :id => "remove", :disabled => literal(true), :cls => "x-btn-text-icon remove", :handler => l("remove")
|
134
|
+
@default_tbar = true
|
135
|
+
end
|
136
|
+
yield tbar if block_given?
|
137
|
+
before << tbar.to_s
|
138
|
+
after << tbar.after
|
139
|
+
config[:tbar] = l(tbar.get_var)
|
140
|
+
end
|
141
|
+
|
142
|
+
# Generate or set a new Ext.Toolbar
|
143
|
+
#
|
144
|
+
# Examples:
|
145
|
+
# bbar: new Ext.PagingToolbar({
|
146
|
+
# pageSize: <%= params[:limit] %>,
|
147
|
+
# store: js,
|
148
|
+
# displayInfo: true
|
149
|
+
# })
|
150
|
+
# bbar :pageSize => params[:limit], :store => store.get_var, displayInfo: true
|
151
|
+
#
|
152
|
+
def bbar(value=nil, &block)
|
153
|
+
bbar = value.is_a?(Hash) ? Component.new("Ext.PagingToolbar", value) : value
|
154
|
+
before << bbar.to_s
|
155
|
+
after << bbar.after
|
156
|
+
config[:bbar] = l(bbar.get_var)
|
157
|
+
end
|
158
|
+
|
159
|
+
# Generate or set a new Ext.grid.GroupingView
|
160
|
+
# You can pass tbar :default options that will autocreate a correct GroupingView
|
161
|
+
#
|
162
|
+
# Examples:
|
163
|
+
# view: new Ext.grid.GroupingView({
|
164
|
+
# forceFit:true,
|
165
|
+
# groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Foo" : "Bar"]})'
|
166
|
+
# })
|
167
|
+
# view :forceFit => true, :groupTextTpl => "{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Foo" : "Bar"]})"
|
168
|
+
#
|
169
|
+
def view(value=nil, &block)
|
170
|
+
if value.is_a?(Symbol) && (value == :default)
|
171
|
+
view = Component.new("Ext.grid.GroupingView", { :forceFit => true })
|
172
|
+
elsif value.is_a?(Hash)
|
173
|
+
view = Component.new("Ext.grid.GroupingView", { :forceFit => true })
|
174
|
+
else
|
175
|
+
view = value
|
176
|
+
end
|
177
|
+
|
178
|
+
before << view.to_s
|
179
|
+
after << view.after
|
180
|
+
config[:view] = l(view.get_var)
|
181
|
+
end
|
182
|
+
|
183
|
+
# Generate or set a new Ext.data.GroupingStore
|
184
|
+
def store(value=nil, url=nil, &block)
|
185
|
+
datastore = value.is_a?(Store) ? value : Store.new(&block)
|
186
|
+
before << datastore.to_s
|
187
|
+
after << datastore.after
|
188
|
+
config[:store] = l(datastore.get_var)
|
189
|
+
end
|
190
|
+
|
191
|
+
# Generate or set new Ext.grid.ColumnModel
|
192
|
+
def columns(value=nil, &block)
|
193
|
+
options = { :columns => [] }
|
194
|
+
if config[:sm] && before.find { |js| js.start_with?("var #{config[:sm]} = new Ext.grid.CheckboxSelectionModel") }
|
195
|
+
options[:columns] << config[:sm]
|
196
|
+
end
|
197
|
+
columnmodel = value.is_a?(ColumnModel) ? value : ColumnModel.new(options, &block)
|
198
|
+
before << columnmodel.to_s
|
199
|
+
after << columnmodel.after
|
200
|
+
config[:cm] = l(columnmodel.get_var)
|
201
|
+
end
|
202
|
+
|
203
|
+
# The base_path used for ToolBar, it's used for generate [:new, :edit, :destory] urls
|
204
|
+
def base_path(value)
|
205
|
+
@base_path = value
|
206
|
+
end
|
207
|
+
|
208
|
+
# The path for ToolBar New Button, if none given we use the base_path
|
209
|
+
def new_path(value)
|
210
|
+
@new_path = value
|
211
|
+
end
|
212
|
+
|
213
|
+
# The path for ToolBar Edit Button, if none given we use the base_path
|
214
|
+
def edit_path(value)
|
215
|
+
@edit_path = value
|
216
|
+
end
|
217
|
+
|
218
|
+
# The path for ToolBar Delete Button, if none given we use the base_path
|
219
|
+
def destroy_path(value)
|
220
|
+
@destroy_path = value
|
221
|
+
end
|
222
|
+
|
223
|
+
# The forgery_protection_token used for ToolBar
|
224
|
+
def forgery_protection_token(value)
|
225
|
+
@forgery_protection_token = value
|
226
|
+
end
|
227
|
+
|
228
|
+
# The authenticity_token used for ToolBar
|
229
|
+
def authenticity_token(value)
|
230
|
+
@authenticity_token = value
|
231
|
+
end
|
232
|
+
|
233
|
+
# Returns getSelectionModel().getSelected()
|
234
|
+
#
|
235
|
+
# Examples:
|
236
|
+
#
|
237
|
+
# # Generates: grid.getSelectionModel().getSelected().id
|
238
|
+
# grid.get_selected
|
239
|
+
#
|
240
|
+
# # Generates: getSelectionModel().getSelected().data['name']
|
241
|
+
# grid.get_selected(:name)
|
242
|
+
#
|
243
|
+
def get_selected(data=:id)
|
244
|
+
raise_error "No Column Selection Model Defined" if config[:sm].blank?
|
245
|
+
if data.to_sym == :id
|
246
|
+
l("#{config[:sm]}.getSelected().id")
|
247
|
+
else
|
248
|
+
l("#{config[:sm]}.getSelected().data[#{data.to_json}]")
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|
252
|
+
# Return the javascript for create a new Ext.grid.GridPanel
|
253
|
+
def to_s
|
254
|
+
if @default_tbar
|
255
|
+
raise_error "You must provide the base_path for autobuild toolbar." if @base_path.blank? && @new_path.blank? && @edit_path.blank? && @destroy_path.blank?
|
256
|
+
raise_error "You must provide the new_path for autobuild button new of toolbar." if @base_path.blank? && @new_path.blank?
|
257
|
+
raise_error "You must provide the edit_path for autobuild button edit of toolbar." if @base_path.blank? && @edit_path.blank?
|
258
|
+
raise_error "You must provide the destroy_path for autobuild button destroy of toolbar." if @base_path.blank? && @destroy_path.blank?
|
259
|
+
raise_error "You must provide the forgery_protection_token for autobuild toolbar." if @forgery_protection_token.blank?
|
260
|
+
raise_error "You must provide the authenticity_token for autobuild toolbar." if @authenticity_token.blank?
|
261
|
+
raise_error "You must provide the grid for autobuild toolbar." if get_var.blank?
|
262
|
+
raise_error "You must provide the selection model for autobuild toolbar." if config[:sm].blank?
|
263
|
+
raise_error "You must provide the store." if config[:store].blank?
|
264
|
+
end
|
265
|
+
|
266
|
+
if @default_tbar
|
267
|
+
after << render_javascript(:grid_functions, :var => get_var, :store => config[:store], :sm => config[:sm], :tbar => config[:tbar])
|
268
|
+
end
|
269
|
+
|
270
|
+
if config[:store]
|
271
|
+
after << "#{config[:store]}.on('beforeload', function(){ Backend.app.mask(); });"
|
272
|
+
after << "#{config[:store]}.on('load', function(){ Backend.app.unmask(); });"
|
273
|
+
after << "#{config[:store]}.load();"
|
274
|
+
end
|
275
|
+
|
276
|
+
after << "Backend.app.addItem(#{get_var})"
|
277
|
+
"#{before_js}var #{get_var} = new Ext.grid.GridPanel(#{config.to_s});#{after_js}"
|
278
|
+
end
|
279
|
+
end
|
280
|
+
end
|
281
|
+
end
|