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
data/CHANGELOG
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
2009-02-27
|
2
|
+
* Fixed a litte padding in firefox for datetimefield
|
3
|
+
* Fixed a typo in account.rb
|
4
|
+
* Fixed attachment creation for new records
|
5
|
+
* Fixed a little problem with the generation of the attachment table
|
6
|
+
* Added an options for prevent sending email, usefull for test rescue but not email report
|
7
|
+
* Fixed a translation in backend_helper
|
8
|
+
* Fixed a double render action in pdf
|
9
|
+
* Added send_data as an options in pdf builder (for the controller)
|
10
|
+
* Fixed the en locale for backend
|
11
|
+
* Added scope to the component events
|
12
|
+
* Added a new task for update javascripts (add require 'lipsiadmin_tasks' if you don't have yet in your RakeFile)
|
13
|
+
* Fixed padding in DateTime Field for firefox
|
14
|
+
* Removed not necessary frontend images
|
15
|
+
* Extended Ext Component to be more flexible
|
16
|
+
* Small refactoring of ext components
|
17
|
+
|
18
|
+
2009-02-26
|
19
|
+
* Removed a grid unusued var
|
20
|
+
* Added a new method to grid for getSelection
|
21
|
+
* Added a as default grid.on("dblclick", edit)
|
22
|
+
* Added a component handler (eg. grid.on(:dblclick, ...))
|
23
|
+
* Fixed a litte error in date renderer
|
24
|
+
* Fixed a litte error in Ext.form.DateTimeField
|
25
|
+
* Added a padding for exceptions in standard.css
|
26
|
+
* Fixed a litte error in backend.js
|
27
|
+
* Fixed update, for force text/html header
|
28
|
+
* Added two helpers to ext for mask, unmask Backend.app
|
29
|
+
* Improved the exception_notifier and rescue templates for backend
|
30
|
+
* Fixed ext_alert helper
|
31
|
+
* Fixed ext_date_select
|
32
|
+
* Fixed a little problem in exception notifier
|
33
|
+
* Added a rescue if association not found in column_store
|
34
|
+
* Improved documentation of box helper
|
35
|
+
* Fixed a missing localization in box helper
|
36
|
+
* Added :start => :close/:ope to the box helper
|
37
|
+
* Added :style => "mystyle" to the box helper
|
38
|
+
* Added in grid builder (edit, new, destroy) path for toolbar
|
39
|
+
* Little reformat to Lipsiadmin::Controller::Ext::ColumnStore
|
40
|
+
* Added new renderer in column model (boolean, eur_money, us_money)
|
41
|
+
* Updated the remember file of script/generate backend_page
|
42
|
+
* Improved store_data :include etc... see documentation Lipsiadmin::Controller::Ext for more details
|
43
|
+
* Fixed a dataIndex conditions
|
44
|
+
* Imporoved mapping columns for a better search
|
45
|
+
|
46
|
+
2009-02-25
|
47
|
+
* Improved documentation now is online here http://api.lipsiasoft.com
|
48
|
+
* Refactored text_field, text_area, password_field helpers
|
49
|
+
* Refactored country_select helper
|
50
|
+
* Refactored ext_date_select, ext_datetime_select helpers
|
51
|
+
|
52
|
+
2008-02-24
|
53
|
+
* Rename Js app from Lipsiadmin.app to Backend.app
|
54
|
+
* Added the possibility to reuse pages/froms/grids in windows.
|
55
|
+
* Removed all external plugins
|
56
|
+
* Rewritten Attachment creation
|
57
|
+
* Rewritten Authentication and Menu creation
|
58
|
+
* Rewritten all Helpers (now more fast)
|
59
|
+
* Added a new helper for build extjs calendar (eg. ext_datetime :model, :created_at)
|
60
|
+
* Added a new helper for build ext box
|
61
|
+
* Included the missing country_select
|
62
|
+
* Added helpers for build rjs grids
|
63
|
+
* Grid by default have a search box that is no longer clientside but serverside
|
64
|
+
* Improved html tags using the extjs stylesheets
|
65
|
+
* Improved performances of javascript
|
66
|
+
* Minimized ExtJs and Rails javascripts
|
67
|
+
* Added a support request
|
68
|
+
* Added an exception notifier
|
69
|
+
* Rewritten pdf builder and helper
|
70
|
+
* Added a pdf builder for actionmailer
|
71
|
+
* Added method missing in ActiveRecord to intercept calls to non-localized methods (eg. name instead of name_cz)
|
72
|
+
* Added utility scopes for paginate, include, search
|
73
|
+
* Added a new literal method for prevent json to "strignify" javascripts funtctions (eg. "function() { alert('me')}".to_l)
|
74
|
+
* Added a new module for escape utf8 chars for servers that don't have java with utf8 fonts (it's used by pdf builder)
|
75
|
+
|
76
|
+
2008-05-21
|
77
|
+
* Added a new PDF generator, we don't need the expensive PRINCEXML, we can use pd4ml
|
78
|
+
|
79
|
+
2008-05-12.
|
80
|
+
* Added a manifest that show the current routes that are necessary to add
|
81
|
+
|
82
|
+
2008-05-09.
|
83
|
+
* Added ext-all-debug.js (Was autodetect if env == development)
|
84
|
+
* Removed menuitems table and added new module project
|
85
|
+
* Improve Auth System with project modules
|
86
|
+
* Initial rdoc documentation
|
87
|
+
* Removed from admin view list to index so we can use cruds
|
88
|
+
* Improve Admin -> Accounts for add project modules
|
89
|
+
* Added new class AccessControl (Documented)
|
90
|
+
* New config file for roles, modules in initializers/access_rules.rb
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2008 Davide D'Agostino, LipsiaSoft s.r.l.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
==Lipsiadmin
|
2
|
+
|
3
|
+
Lipsiadmin is a new revolutionary admin for your projects.
|
4
|
+
|
5
|
+
Is developped by http://www.lipsiasoft.com that use it from 2 years in production enviroments.
|
6
|
+
|
7
|
+
Lipsiadmin is based on Ext Js 2.2 framework (with prototype adapter) works with Rails 2+
|
8
|
+
|
9
|
+
This admin is for newbie developper but also for experts, is not entirely written in javascript
|
10
|
+
because the aim of developper wose build in a agile way web/site apps so we use extjs in a new
|
11
|
+
intelligent way a mixin of <tt>old</tt> html and new ajax functions,
|
12
|
+
for example ext manage the layout of page, grids, tree and errors, but form are in html code.
|
13
|
+
|
14
|
+
Author:: Davide D'Agostino
|
15
|
+
Copyright:: Copyright (c) 2009 Lipsiasoft s.r.l. (http://www.lipsiasoft.com)
|
16
|
+
License:: MIT License (http://www.opensource.org/licenses/mit-license.php)
|
17
|
+
Api Documentation:: http://api.lipsiasoft.com
|
18
|
+
Community:: http://groups.google.com/group/lipsiadmin
|
19
|
+
|
20
|
+
==Requirements
|
21
|
+
|
22
|
+
Rails 2+
|
23
|
+
Haml 2+
|
24
|
+
|
25
|
+
==Installation
|
26
|
+
|
27
|
+
script/plugin install git://github.com/Lipsiasoft/lipsiadmin.git
|
28
|
+
|
29
|
+
The version 2.9 version is an alpha relase and the gem will be aviable from 3.0
|
30
|
+
|
31
|
+
In future you can simply do:
|
32
|
+
|
33
|
+
in config/environments.rb
|
34
|
+
config.gem "lipsiadmin"
|
35
|
+
|
36
|
+
then (if you don't have it already)
|
37
|
+
|
38
|
+
$ rake gems:install
|
39
|
+
|
40
|
+
==Examples
|
41
|
+
|
42
|
+
now run script/generate and you can see some like:
|
43
|
+
|
44
|
+
Installed Generators
|
45
|
+
Builtin: controller, integration_test, mailer, migration, model, etc..
|
46
|
+
Lipsiadmin: attachment, backend, backend_page, pdf
|
47
|
+
|
48
|
+
So you can do:
|
49
|
+
|
50
|
+
$ script/generate backend # Generate the base admin
|
51
|
+
$ script/generate backend_page yourmodel # Generate a "scaffold" for your model
|
52
|
+
$ script/generate attachment # Generate the an attachments
|
53
|
+
$ script/generate pdf PdfName # Generate a new pdf document
|
54
|
+
|
55
|
+
==Contribute
|
56
|
+
|
57
|
+
Please contribute in coding, patch, and submitting translation api documentation etc...
|
58
|
+
|
59
|
+
Community can be found here:: http://groups.google.com/group/lipsiadmin
|
60
|
+
Api documentation can be found here:: http://api.lipsiasoft.com
|
data/Rakefile
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'rake/testtask'
|
4
|
+
require 'rake/rdoctask'
|
5
|
+
require 'rake/packagetask'
|
6
|
+
require 'rake/gempackagetask'
|
7
|
+
require 'rake/contrib/sshpublisher'
|
8
|
+
|
9
|
+
PKG_NAME = 'lipsiadmin'
|
10
|
+
PKG_VERSION = "2.9"
|
11
|
+
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
12
|
+
|
13
|
+
$LOAD_PATH << File.join(File.dirname(__FILE__), 'lib')
|
14
|
+
|
15
|
+
desc 'Default: install the gem.'
|
16
|
+
task :default => [:install]
|
17
|
+
|
18
|
+
desc 'Generate documentation for the lipsiadmin plugin.'
|
19
|
+
Rake::RDocTask.new(:rdoc) do |rdoc|
|
20
|
+
rdoc.rdoc_dir = 'doc'
|
21
|
+
rdoc.title = 'Lipsiadmin'
|
22
|
+
rdoc.options << '--line-numbers' << '--inline-source' << '--accessor' << 'cattr_accessor=object'
|
23
|
+
rdoc.options << '--charset' << 'utf-8'
|
24
|
+
rdoc.template = 'resources/rdoc/horo'
|
25
|
+
rdoc.rdoc_files.include('README', 'CHANGELOG')
|
26
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
27
|
+
end
|
28
|
+
|
29
|
+
desc 'Clean up files.'
|
30
|
+
task :clean do |t|
|
31
|
+
FileUtils.rm_rf "doc"
|
32
|
+
FileUtils.rm_rf "tmp"
|
33
|
+
FileUtils.rm_rf "pkg"
|
34
|
+
end
|
35
|
+
|
36
|
+
spec = Gem::Specification.new do |s|
|
37
|
+
s.name = PKG_NAME
|
38
|
+
s.version = PKG_VERSION
|
39
|
+
s.author = "Davide D'Agostino"
|
40
|
+
s.email = "d.dagostino@lipsiasoft.com"
|
41
|
+
s.homepage = "http://groups.google.com/group/lipsiadmin"
|
42
|
+
s.rubyforge_project = "lipsiadmin"
|
43
|
+
s.platform = Gem::Platform::RUBY
|
44
|
+
s.summary = "Lipsiadmin is a new revolutionary admin for your projects.Lipsiadmin is based on Ext Js 2.0. framework (with prototype adapter) and is ready for Rails 2.0. This admin is for newbie developper but also for experts, is not entirely written in javascript because the aim of developper wose build in a agile way web/site apps so we use extjs in a new intelligent way a mixin of “old” html and new ajax functions, for example ext manage the layout of page, grids, tree and errors, but form are in html code."
|
45
|
+
s.files = FileList["CHANGELOG", "README", "MIT-LICENSE", "Rakefile", "init.rb", "{lipsiadmin_generators,lib,resources,tasks}/**/*"].to_a
|
46
|
+
s.has_rdoc = true
|
47
|
+
s.requirements << 'Haml'
|
48
|
+
s.requirements << 'Rails'
|
49
|
+
end
|
50
|
+
|
51
|
+
Rake::GemPackageTask.new(spec) do |p|
|
52
|
+
p.gem_spec = spec
|
53
|
+
p.need_tar = true
|
54
|
+
p.need_zip = true
|
55
|
+
end
|
56
|
+
|
57
|
+
desc "Install the gem locally"
|
58
|
+
task :install => [:uninstall, :repackage] do
|
59
|
+
sh %{sudo gem install pkg/#{PKG_FILE_NAME}.gem --no-ri --no-rdoc}
|
60
|
+
end
|
61
|
+
|
62
|
+
desc "Unistall the gem from local"
|
63
|
+
task :uninstall => [:clean] do
|
64
|
+
sh %{sudo gem uninstall #{PKG_NAME}} rescue nil
|
65
|
+
end
|
66
|
+
|
67
|
+
desc "Generate a gemspec file for GitHub"
|
68
|
+
task :gemspec do
|
69
|
+
File.open("#{spec.name}.gemspec", 'w') do |f|
|
70
|
+
f.write spec.to_ruby
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
desc "Publish the API documentation"
|
75
|
+
task :pdoc => [:rdoc] do
|
76
|
+
Rake::SshDirPublisher.new("root@server1.lipsiasoft.com", "/var/www/apps/lipsiadmin/rdoc", "doc").upload
|
77
|
+
end
|
78
|
+
|
79
|
+
desc "Publish the release files to RubyForge."
|
80
|
+
task :release => [ :package ] do
|
81
|
+
require 'rubyforge'
|
82
|
+
require 'rake/contrib/rubyforgepublisher'
|
83
|
+
|
84
|
+
packages = %w( gem tgz zip ).collect{ |ext| "pkg/#{PKG_NAME}-#{PKG_VERSION}.#{ext}" }
|
85
|
+
|
86
|
+
rubyforge = RubyForge.new
|
87
|
+
rubyforge.configure
|
88
|
+
rubyforge.login
|
89
|
+
rubyforge.add_release(PKG_NAME, PKG_NAME, "REL #{PKG_VERSION}", *packages)
|
90
|
+
end
|
data/init.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'lipsiadmin'
|
@@ -0,0 +1,105 @@
|
|
1
|
+
module Lipsiadmin
|
2
|
+
module AccessControl
|
3
|
+
# This provide a simple login for backend and frontend.
|
4
|
+
# Use backend_login_required in backend and
|
5
|
+
# frontend_login_requirded in frontend.
|
6
|
+
#
|
7
|
+
# Examples:
|
8
|
+
#
|
9
|
+
# class FrontendController < ApplicationController
|
10
|
+
# before_filter :login_frontend_required, :except => [:login]
|
11
|
+
# end
|
12
|
+
#
|
13
|
+
module Authentication
|
14
|
+
protected
|
15
|
+
|
16
|
+
# Returns true if <tt>current_account</tt> is logged and active.
|
17
|
+
def logged_in?
|
18
|
+
current_account != :false && current_account.active?
|
19
|
+
end
|
20
|
+
|
21
|
+
# Returns the current_account, it's an instance of <tt>Account</tt> model
|
22
|
+
def current_account
|
23
|
+
@current_account ||= (login_from_session || :false)
|
24
|
+
end
|
25
|
+
|
26
|
+
# Ovverride the current_account, you must provide an instance of Account Model
|
27
|
+
#
|
28
|
+
# Examples:
|
29
|
+
#
|
30
|
+
# current_account = Account.last
|
31
|
+
#
|
32
|
+
def current_account=(new_account)
|
33
|
+
session[:account] = (new_account.nil? || new_account.is_a?(Symbol)) ? nil : new_account.id
|
34
|
+
@current_account = new_account
|
35
|
+
end
|
36
|
+
|
37
|
+
# Returns true if the <tt>current_account</tt> is allowed to see the requested
|
38
|
+
# controller/action.
|
39
|
+
#
|
40
|
+
# For configure this role please refer to: <tt>Lipsiadmin::AccessControl::Base</tt>
|
41
|
+
def allowed?
|
42
|
+
allowed = current_account.maps.collect(&:allowed)[0]
|
43
|
+
denied = current_account.maps.collect(&:denied)[0]
|
44
|
+
|
45
|
+
allow = allowed.find do |a|
|
46
|
+
a[:controller] == params[:controller] &&
|
47
|
+
(a[:action].blank? || a[:action] == params[:action])
|
48
|
+
end
|
49
|
+
|
50
|
+
deny = denied.find do |a|
|
51
|
+
a[:controller] == params[:controller] &&
|
52
|
+
(a[:action].blank? || a[:action] == params[:action])
|
53
|
+
end
|
54
|
+
|
55
|
+
return allow && !deny
|
56
|
+
end
|
57
|
+
|
58
|
+
# Returns a helper to pass in a <tt>before_filter</tt> for check if
|
59
|
+
# an account are: <tt>logged_in?</tt> and <tt>allowed?</tt>
|
60
|
+
#
|
61
|
+
# By default this method is used in BackendController so is not necessary
|
62
|
+
def backend_login_required
|
63
|
+
logged_in? && allowed? || access_denied(:backend)
|
64
|
+
end
|
65
|
+
|
66
|
+
# Returns a helper to pass in a <tt>before_filter</tt> for check if
|
67
|
+
# an account are: <tt>logged_in?</tt> and <tt>allowed?</tt>
|
68
|
+
#
|
69
|
+
# Examples:
|
70
|
+
#
|
71
|
+
# before_filter :login_frontend_required, :except => [:login]
|
72
|
+
#
|
73
|
+
def fronted_login_required
|
74
|
+
logged_in? && allowed? || access_denied(:backend)
|
75
|
+
end
|
76
|
+
|
77
|
+
def access_denied(where)#:nodoc:
|
78
|
+
respond_to do |format|
|
79
|
+
format.html { redirect_to :controller => "#{where}/sessions", :action => :new }
|
80
|
+
format.js { render(:update) { |page| page.alert "You don't allowed to access to this javascript" } }
|
81
|
+
end
|
82
|
+
false
|
83
|
+
end
|
84
|
+
|
85
|
+
def store_location#:nodoc:
|
86
|
+
session[:return_to] = request.request_uri
|
87
|
+
end
|
88
|
+
|
89
|
+
# Redirect the account to the page that requested an authentication or
|
90
|
+
# if the account is not allowed/logged return it to a default page
|
91
|
+
def redirect_back_or_default(default)
|
92
|
+
redirect_to(session[:return_to] || default)
|
93
|
+
session[:return_to] = nil
|
94
|
+
end
|
95
|
+
|
96
|
+
def self.included(base)#:nodoc:
|
97
|
+
base.send :helper_method, :current_account, :logged_in?
|
98
|
+
end
|
99
|
+
|
100
|
+
def login_from_session#:nodoc:
|
101
|
+
self.current_account = Account.find_by_id(session[:account]) if session[:account]
|
102
|
+
end
|
103
|
+
end # Module Authentication
|
104
|
+
end # Module AccessControl
|
105
|
+
end # Module Backend
|
@@ -0,0 +1,227 @@
|
|
1
|
+
module Lipsiadmin
|
2
|
+
module AccessControl
|
3
|
+
module Helper#:nodoc:
|
4
|
+
def recognize_path(path)#:nodoc:
|
5
|
+
case path
|
6
|
+
when String then ActionController::Routing::Routes.recognize_path(path, :method => :get)
|
7
|
+
when Hash then path
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# This Class map and get roles/projects for accounts
|
13
|
+
#
|
14
|
+
# Examples:
|
15
|
+
#
|
16
|
+
# roles_for :administrator do |role|
|
17
|
+
# role.allow_all_actions "/backend/base"
|
18
|
+
# role.deny_action_of "/backend/accounts/details"
|
19
|
+
#
|
20
|
+
# role.project_module :administration do |project|
|
21
|
+
# project.menu :general_settings, "/backend/settings" do |submenu|
|
22
|
+
# submenu.add :accounts, "/backend/accounts" do |submenu|
|
23
|
+
# submenu.add :sub_accounts, "/backend/accounts/subaccounts"
|
24
|
+
# end
|
25
|
+
# end
|
26
|
+
# end
|
27
|
+
# end
|
28
|
+
#
|
29
|
+
# If a user logged with role administrator or that have a project_module administrator can:
|
30
|
+
#
|
31
|
+
# - Access in all actions of "/backend/base" controller
|
32
|
+
# - Denied access to ONLY action <tt>"/backend/accounts/details"</tt>
|
33
|
+
# - Access to a project module called Administration
|
34
|
+
# - Access to all actions of the controller "/backend/settings"
|
35
|
+
# - Access to all actions EXCEPT <tt>details</tt> of controller "/backend/accounts"
|
36
|
+
#
|
37
|
+
class Base
|
38
|
+
|
39
|
+
class << self
|
40
|
+
|
41
|
+
# We map project modules for a given role or roles
|
42
|
+
def roles_for(*roles, &block)
|
43
|
+
roles.each { |role| raise AccessControlError, "Role #{role} must be a symbol!" unless role.is_a?(Symbol) }
|
44
|
+
@mappers ||= []
|
45
|
+
@roles ||= []
|
46
|
+
@roles.concat(roles)
|
47
|
+
@mappers << Mapper.new(*roles, &block)
|
48
|
+
end
|
49
|
+
|
50
|
+
# Returns all roles
|
51
|
+
def roles
|
52
|
+
@roles.collect(&:to_s)
|
53
|
+
end
|
54
|
+
|
55
|
+
# Returns all project modules ids
|
56
|
+
def project_modules
|
57
|
+
@mappers.inject([]) do |pm, maps|
|
58
|
+
pm.concat(maps.project_modules.collect(&:uid))
|
59
|
+
end.uniq
|
60
|
+
end
|
61
|
+
|
62
|
+
# Returns maps for a given role
|
63
|
+
def find_by_role(role)
|
64
|
+
role = case role
|
65
|
+
when String then role.downcase.to_sym
|
66
|
+
when Symbol then role
|
67
|
+
end
|
68
|
+
return @mappers.find_all { |m| m.roles.include?(role.to_sym) }
|
69
|
+
end
|
70
|
+
|
71
|
+
# Returns maps for a given project modules uids
|
72
|
+
def find_by_project_modules(*uids)
|
73
|
+
uids.inject([]) do |maps, uid|
|
74
|
+
maps.concat @mappers.find_all { |m| m.project_modules.collect(&:uid).include?(uid.to_s) }
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
80
|
+
|
81
|
+
class Mapper
|
82
|
+
include Helper
|
83
|
+
attr_reader :project_modules, :roles
|
84
|
+
|
85
|
+
def initialize(*roles, &block)#:nodoc:
|
86
|
+
@project_modules = []
|
87
|
+
@allowed = []
|
88
|
+
@denied = []
|
89
|
+
@roles = roles
|
90
|
+
yield self
|
91
|
+
end
|
92
|
+
|
93
|
+
# Create a new project module
|
94
|
+
def project_module(name, controller=nil, &block)
|
95
|
+
@project_modules << ProjectModule.new(name, controller, &block)
|
96
|
+
end
|
97
|
+
|
98
|
+
# Globally allow an action of a controller for the current role
|
99
|
+
def allow_action(path)
|
100
|
+
@allowed << recognize_path(path)
|
101
|
+
end
|
102
|
+
|
103
|
+
# Globally deny an action of a controllerfor the current role
|
104
|
+
def deny_action(path)
|
105
|
+
@denied << recognize_path(path)
|
106
|
+
end
|
107
|
+
|
108
|
+
# Globally allow all actions from a controller for the current role
|
109
|
+
def allow_all_actions(path)
|
110
|
+
@allowed << { :controller => recognize_path(path)[:controller] }
|
111
|
+
end
|
112
|
+
|
113
|
+
# Globally denty all actions from a controller for the current role
|
114
|
+
def deny_all_actions(path)
|
115
|
+
@denied << { :controller => recognize_path(path)[:controller] }
|
116
|
+
end
|
117
|
+
|
118
|
+
# Return allowed actions/controllers
|
119
|
+
def allowed
|
120
|
+
@project_modules.each { |pm| @allowed.concat pm.allowed }
|
121
|
+
return @allowed.uniq
|
122
|
+
end
|
123
|
+
|
124
|
+
# Return denied actions/controllers
|
125
|
+
def denied
|
126
|
+
return @denied.uniq
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
class ProjectModule
|
131
|
+
include Helper
|
132
|
+
include ActionController::UrlWriter
|
133
|
+
attr_reader :name, :menus, :url
|
134
|
+
|
135
|
+
def initialize(name, path=nil, options={}, &block)#:nodoc:
|
136
|
+
@name = name
|
137
|
+
@options = options
|
138
|
+
@allowed = []
|
139
|
+
@menus = []
|
140
|
+
if path
|
141
|
+
@url = recognize_path(path)
|
142
|
+
@allowed << { :controller => @url[:controller] }
|
143
|
+
end
|
144
|
+
yield self
|
145
|
+
end
|
146
|
+
|
147
|
+
# Build a new menu and automaitcally add the action on the allowed actions.
|
148
|
+
def menu(name, path=nil, options={}, &block)
|
149
|
+
@menus << Menu.new(name, path, options, &block)
|
150
|
+
end
|
151
|
+
|
152
|
+
# Return allowed controllers
|
153
|
+
def allowed
|
154
|
+
@menus.each { |m| @allowed.concat m.allowed }
|
155
|
+
return @allowed.uniq
|
156
|
+
end
|
157
|
+
|
158
|
+
# Return the original name or try to humanize the symbol
|
159
|
+
def human_name
|
160
|
+
return @name.is_a?(Symbol) ? @name.to_s.humanize : @name
|
161
|
+
end
|
162
|
+
|
163
|
+
# Return a unique id for the given project module
|
164
|
+
def uid
|
165
|
+
@name.to_s.downcase.gsub(/[^a-z0-9]+/, '').gsub(/-+$/, '').gsub(/^-+$/, '')
|
166
|
+
end
|
167
|
+
|
168
|
+
# Return ExtJs Config for this project module
|
169
|
+
def config
|
170
|
+
options = @options.merge(:id => uid, :text => human_name)
|
171
|
+
options.merge!(:menu => @menus.collect(&:config)) if @menus.size > 0
|
172
|
+
options.merge!(:handler => ActiveSupport::JSON::Variable.new("function(){ Backend.app.load('#{url_for(@url.merge(:only_path => true))}') }")) if @url
|
173
|
+
return options
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
class Menu
|
178
|
+
include Helper
|
179
|
+
include ActionController::UrlWriter
|
180
|
+
attr_reader :name, :options, :url, :items
|
181
|
+
|
182
|
+
def initialize(name, path=nil, options={}, &block)#:nodoc:
|
183
|
+
@name = name
|
184
|
+
@options = options
|
185
|
+
@allowed = []
|
186
|
+
@items = []
|
187
|
+
if path
|
188
|
+
@url = recognize_path(path)
|
189
|
+
@allowed << { :controller => @url[:controller] } if path
|
190
|
+
end
|
191
|
+
yield self if block_given?
|
192
|
+
end
|
193
|
+
|
194
|
+
# Add a new submenu to the menu
|
195
|
+
def add(name, path=nil, options={}, &block)
|
196
|
+
@items << Menu.new(name, path, options, &block)
|
197
|
+
end
|
198
|
+
|
199
|
+
# Return allowed controllers
|
200
|
+
def allowed
|
201
|
+
@items.each { |i| @allowed.concat i.allowed }
|
202
|
+
return @allowed.uniq
|
203
|
+
end
|
204
|
+
|
205
|
+
# Return the original name or try to humanize the symbol
|
206
|
+
def human_name
|
207
|
+
return @name.is_a?(Symbol) ? @name.to_s.humanize : @name
|
208
|
+
end
|
209
|
+
|
210
|
+
# Return a unique id for the given project module
|
211
|
+
def uid
|
212
|
+
@name.to_s.downcase.gsub(/[^a-z0-9]+/, '').gsub(/-+$/, '').gsub(/^-+$/, '')
|
213
|
+
end
|
214
|
+
|
215
|
+
# Return ExtJs Config for this menu
|
216
|
+
def config
|
217
|
+
options = @options.merge(:id => uid, :text => human_name)
|
218
|
+
options.merge!(:menu => @items.collect(&:config)) if @items.size > 0
|
219
|
+
options.merge!(:handler => ActiveSupport::JSON::Variable.new("function(){ Backend.app.load('#{url_for(@url.merge(:only_path => true))}') }")) if @url
|
220
|
+
return options
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
class AccessControlError < StandardError#:nodoc:
|
225
|
+
end
|
226
|
+
end
|
227
|
+
end
|