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,103 @@
|
|
1
|
+
module Lipsiadmin#:nodoc:
|
2
|
+
module Ext#:nodoc:
|
3
|
+
# Generate a new Ext.data.GroupingStore
|
4
|
+
#
|
5
|
+
# Examples:
|
6
|
+
#
|
7
|
+
# var store = new Ext.data.GroupingStore({
|
8
|
+
# reader: new Ext.data.JsonReader({
|
9
|
+
# id:'id',
|
10
|
+
# totalProperty:'count', root:'results',
|
11
|
+
# fields:[{
|
12
|
+
# name: "accounts.name"
|
13
|
+
# },{
|
14
|
+
# name: "accounts.categories.name"
|
15
|
+
# },{
|
16
|
+
# type: "date",
|
17
|
+
# renderer: Ext.util.Format.dateRenderer(),
|
18
|
+
# name: "accounts.date",
|
19
|
+
# dateFormat: "c"
|
20
|
+
# },{
|
21
|
+
# type: "date",
|
22
|
+
# renderer: Ext.util.Format.dateTimeRenderer(),
|
23
|
+
# name: "accounts.datetime",
|
24
|
+
# dateFormat: "c"
|
25
|
+
# } ]}),
|
26
|
+
# proxy: new Ext.data.HttpProxy({ url:'/backend/accounts.json' }),
|
27
|
+
# remoteSort: true
|
28
|
+
# });
|
29
|
+
#
|
30
|
+
# grid.store do |store|
|
31
|
+
# store.url "/backend/accounts.json"
|
32
|
+
# store.add "accounts.name"
|
33
|
+
# store.add "accounts.categories.name"
|
34
|
+
# store.add "accounts.date", :type => :date
|
35
|
+
# store.add "accounts.datetime", :type => :datetime
|
36
|
+
# end
|
37
|
+
#
|
38
|
+
class Store < Component
|
39
|
+
attr_accessor :items
|
40
|
+
|
41
|
+
def initialize(options={}, &block)#:nodoc:
|
42
|
+
@items = []
|
43
|
+
super("Ext.data.GroupingStore", options, &block)
|
44
|
+
remoteSort l(true) if config[:remoteSort].blank?
|
45
|
+
baseParams("_method" => "GET") if config[:baseParams].blank?
|
46
|
+
end
|
47
|
+
|
48
|
+
# The url for getting the json data
|
49
|
+
def url(value)
|
50
|
+
@url = value
|
51
|
+
end
|
52
|
+
|
53
|
+
# This add automatically fields from an array
|
54
|
+
def fields(fields)
|
55
|
+
fields.each { |options| add(nil, options) }
|
56
|
+
end
|
57
|
+
|
58
|
+
# Add fields to a Ext.data.JsonReader
|
59
|
+
#
|
60
|
+
# Examples:
|
61
|
+
#
|
62
|
+
# {
|
63
|
+
# type: "date",
|
64
|
+
# renderer: Ext.util.Format.dateTimeRenderer(),
|
65
|
+
# name: "accounts.datetime",
|
66
|
+
# dateFormat: "c"
|
67
|
+
# }
|
68
|
+
#
|
69
|
+
# add "accounts.datetime", :type => :datetime
|
70
|
+
#
|
71
|
+
def add(name=nil, options={})#:nodoc:
|
72
|
+
options[:name] = name if name
|
73
|
+
case options[:type]
|
74
|
+
when :date then options.merge!({ :type => "date", :dateFormat => "Y-m-d" })
|
75
|
+
when :datetime then options.merge!({ :type => "date", :dateFormat => "c" })
|
76
|
+
end
|
77
|
+
raise ComponentError, "You must provide a Name for all fields" if options[:name].blank?
|
78
|
+
@items << Configuration.new(options)
|
79
|
+
end
|
80
|
+
|
81
|
+
# Return the javascript for create a new Ext.data.GroupingStore
|
82
|
+
def to_s
|
83
|
+
raise ComponentError, "You must provide the correct var the store." if get_var.blank?
|
84
|
+
raise ComponentError, "You must provide the url for get the store data." if @url.blank? && config[:proxy].blank?
|
85
|
+
raise ComponentError, "You must provide some fields for get build store." if items.blank?
|
86
|
+
config[:proxy] = default_proxy if config[:proxy].blank?
|
87
|
+
config[:reader] = default_reader if config[:reader].blank?
|
88
|
+
super
|
89
|
+
end
|
90
|
+
|
91
|
+
private
|
92
|
+
def default_proxy
|
93
|
+
l("new Ext.data.HttpProxy(#{Configuration.new(:url => @url).to_s(2)})")
|
94
|
+
end
|
95
|
+
|
96
|
+
def default_reader
|
97
|
+
options = { :id => "id", :totalProperty => "count", :root => "results", :fields => l("["+items.collect { |i| i.to_s(3) }.join(",")+"]") }
|
98
|
+
l("new Ext.data.JsonReader(#{Configuration.new(options).to_s(2)})")
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
<%= @sm %>.on('selectionchange', function(){
|
2
|
+
var n = <%= @sm %>.getSelected();
|
3
|
+
var btns = <%= @tbar %>.items.map;
|
4
|
+
|
5
|
+
if(!n){
|
6
|
+
btns.remove.disable();
|
7
|
+
btns.edit.disable();
|
8
|
+
return;
|
9
|
+
} else {
|
10
|
+
btns.remove.enable();
|
11
|
+
btns.edit.enable();
|
12
|
+
return;
|
13
|
+
}
|
14
|
+
});
|
15
|
+
|
16
|
+
function add(){
|
17
|
+
Backend.app.load('<%= @new_path.blank? ? "#{@base_path}/new" : @new_path %>');
|
18
|
+
}
|
19
|
+
|
20
|
+
function edit(){
|
21
|
+
Backend.app.load('<%= @edit_path || @base_path %>/'+<%= @sm %>.getSelected().id+'/edit');
|
22
|
+
}
|
23
|
+
|
24
|
+
function remove(){
|
25
|
+
Ext.Msg.confirm(Backend.locale.messages.confirm.title, String.format(Backend.locale.messages.confirm.message, <%= @sm %>.getCount()), function(btn, text){
|
26
|
+
if (btn == 'yes'){
|
27
|
+
<%= @sm %>.each(function(r){
|
28
|
+
Backend.app.mask();
|
29
|
+
Ext.Ajax.request({
|
30
|
+
url: '<%= @destroy_path || @base_path %>/'+r.id,
|
31
|
+
method: 'DELETE',
|
32
|
+
params: {<%= @forgery_protection_token %>: '<%= @authenticity_token %>'},
|
33
|
+
success: function(result, request){
|
34
|
+
Backend.app.unmask();
|
35
|
+
var resultValue = Ext.decode(result.responseText);
|
36
|
+
if (resultValue.success == true){
|
37
|
+
<%= @store %>.remove(r);
|
38
|
+
} else {
|
39
|
+
Ext.MessageBox.alert(Backend.locale.messages.alert.title, resultValue.msg);
|
40
|
+
return;
|
41
|
+
}
|
42
|
+
},
|
43
|
+
failure: function(result, request) {
|
44
|
+
Backend.app.unmask();
|
45
|
+
Ext.Msg.alert(Backend.locale.messages.alert.title, Backend.locale.messages.alert.message);
|
46
|
+
}
|
47
|
+
});
|
48
|
+
})
|
49
|
+
}
|
50
|
+
});
|
51
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Lipsiadmin
|
2
|
+
module Ext
|
3
|
+
# Generate a new Ext.Toolbar
|
4
|
+
#
|
5
|
+
# Examples:
|
6
|
+
#
|
7
|
+
# var toolBar = new Ext.Toolbar([{
|
8
|
+
# handler: show();,
|
9
|
+
# text: "Add",
|
10
|
+
# other: "...",
|
11
|
+
# icon: "..."
|
12
|
+
# },{
|
13
|
+
# handler: Backend.app.loadHtml('/accounts/'+accounts_grid.getSelected().id+'/edit'),
|
14
|
+
# text: "Edit",
|
15
|
+
# other: "..."
|
16
|
+
# }]);
|
17
|
+
#
|
18
|
+
# grid.tbar do |bar|
|
19
|
+
# bar.add "Add", :handler => bar.l("show();"), :icon => "...", :other => "..."
|
20
|
+
# bar.add "Edit", :handler => bar.l("Backend.app.loadHtml('/accounts/'+accounts_grid.getSelected().id+'/edit')"), :other => "..."
|
21
|
+
# end
|
22
|
+
#
|
23
|
+
class ToolBar < Component
|
24
|
+
attr_accessor :items
|
25
|
+
def initialize(options={}, &block)#:nodoc:
|
26
|
+
super("Ext.Toolbar", { :items => [] }.merge(options), &block)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Add new items to a Ext.Toolbar
|
30
|
+
#
|
31
|
+
# # Generates: { handler: show();, text: "Add", other: "...", icon: "..." }
|
32
|
+
# add "Add", :handler => bar.l("show();"), :icon => "...", :other => "..."
|
33
|
+
#
|
34
|
+
def add(name, options={})
|
35
|
+
options[:text] = name
|
36
|
+
config[:items] << Configuration.new(options)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,150 @@
|
|
1
|
+
require 'view/helpers/ext/component'
|
2
|
+
require 'view/helpers/ext/grid'
|
3
|
+
require 'view/helpers/ext/column_model'
|
4
|
+
require 'view/helpers/ext/tool_bar'
|
5
|
+
require 'view/helpers/ext/configuration'
|
6
|
+
require 'view/helpers/ext/store'
|
7
|
+
|
8
|
+
module Lipsiadmin
|
9
|
+
module View
|
10
|
+
module Helpers
|
11
|
+
# Module containing the methods useful for ext/prototype
|
12
|
+
module ExtHelper
|
13
|
+
|
14
|
+
def self.included(base)#:nodoc:
|
15
|
+
base.class_eval do
|
16
|
+
alias_method_chain :to_s, :refactoring
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def to_s_with_refactoring #:nodoc:
|
21
|
+
returning javascript = @lines * $/ do
|
22
|
+
source = javascript.dup
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# Hide all open dialogs
|
27
|
+
def hide_dialogs
|
28
|
+
record "Ext.Msg.getDialog().hide()"
|
29
|
+
end
|
30
|
+
|
31
|
+
# Replaces the inner HTML of the Main Panel of +Backend+.
|
32
|
+
#
|
33
|
+
# +options_for_render+ may be either a string of HTML to insert, or a hash
|
34
|
+
# of options to be passed to ActionView::Base#render. For example:
|
35
|
+
#
|
36
|
+
# # Replaces the inner HTML of the Main Panel of +Backend+.
|
37
|
+
# # Generates: Backend.app.update("-- Contents of 'person' partial --");
|
38
|
+
# page.update :partial => 'person', :object => @person
|
39
|
+
#
|
40
|
+
def update(*options_for_render)
|
41
|
+
call "Backend.app.update", render(*options_for_render), true
|
42
|
+
end
|
43
|
+
|
44
|
+
# Load html/js and eval it's code
|
45
|
+
#
|
46
|
+
# # Generates: Backend.app.loadJs('/my/javascript.js');
|
47
|
+
# load(:controller => :my, :action => :javascript, :format => :js)
|
48
|
+
#
|
49
|
+
def load(location, cache = false)
|
50
|
+
url = location.is_a?(String) ? location : @context.url_for(location)
|
51
|
+
call "Backend.app.load", url, cache
|
52
|
+
end
|
53
|
+
|
54
|
+
# Show errors (if they are) for the given +objects+ and show a Ext.Message
|
55
|
+
# with explanation of the errors or if errors are empty, a congratulation message.
|
56
|
+
#
|
57
|
+
# # Generates:
|
58
|
+
# # Ext.Msg.show({
|
59
|
+
# # title:Backend.locale.messages.alert.title,
|
60
|
+
# # msg: '<ul>Name can't be blank!</ul>',
|
61
|
+
# # buttons: Ext.Msg.OK,
|
62
|
+
# # minWidth: 400
|
63
|
+
# # })
|
64
|
+
# show_errors_for(@account)
|
65
|
+
#
|
66
|
+
def show_errors_for(*objects)
|
67
|
+
count = objects.inject(0) {|sum, object| sum + object.errors.count }
|
68
|
+
unless count.zero?
|
69
|
+
error_messages = objects.map {|object| object.errors.full_messages.map {|msg| "<li>#{msg}</li>" } }
|
70
|
+
record "Ext.Msg.show({
|
71
|
+
title: Backend.locale.messages.alert.title,
|
72
|
+
msg: '<ul>#{escape_javascript(error_messages.join)}</ul>',
|
73
|
+
buttons: Ext.Msg.OK,
|
74
|
+
minWidth: 400
|
75
|
+
});"
|
76
|
+
else
|
77
|
+
record "Ext.Msg.alert(Backend.locale.messages.compliments.title, Backend.locale.messages.compliments.message);"
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# Show a Ext.alert popup
|
82
|
+
#
|
83
|
+
# # Generates: Ext.Msg.alert('Hey!', 'Hello World')
|
84
|
+
# ext_alert('Hey!', 'Hello World')
|
85
|
+
#
|
86
|
+
def ext_alert(title, message)
|
87
|
+
call "Ext.Msg.alert", title, message
|
88
|
+
end
|
89
|
+
|
90
|
+
# Unmask the Backend App
|
91
|
+
#
|
92
|
+
# # Generates: Backend.app.unmask()
|
93
|
+
# unmask
|
94
|
+
#
|
95
|
+
def unmask
|
96
|
+
call "Backend.app.unmask"
|
97
|
+
end
|
98
|
+
|
99
|
+
# Mask the Backend App
|
100
|
+
#
|
101
|
+
# # Generates: Backend.app.mask('Hello World')
|
102
|
+
# mask("Hello World")
|
103
|
+
#
|
104
|
+
def mask(title=nil)
|
105
|
+
call "Backend.app.mask", title
|
106
|
+
end
|
107
|
+
|
108
|
+
# Create a javascript function
|
109
|
+
#
|
110
|
+
# # Generates: function() { window.show(); };
|
111
|
+
# page.fn("window.show();")
|
112
|
+
# or
|
113
|
+
# page.fn { |p| p.call "window.show" }
|
114
|
+
#
|
115
|
+
def fn(function=nil, &block)
|
116
|
+
if function
|
117
|
+
record "function() { #{literal(function)} }"
|
118
|
+
else
|
119
|
+
record block_to_function(function || block)
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
# Generate a full customizable Ext.GridPanel
|
124
|
+
#
|
125
|
+
# Examples:
|
126
|
+
#
|
127
|
+
# page.grid do |grid|
|
128
|
+
# grid.id "grid-posts"
|
129
|
+
# grid.title "List all Post"
|
130
|
+
# grid.base_path "/backend/posts"
|
131
|
+
# grid.forgery_protection_token request_forgery_protection_token
|
132
|
+
# grid.authenticity_token form_authenticity_token
|
133
|
+
# grid.tbar :default
|
134
|
+
# grid.store do |store|
|
135
|
+
# store.url "/backend/posts.json"
|
136
|
+
# store.fields @column_store.store_fields
|
137
|
+
# end
|
138
|
+
# grid.columns do |columns|
|
139
|
+
# columns.fields @column_store.column_fields
|
140
|
+
# end
|
141
|
+
# grid.bbar :store => grid.get_store, :pageSize => params[:limit]
|
142
|
+
# end
|
143
|
+
#
|
144
|
+
def grid(&block)
|
145
|
+
self << Lipsiadmin::Ext::Grid.new(&block)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
@@ -0,0 +1,222 @@
|
|
1
|
+
require "date"
|
2
|
+
require 'action_view/helpers/tag_helper'
|
3
|
+
module Lipsiadmin
|
4
|
+
module View
|
5
|
+
module Helpers#:nodoc:
|
6
|
+
# Returns text_area, text_field, password_field with
|
7
|
+
# a default extjs css style.
|
8
|
+
#
|
9
|
+
module FormHelper
|
10
|
+
def self.included(base)#:nodoc:
|
11
|
+
base.alias_method_chain :text_area, :style
|
12
|
+
base.alias_method_chain :text_field, :style
|
13
|
+
base.alias_method_chain :password_field, :style
|
14
|
+
end
|
15
|
+
|
16
|
+
# Returns text_area with extjs style
|
17
|
+
# alias for text_area, for use the original tag use:
|
18
|
+
#
|
19
|
+
# text_area_without_style
|
20
|
+
#
|
21
|
+
def text_area_with_style(name, value = nil, options = {})
|
22
|
+
options[:class] ||= "x-form-field"
|
23
|
+
options[:style] ||= "width:100%;height:80px"
|
24
|
+
text_area_without_style(name, value, options)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Returns text_field with extjs style
|
28
|
+
# alias for text_field, for use the original tag use:
|
29
|
+
#
|
30
|
+
# text_field_without_style
|
31
|
+
#
|
32
|
+
def text_field_with_style(name, method, options = {})
|
33
|
+
options[:class] ||= "x-form-text"
|
34
|
+
options[:style] ||= "width:100%"
|
35
|
+
text_field_without_style(name, method, options)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Returns password_field with extjs style
|
39
|
+
# alias for password_field, for use the original tag use:
|
40
|
+
#
|
41
|
+
# password_field_without_style
|
42
|
+
#
|
43
|
+
def password_field_with_style(name, method, options = {})
|
44
|
+
options[:class] ||= "x-form-text"
|
45
|
+
options[:style] ||= "width:100%"
|
46
|
+
password_field_without_style(name, method, options)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# Returns text_area_tag, text_field_tag, password_field_tag with
|
51
|
+
# a default extjs css style.
|
52
|
+
#
|
53
|
+
module FormTagHelper
|
54
|
+
|
55
|
+
def self.included(base)#:nodoc:
|
56
|
+
base.alias_method_chain :text_field_tag, :style
|
57
|
+
base.alias_method_chain :text_area_tag, :style
|
58
|
+
base.alias_method_chain :password_field_tag, :style
|
59
|
+
end
|
60
|
+
|
61
|
+
# Returns text_area_tag with extjs style
|
62
|
+
# alias for text_area_tag, for use the original tag use:
|
63
|
+
#
|
64
|
+
# text_area_tag_without_style
|
65
|
+
#
|
66
|
+
def text_area_tag_with_style(name, value = nil, options = {})
|
67
|
+
options[:class] ||= "x-form-field"
|
68
|
+
options[:style] ||= "width:100%;height:80px"
|
69
|
+
text_area_tag_without_style(name, value, options)
|
70
|
+
end
|
71
|
+
|
72
|
+
# Returns text_field_tag with extjs style
|
73
|
+
# alias for text_field_tag, for use the original tag use:
|
74
|
+
#
|
75
|
+
# text_field_tag_without_style
|
76
|
+
#
|
77
|
+
def text_field_tag_with_style(name, value = nil, options = {})
|
78
|
+
options[:class] ||= "x-form-text"
|
79
|
+
options[:style] ||= "width:100%"
|
80
|
+
text_field_tag_without_style(name, value, options)
|
81
|
+
end
|
82
|
+
|
83
|
+
# Returns password_field_tag with extjs style
|
84
|
+
# alias for password_field_tag, for use the original tag use:
|
85
|
+
#
|
86
|
+
# password_field_tag_style
|
87
|
+
#
|
88
|
+
def password_field_tag_with_style(name, value = nil, options = {})
|
89
|
+
options[:class] ||= "x-form-text"
|
90
|
+
options[:style] ||= "width:100%"
|
91
|
+
password_field_tag_without_style(name, value, options)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
module DateHelper
|
96
|
+
# Returns an ExtJs Calendar
|
97
|
+
#
|
98
|
+
# Examples:
|
99
|
+
# =ext_date_select :post, :created_at
|
100
|
+
#
|
101
|
+
def ext_date_select(object_name, method, options = {}, html_options = {})
|
102
|
+
InstanceTag.new(object_name, method, self, options.delete(:object)).to_ext_date_select_tag(options, html_options)
|
103
|
+
end
|
104
|
+
|
105
|
+
# Returns an ExtJs Calendar and a Time selector
|
106
|
+
#
|
107
|
+
# Examples:
|
108
|
+
# =ext_datetime_select :post, :updated_at
|
109
|
+
#
|
110
|
+
def ext_datetime_select(object_name, method, options = {}, html_options = {})
|
111
|
+
InstanceTag.new(object_name, method, self, options.delete(:object)).to_ext_datetime_select_tag(options, html_options)
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
module CountrySelectHelper
|
116
|
+
# Return select and option tags for the given object and method, using country_options_for_select to generate the list of option tags.
|
117
|
+
def country_select(object, method, priority_countries = nil, options = {}, html_options = {})
|
118
|
+
InstanceTag.new(object, method, self, options.delete(:object)).to_country_select_tag(priority_countries, options, html_options)
|
119
|
+
end
|
120
|
+
# Returns a string of option tags for pretty much any country in the world. Supply a country name as +selected+ to
|
121
|
+
# have it marked as the selected option tag. You can also supply an array of countries as +priority_countries+, so
|
122
|
+
# that they will be listed above the rest of the (long) list.
|
123
|
+
#
|
124
|
+
# NOTE: Only the option tags are returned, you have to wrap this call in a regular HTML select tag.
|
125
|
+
def country_options_for_select(selected = nil, priority_countries = nil)
|
126
|
+
country_options = ""
|
127
|
+
|
128
|
+
if priority_countries
|
129
|
+
country_options += options_for_select(priority_countries, selected)
|
130
|
+
country_options += "<option value=\"\" disabled=\"disabled\">-------------</option>\n"
|
131
|
+
end
|
132
|
+
|
133
|
+
return country_options + options_for_select(COUNTRIES, selected)
|
134
|
+
end
|
135
|
+
# All the countries included in the country_options output.
|
136
|
+
COUNTRIES = ["Afghanistan", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Angola",
|
137
|
+
"Anguilla", "Antarctica", "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria",
|
138
|
+
"Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin",
|
139
|
+
"Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegowina", "Botswana", "Bouvet Island", "Brazil",
|
140
|
+
"British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia",
|
141
|
+
"Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China",
|
142
|
+
"Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo",
|
143
|
+
"Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba",
|
144
|
+
"Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "Ecuador", "Egypt",
|
145
|
+
"El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands (Malvinas)",
|
146
|
+
"Faroe Islands", "Fiji", "Finland", "France", "French Guiana", "French Polynesia",
|
147
|
+
"French Southern Territories", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guernsey", "Guinea",
|
148
|
+
"Guinea-Bissau", "Guyana", "Haiti", "Heard and McDonald Islands", "Holy See (Vatican City State)",
|
149
|
+
"Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran, Islamic Republic of", "Iraq",
|
150
|
+
"Ireland", "Isle of Man", "Israel", "Italy", "Jamaica", "Japan", "Jersey", "Jordan", "Kazakhstan", "Kenya",
|
151
|
+
"Kiribati", "Korea, Democratic People's Republic of", "Korea, Republic of", "Kuwait", "Kyrgyzstan",
|
152
|
+
"Lao People's Democratic Republic", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libyan Arab Jamahiriya",
|
153
|
+
"Liechtenstein", "Lithuania", "Luxembourg", "Macao", "Macedonia, The Former Yugoslav Republic Of",
|
154
|
+
"Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique",
|
155
|
+
"Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia, Federated States of", "Moldova, Republic of",
|
156
|
+
"Monaco", "Mongolia", "Montenegro", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru",
|
157
|
+
"Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", "Nicaragua", "Niger",
|
158
|
+
"Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau",
|
159
|
+
"Palestinian Territory, Occupied", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines",
|
160
|
+
"Pitcairn", "Poland", "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russian Federation",
|
161
|
+
"Rwanda", "Saint Barthelemy", "Saint Helena", "Saint Kitts and Nevis", "Saint Lucia",
|
162
|
+
"Saint Pierre and Miquelon", "Saint Vincent and the Grenadines", "Samoa", "San Marino",
|
163
|
+
"Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia", "Seychelles", "Sierra Leone", "Singapore",
|
164
|
+
"Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa",
|
165
|
+
"South Georgia and the South Sandwich Islands", "Spain", "Sri Lanka", "Sudan", "Suriname",
|
166
|
+
"Svalbard and Jan Mayen", "Swaziland", "Sweden", "Switzerland", "Syrian Arab Republic",
|
167
|
+
"Taiwan, Province of China", "Tajikistan", "Tanzania, United Republic of", "Thailand", "Timor-Leste",
|
168
|
+
"Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan",
|
169
|
+
"Turks and Caicos Islands", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom",
|
170
|
+
"United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela",
|
171
|
+
"Viet Nam", "Virgin Islands, British", "Virgin Islands, U.S.", "Wallis and Futuna", "Western Sahara",
|
172
|
+
"Yemen", "Zambia", "Zimbabwe"] unless const_defined?("COUNTRIES")
|
173
|
+
end
|
174
|
+
|
175
|
+
class InstanceTag < ActionView::Helpers::InstanceTag#:nodoc:
|
176
|
+
include CountrySelectHelper
|
177
|
+
|
178
|
+
def to_ext_date_select_tag(options = {}, html_options = {})
|
179
|
+
to_ext_datetime_select_tag({ :hideTime => true.to_l }.merge(options), html_options)
|
180
|
+
end
|
181
|
+
|
182
|
+
def to_ext_datetime_select_tag(options = {}, html_options = {})
|
183
|
+
html_options = html_options.stringify_keys
|
184
|
+
html_options = DEFAULT_FIELD_OPTIONS.merge(html_options)
|
185
|
+
html_options["type"] = "hidden"
|
186
|
+
html_options["value"] ||= value_before_type_cast(object)
|
187
|
+
html_options["value"] &&= html_escape(html_options["value"])
|
188
|
+
add_default_name_and_id(html_options)
|
189
|
+
options = { :applyTo => html_options["id"], :dateFormat => I18n.t("extjs.dateFormat") }.merge(options)
|
190
|
+
tag("input", html_options) +
|
191
|
+
content_tag(:script, "new Ext.form.DateTimeField(#{options.to_json});", :type => Mime::JS)
|
192
|
+
end
|
193
|
+
|
194
|
+
def to_country_select_tag(priority_countries, options, html_options)
|
195
|
+
html_options = html_options.stringify_keys
|
196
|
+
add_default_name_and_id(html_options)
|
197
|
+
value = value(object)
|
198
|
+
content_tag("select",
|
199
|
+
add_options(
|
200
|
+
country_options_for_select(value, priority_countries),
|
201
|
+
options, value
|
202
|
+
), html_options
|
203
|
+
)
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
module FormBuilder#:nodoc:
|
208
|
+
def ext_date_select(method, options = {}, html_options = {})
|
209
|
+
@template.ext_date_select(@object_name, method, options.merge(:object => @object), html_options)
|
210
|
+
end
|
211
|
+
|
212
|
+
def ext_datetime_select(method, options = {}, html_options = {})
|
213
|
+
@template.ext_datetime_select(@object_name, method, options.merge(:object => @object), html_options)
|
214
|
+
end
|
215
|
+
|
216
|
+
def country_select(method, priority_countries = nil, options = {}, html_options = {})
|
217
|
+
@template.country_select(@object_name, method, priority_countries, options.merge(:object => @object), html_options)
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
221
|
+
end
|
222
|
+
end
|