spiderfw 0.5.19 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +7 -0
- data/VERSION +1 -1
- data/apps/core/auth/lib/rbac.rb +7 -2
- data/apps/core/auth/models/mixins/rbac_provider.rb +66 -4
- data/apps/core/components/assets.rb +63 -33
- data/apps/core/components/public/js/jquery/{jquery-1.4.3.js → jquery-1.5.2.js} +2617 -1126
- data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/overlay/overlay.apple.js +155 -0
- data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/overlay/overlay.js +293 -0
- data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/scrollable/scrollable.js +335 -0
- data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/tabs/tabs.css +59 -0
- data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/tabs/tabs.js +283 -0
- data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/toolbox/toolbox.expose.js +224 -0
- data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.dynamic.js +150 -0
- data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.js +343 -0
- data/apps/core/components/public/js/jquery/jquery-tools-1.2.5/tooltip/tooltip.slide.js +78 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/button_bg.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/datepicker.gif +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/icon_sprite.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/progress_bar.gif +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/slider_h_bg.gif +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/slider_handles.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/slider_v_bg.gif +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/tab_bg.gif +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/the_gradient.gif +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-anim_basic_16x16.gif +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-icons_222222_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-icons_228ef1_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-icons_ef8c08_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-icons_ffd27a_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/images/ui-icons_ffffff_256x240.png +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4 → jquery-ui-1.8.11}/css/Aristo/jquery-ui.custom.css +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-af.js +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-ar-DZ.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ar.js +7 -8
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-az.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-bg.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-bs.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ca.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-cs.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-da.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-de.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-el.js +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-en-AU.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-en-GB.js +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-en-NZ.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-eo.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-es.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-et.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-eu.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-fa.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-fi.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-fo.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-fr-CH.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-fr.js +12 -10
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-gl.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-he.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-hr.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-hu.js +1 -1
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-hy.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-id.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-is.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-it.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ja.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ko.js +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-kz.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-lt.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-lv.js +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-ml.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ms.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-nl.js +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-no.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-pl.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-pt-BR.js +0 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-pt.js +22 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-rm.js +21 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ro.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ru.js +1 -1
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sk.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sl.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sq.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sr-SR.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sr.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-sv.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-ta.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-th.js +1 -1
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/i18n/jquery.ui.datepicker-tj.js +23 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-tr.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-uk.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-vi.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-zh-CN.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-zh-HK.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/i18n/jquery.ui.datepicker-zh-TW.js +0 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.blind.js +3 -3
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.bounce.js +3 -3
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.clip.js +3 -3
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.core.js +48 -15
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.drop.js +3 -3
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.explode.js +2 -2
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.11/ui/jquery.effects.fade.js +32 -0
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.fold.js +3 -3
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.highlight.js +2 -2
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.pulsate.js +2 -2
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.scale.js +4 -4
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.shake.js +3 -3
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.slide.js +4 -4
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.effects.transfer.js +2 -2
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.accordion.js +33 -20
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.autocomplete.js +104 -42
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.button.js +35 -13
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.core.js +111 -84
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.datepicker.js +87 -46
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.dialog.js +105 -75
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.draggable.js +17 -15
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.droppable.js +5 -5
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.mouse.js +16 -11
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.position.js +51 -32
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.progressbar.js +24 -10
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.resizable.js +7 -7
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.selectable.js +3 -3
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.slider.js +9 -7
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.sortable.js +22 -20
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.tabs.js +15 -14
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → jquery-ui-1.8.11}/ui/jquery.ui.widget.js +50 -25
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → plugins/bsmselect}/GPL-LICENSE.txt +1 -1
- data/apps/core/components/public/js/jquery/{jquery-ui-1.8.4/development-bundle → plugins/bsmselect}/MIT-LICENSE.txt +3 -7
- data/apps/core/components/public/js/jquery/plugins/bsmselect/README.md +185 -0
- data/apps/core/components/public/js/jquery/plugins/bsmselect/css/jquery.bsmselect.css +64 -0
- data/apps/core/components/public/js/jquery/plugins/bsmselect/js/jquery.bsmselect.compatibility.js +60 -0
- data/apps/core/components/public/js/jquery/plugins/bsmselect/js/jquery.bsmselect.js +381 -0
- data/apps/core/components/public/js/jquery/plugins/bsmselect/js/jquery.bsmselect.sortable.js +49 -0
- data/apps/core/components/public/js/plugins/sortable.js +16 -7
- data/apps/core/components/public/js/spider.js +60 -41
- data/apps/core/components/widgets/admin/admin.shtml +1 -1
- data/apps/core/components/widgets/list/list.shtml +2 -2
- data/apps/core/components/widgets/month_calendar/month_calendar.shtml +23 -20
- data/apps/core/components/widgets/switcher/switcher.rb +77 -21
- data/apps/core/components/widgets/switcher/templates/default.shtml +8 -0
- data/apps/core/components/widgets/switcher/templates/table.shtml +15 -0
- data/apps/core/components/widgets/table/table.rb +4 -1
- data/apps/core/components/widgets/table/table.shtml +10 -8
- data/apps/core/forms/public/css/form.css +9 -1
- data/apps/core/forms/public/date_time.js +14 -2
- data/apps/core/forms/public/input.js +1 -1
- data/apps/core/forms/public/select.js +4 -3
- data/apps/core/forms/tags/element_row.erb +11 -2
- data/apps/core/forms/widgets/inputs/date_time/date_time.rb +9 -0
- data/apps/core/forms/widgets/inputs/date_time/date_time.shtml +1 -1
- data/apps/core/forms/widgets/inputs/html_area/html_area.shtml +2 -2
- data/apps/core/forms/widgets/inputs/input/input.rb +0 -3
- data/apps/core/forms/widgets/inputs/select/select.shtml +2 -2
- data/apps/messenger/backends/email/sendmail.rb +20 -0
- data/apps/messenger/backends/email/smtp.rb +12 -14
- data/apps/messenger/backends/email/test.rb +20 -0
- data/apps/messenger/config/options.rb +9 -9
- data/apps/messenger/config/test.config.yml +2 -0
- data/apps/messenger/controllers/mixins/messenger_helper.rb +41 -15
- data/apps/messenger/lib/email_backend.rb +10 -0
- data/apps/messenger/messenger.rb +45 -26
- data/apps/messenger/test/features/attachments.feature +26 -0
- data/apps/messenger/test/features/messenger_helper.feature +31 -0
- data/apps/messenger/test/features/sending_email.feature +10 -0
- data/apps/messenger/test/features/step_definitions/common_steps.rb +11 -0
- data/apps/messenger/test/features/step_definitions/email_steps.rb +98 -0
- data/apps/messenger/test/features/support/env.rb +11 -0
- data/apps/messenger/test/files/test_file1.txt +1 -0
- data/apps/messenger/test/lib/controllers/mail_test_controller.rb +34 -0
- data/apps/messenger/test/templates/email/multipart.html.erb +1 -0
- data/apps/messenger/test/templates/email/multipart.txt.erb +1 -0
- data/apps/messenger/test/templates/email/simple.erb +1 -0
- data/apps/messenger/test/templates/email/vars.erb +1 -0
- data/lib/spiderfw/cmd/cmd.rb +4 -0
- data/lib/spiderfw/cmd/commands/webserver.rb +12 -59
- data/lib/spiderfw/config/configuration.rb +4 -0
- data/lib/spiderfw/config/options/spider.rb +25 -8
- data/lib/spiderfw/controller/controller.rb +10 -4
- data/lib/spiderfw/controller/first_responder.rb +6 -20
- data/lib/spiderfw/controller/http_controller.rb +2 -1
- data/lib/spiderfw/controller/mixins/http_mixin.rb +12 -1
- data/lib/spiderfw/controller/mixins/visual.rb +3 -16
- data/lib/spiderfw/env.rb +1 -1
- data/lib/spiderfw/http/server.rb +178 -2
- data/lib/spiderfw/model/base_model.rb +142 -111
- data/lib/spiderfw/model/data_type.rb +15 -0
- data/lib/spiderfw/model/datatypes/decimal.rb +8 -0
- data/lib/spiderfw/model/datatypes/pk.rb +29 -0
- data/lib/spiderfw/model/datatypes.rb +1 -0
- data/lib/spiderfw/model/element.rb +5 -1
- data/lib/spiderfw/model/extended_models/managed.rb +1 -1
- data/lib/spiderfw/model/junction.rb +23 -0
- data/lib/spiderfw/model/mappers/db_mapper.rb +96 -80
- data/lib/spiderfw/model/mappers/document_mapper.rb +315 -0
- data/lib/spiderfw/model/mappers/mapper.rb +164 -75
- data/lib/spiderfw/model/mixins/list.rb +1 -0
- data/lib/spiderfw/model/mixins/versioned.rb +63 -27
- data/lib/spiderfw/model/model.rb +36 -9
- data/lib/spiderfw/model/query_funcs.rb +3 -0
- data/lib/spiderfw/model/query_set.rb +21 -1
- data/lib/spiderfw/model/storage/base_storage.rb +259 -6
- data/lib/spiderfw/model/storage/{db/db_connection_pool.rb → connection_pool.rb} +25 -21
- data/lib/spiderfw/model/storage/db/adapters/mysql.rb +25 -5
- data/lib/spiderfw/model/storage/db/adapters/oracle.rb +1 -1
- data/lib/spiderfw/model/storage/db/connectors/jdbc_oracle.rb +2 -2
- data/lib/spiderfw/model/storage/db/connectors/oci8.rb +3 -4
- data/lib/spiderfw/model/storage/db/db_storage.rb +18 -219
- data/lib/spiderfw/model/storage/document/adapters/mongodb.rb +307 -0
- data/lib/spiderfw/model/storage/document/document.rb +7 -0
- data/lib/spiderfw/model/storage/document/document_storage.rb +34 -0
- data/lib/spiderfw/model/storage.rb +23 -11
- data/lib/spiderfw/model/unit_of_work.rb +45 -22
- data/lib/spiderfw/spider.rb +660 -0
- data/lib/spiderfw/templates/blocks/html.rb +4 -2
- data/lib/spiderfw/templates/blocks/run.rb +1 -1
- data/lib/spiderfw/templates/blocks/tag_if.rb +1 -1
- data/lib/spiderfw/templates/blocks/widget.rb +1 -1
- data/lib/spiderfw/templates/layout.rb +29 -5
- data/lib/spiderfw/templates/template.rb +72 -7
- data/lib/spiderfw/templates/template_blocks.rb +1 -1
- data/lib/spiderfw/test/capybara.rb +7 -0
- data/lib/spiderfw/test/cucumber.rb +12 -0
- data/lib/spiderfw/test/page_object.rb +29 -0
- data/lib/spiderfw/test/spec.rb +20 -0
- data/lib/spiderfw/test/stubs/mapper_stub.rb +18 -0
- data/lib/spiderfw/test/stubs/storage_stub.rb +23 -0
- data/lib/spiderfw/test/unit.rb +23 -0
- data/lib/spiderfw/test.rb +89 -0
- data/lib/spiderfw/utils/json.rb +6 -0
- data/lib/spiderfw/utils/logger.rb +17 -4
- data/lib/spiderfw/utils/loggers/apache_commons_logger.rb +61 -0
- data/lib/spiderfw/utils/monkey/date_time.rb +2 -2
- data/lib/spiderfw/utils/monkey/module.rb +3 -1
- data/lib/spiderfw/utils/profiling.rb +2 -2
- data/lib/spiderfw/widget/widget.rb +31 -13
- data/lib/spiderfw.rb +1 -597
- data/spider.gemspec +9 -10
- metadata +193 -132
- data/apps/admin/_init.rb +0 -9
- data/apps/admin/controllers/admin_controller.rb +0 -12
- data/apps/admin/widgets/dashboard_widget/dashboard_widget.rb +0 -8
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/AUTHORS.txt +0 -30
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery-ui-i18n.js +0 -1176
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/ui/i18n/jquery.ui.datepicker-no.js +0 -23
- data/apps/core/components/public/js/jquery/jquery-ui-1.8.4/development-bundle/version.txt +0 -1
- data/apps/core/components/public/js/jquery/plugins/asmselect/jquery.asmselect.css +0 -64
- data/apps/core/components/public/js/jquery/plugins/asmselect/jquery.asmselect.js +0 -407
- data/apps/core/components/widgets/switcher/switcher.shtml +0 -17
- data/apps/master/po/master.pot +0 -400
@@ -1,21 +1,24 @@
|
|
1
|
-
<
|
1
|
+
<div>
|
2
2
|
<tpl:asset type="css" src="css/month_calendar.css" />
|
3
|
-
<
|
4
|
-
<
|
5
|
-
<
|
6
|
-
<
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
</
|
3
|
+
<table class="{ @widget[:css_class] }">
|
4
|
+
<thead>
|
5
|
+
<tr>
|
6
|
+
<th colspan="7">
|
7
|
+
<a href="{ @request[:path] }?_w{ @widget[:param] }%5Bd%5D={ @prev_link }"><span><<</span></a>
|
8
|
+
{ @current_month_name } { @year }
|
9
|
+
<a href="{ @request[:path] }?_w{ @widget[:param] }%5Bd%5D={ @next_link }"><span>>></span></a>
|
10
|
+
</th>
|
11
|
+
</tr>
|
12
|
+
<tr>
|
13
|
+
<th sp:each="@week_days |i|">{ @days_short_names[i] }</th>
|
14
|
+
</tr>
|
15
|
+
</thead>
|
16
|
+
<tbody>
|
17
|
+
<tr sp:each="@rows |row|">
|
18
|
+
<td sp:each="row |col|" class="{ col[:classes] }">
|
19
|
+
{ col[:day] }
|
20
|
+
</td>
|
21
|
+
</tr>
|
22
|
+
</tbody>
|
23
|
+
</table>
|
24
|
+
</div>
|
@@ -7,13 +7,20 @@ module Spider; module Components
|
|
7
7
|
is_attribute :default
|
8
8
|
attr_reader :current, :current_label
|
9
9
|
|
10
|
+
default_template 'default'
|
11
|
+
|
12
|
+
|
10
13
|
def init
|
11
|
-
@items = []
|
12
14
|
@sections = {}
|
13
15
|
@labels = {}
|
14
16
|
@links = {}
|
15
|
-
@
|
17
|
+
@first_link = nil
|
18
|
+
@content_by_label = {}
|
19
|
+
@labels_by_action = {}
|
16
20
|
@link_mode = :path
|
21
|
+
@current_action = nil
|
22
|
+
@inline_widgets = {}
|
23
|
+
@inline_w_order = []
|
17
24
|
end
|
18
25
|
|
19
26
|
def route_widget
|
@@ -23,23 +30,39 @@ module Spider; module Components
|
|
23
30
|
|
24
31
|
|
25
32
|
def prepare(action='')
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
33
|
+
act = @_action_local || @default
|
34
|
+
@current_action = act
|
35
|
+
@scene.current_action = @current_action
|
36
|
+
if @labels_by_action[act] && content = @content_by_label[@labels_by_action[act]]
|
37
|
+
# must add the widget here so that it gets processed in super
|
38
|
+
add_widget(content) if content.is_a?(Spider::Widget)
|
32
39
|
end
|
33
|
-
|
40
|
+
|
41
|
+
init_widgets
|
42
|
+
|
43
|
+
|
44
|
+
# The widget object gets instantiated in super, so it is available now
|
45
|
+
@inline_w_order.each do |id|
|
46
|
+
iw = @inline_widgets[id]
|
47
|
+
add(iw[:label], @widgets[id], iw[:section])
|
48
|
+
end
|
49
|
+
|
50
|
+
redirect(widget_request_path+'/'+@first_link) if !act && @first_link
|
51
|
+
|
52
|
+
label = @labels_by_action[act]
|
53
|
+
content = @content_by_label[label]
|
34
54
|
raise NotFound.new(request_path) unless content
|
35
|
-
|
36
|
-
|
37
|
-
@
|
55
|
+
|
56
|
+
# content must not be set in inline, so it is not rendered by sp:run
|
57
|
+
@current = @inline_widgets[content.id.to_sym] ? nil : content
|
58
|
+
@current_label = label
|
59
|
+
|
38
60
|
super
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
@
|
61
|
+
|
62
|
+
@sections.each do |section, labels|
|
63
|
+
labels.each do |label|
|
64
|
+
menu_link = @link_mode == :path ? widget_request_path+'/'+@links[label] : "#{widget_request_path}?_wa[#{full_id}]=#{@links[label]}"
|
65
|
+
@widgets[:menu].add(label, menu_link, section)
|
43
66
|
end
|
44
67
|
end
|
45
68
|
@widgets[:menu].current = @current_label
|
@@ -47,13 +70,14 @@ module Spider; module Components
|
|
47
70
|
end
|
48
71
|
|
49
72
|
def add(label, content, section=nil)
|
50
|
-
@items << content
|
51
73
|
@sections[section] ||= []
|
52
|
-
@sections[section] <<
|
74
|
+
@sections[section] << label
|
53
75
|
@labels[content] = label
|
54
|
-
|
55
|
-
|
56
|
-
@
|
76
|
+
@content_by_label[label] = content
|
77
|
+
w_act = self.class.label_to_link(label)
|
78
|
+
@first_link ||= w_act
|
79
|
+
@links[label] = w_act
|
80
|
+
@labels_by_action[w_act] = label
|
57
81
|
end
|
58
82
|
|
59
83
|
def widget_assets
|
@@ -66,6 +90,38 @@ module Spider; module Components
|
|
66
90
|
label.downcase.gsub(/\s+/, '_').gsub(/[^a-zA-Z_]/, '')
|
67
91
|
end
|
68
92
|
|
93
|
+
def self.parse_content(doc)
|
94
|
+
ov = ""
|
95
|
+
@inline_widgets = []
|
96
|
+
doc.root.search('> [@id]').each do |w|
|
97
|
+
w_id = w.get_attribute('id')
|
98
|
+
w_label = w.get_attribute('switcher:label') || w_id
|
99
|
+
w_section = w.get_attribute('switcher:section')
|
100
|
+
w.remove_attribute('switcher:label')
|
101
|
+
w.remove_attribute('switcher:section')
|
102
|
+
ov += %Q{<tpl:pass sp:if="@current_action == '#{w_id}'">#{w.to_s}</tpl:pass>}
|
103
|
+
inline_attrs = %Q{id="#{w_id}" label="#{w_label}"}
|
104
|
+
inline_attrs += %Q{ section="#{w_section}"} if w_section
|
105
|
+
w.swap(%Q{<switcher:inline-widget #{inline_attrs}/>})
|
106
|
+
end
|
107
|
+
override = Hpricot(%Q{<tpl:append search="#content">#{ov}</tpl:append>}).root
|
108
|
+
parse_override(override)
|
109
|
+
runtime, soverrides = super(doc)
|
110
|
+
return [runtime, [override] + soverrides]
|
111
|
+
end
|
112
|
+
|
113
|
+
def parse_runtime_content(doc, src_path)
|
114
|
+
doc = super
|
115
|
+
@inline_widgets = {}
|
116
|
+
doc.search('switcher:inline-widget').each do |w|
|
117
|
+
w_id = w.get_attribute('id').to_sym
|
118
|
+
@inline_widgets[w_id] = {:label => w.get_attribute('label')}
|
119
|
+
@inline_w_order << w_id
|
120
|
+
end
|
121
|
+
doc.search('switcher:inline-widget').remove
|
122
|
+
doc
|
123
|
+
end
|
124
|
+
|
69
125
|
|
70
126
|
end
|
71
127
|
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<div>
|
2
|
+
<tpl:asset type="css" src="css/switcher.css" />
|
3
|
+
<core:menu id="menu"/>
|
4
|
+
<div id="content" class="content">
|
5
|
+
<sp:render sp:if="@current.is_a?(Spider::Template)" obj="@current" />
|
6
|
+
<sp:run sp:if="@current.is_a?(Spider::Widget)" obj="@current" />
|
7
|
+
</div>
|
8
|
+
</div>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<tpl:extend src="default.shtml">
|
2
|
+
<tpl:override-content>
|
3
|
+
<div id="switcher_top"></div>
|
4
|
+
<table width="100%">
|
5
|
+
<tr>
|
6
|
+
<td valign="top" width="18%">
|
7
|
+
<tpl:overridden search="#menu" />
|
8
|
+
</td>
|
9
|
+
<td valign="top">
|
10
|
+
<tpl:overridden search="#content" />
|
11
|
+
</td>
|
12
|
+
</tr>
|
13
|
+
</table>
|
14
|
+
</tpl:override-content>
|
15
|
+
</tpl:extend>
|
@@ -112,6 +112,7 @@ module Spider; module Components
|
|
112
112
|
@scene.has_more = @rows.has_more?
|
113
113
|
@scene.pages = (@rows.total_rows.to_f / @attributes[:row_limit]).ceil
|
114
114
|
@scene.paginate_last = [@scene.paginate_first + 9, @scene.pages].min
|
115
|
+
@scene.columns = @elements.size
|
115
116
|
super
|
116
117
|
end
|
117
118
|
|
@@ -145,7 +146,9 @@ module Spider; module Components
|
|
145
146
|
res_row[el] = list
|
146
147
|
end
|
147
148
|
else
|
148
|
-
if
|
149
|
+
if element.type <= Spider::Bool
|
150
|
+
res_row[el] = row[el] ? _('Yes') : _('No')
|
151
|
+
elsif (!row[el])
|
149
152
|
res_row[el] = ''
|
150
153
|
elsif (element.type <= Date || element.type <= Time)
|
151
154
|
res_row[el] = Spider::I18n.localize_date_time(@request.locale, row[el], :short)
|
@@ -12,17 +12,19 @@
|
|
12
12
|
</tr>
|
13
13
|
</thead>
|
14
14
|
<tbody>
|
15
|
-
<
|
16
|
-
<
|
17
|
-
<
|
18
|
-
{ @rows[row_i][
|
19
|
-
|
20
|
-
|
21
|
-
|
15
|
+
<tpl:pass sp:each_index="@rows |row_i|">
|
16
|
+
<tr class="row { (row_i%2==0) ? 'odd' : 'even' }">
|
17
|
+
<td sp:each="@elements |element|">
|
18
|
+
<a sp:tag-if="@link_el && element == @link_el" href="{ @link }{ Spider::HTTP.urlencode(@rows[row_i][@link_id]) }">
|
19
|
+
{ @rows[row_i][element] }
|
20
|
+
</a>
|
21
|
+
</td>
|
22
|
+
</tr>
|
23
|
+
</tpl:pass>
|
22
24
|
</tbody>
|
23
25
|
<tfoot>
|
24
26
|
<tr class="paginator" sp:if="@paginate && @pages > 1">
|
25
|
-
<td colspan="{ @
|
27
|
+
<td colspan="{ @columns }" >
|
26
28
|
<a sp:if="@page > 1" href="{ @request[:path] }?_w{ @widget[:param] }[page]={ @page-1 }">Indietro</a>
|
27
29
|
<sp:pass sp:if="@paginate_first > 1">
|
28
30
|
<a href="{ @request[:path] }?_w{ @widget[:param] }[page]=1" class="page">1</a> ...
|
@@ -3,13 +3,25 @@ Spider.defineWidget('Spider.Forms.DateTime', {
|
|
3
3
|
autoInit: true,
|
4
4
|
|
5
5
|
ready: function(){
|
6
|
-
|
6
|
+
var conf = {};
|
7
|
+
if (this.el.is('.change-month')) conf.changeMonth = true;
|
8
|
+
if (this.el.is('.change-year')) conf.changeYear = true;
|
9
|
+
var classes = this.el.attr('class').split(' ');
|
10
|
+
for (var i=0; i<classes.length; i++){
|
11
|
+
var cl = classes[i];
|
12
|
+
if (cl.substr(0, 10) == 'year-range'){
|
13
|
+
var range = cl.substr(11).split('-');
|
14
|
+
conf.yearRange = range[0].replace("m", "-")+":"+range[1].replace('p', '+');
|
15
|
+
a = 3;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
if (this.el.is('.date')) this.el.datepicker(conf);
|
7
19
|
else if (this.el.is('.date_time')){
|
8
20
|
var el = this.el;
|
9
21
|
el.hide();
|
10
22
|
var val = el.val().split(' ');
|
11
23
|
if (!val[1]) val[1] = '';
|
12
|
-
var d = $('<input type="text" class="date" size="10" />').val(val[0]).insertAfter(el).datepicker();
|
24
|
+
var d = $('<input type="text" class="date" size="10" />').val(val[0]).insertAfter(el).datepicker(conf);
|
13
25
|
var span = $('<span> </span>').insertAfter(d);
|
14
26
|
var t = $('<input type="text" class="time" size="8" />').val(val[1]).insertAfter(span);
|
15
27
|
var updateDt = function(){
|
@@ -5,12 +5,13 @@ Spider.defineWidget('Spider.Forms.Select', 'Spider.Forms.Input', {
|
|
5
5
|
ready: function(){
|
6
6
|
if (this.el.is('select[multiple]')){
|
7
7
|
this.el.attr('title', 'Aggiungi...');
|
8
|
-
this.el.
|
8
|
+
this.el.bsmSelect({
|
9
9
|
removeLabel: 'togli',
|
10
10
|
highlightAddedLabel: 'Aggiunto: ',
|
11
|
-
highlightRemovedLabel: 'Tolto: '
|
11
|
+
highlightRemovedLabel: 'Tolto: ',
|
12
|
+
addItemTarget: 'top'
|
12
13
|
});
|
13
|
-
$('.
|
14
|
+
$('.bsmSelect option:first', this.el.parent()).addClass('bsmSelectTitle')
|
14
15
|
.attr("selected", false)
|
15
16
|
.attr("disabled", true);
|
16
17
|
}
|
@@ -1,9 +1,18 @@
|
|
1
1
|
<%
|
2
|
+
tag_attrs = ['required', 'element', 'error_condition']
|
2
3
|
error_condition = @attributes['error_condition'] ? @attributes['error_condition'] : "@inputs[#{@attributes['element']}].error?"
|
3
4
|
required = @attributes['required'] ? @attributes['required'] : "@inputs[#{@attributes['element']}].required?"
|
4
5
|
%>
|
5
6
|
<forms:row error_condition="<%=error_condition%>" required="<%=required%>">
|
6
7
|
<forms:element_label element="<%=@attributes['element']%>" required="<%=required%>"/>
|
7
|
-
<sp:run obj="@inputs[<%=@attributes['element']%>]"
|
8
|
-
|
8
|
+
<sp:run obj="@inputs[<%=@attributes['element']%>]" widget="<%=@attributes['element']%>">
|
9
|
+
<sp:attribute widget="<%=@attributes['element'][1..-1]%>" name="required" value="<%=(@attributes['required']=='true')? 'true' : ''%>" />
|
10
|
+
<%
|
11
|
+
(@attributes.keys - tag_attrs).each do |k|
|
12
|
+
%>
|
13
|
+
<sp:attribute widget="<%=@attributes['element'][1..-1]%>" name="<%=k%>" value="<%=@attributes[k]%>" />
|
14
|
+
<%
|
15
|
+
end
|
16
|
+
%>
|
17
|
+
</sp:run>
|
9
18
|
</forms:row>
|
@@ -6,6 +6,9 @@ module Spider; module Forms
|
|
6
6
|
is_attr_accessor :mode, :type => Symbol, :default => :date
|
7
7
|
i_attr_accessor :format, :type => String
|
8
8
|
i_attr_accessor :lformat, :type => Symbol, :default => :short
|
9
|
+
attribute :"change-month", :type => Spider::Bool, :default => false
|
10
|
+
attribute :"change-year", :type => Spider::Bool, :default => false
|
11
|
+
attribute :"year-range", :type => String, :default => "150:10"
|
9
12
|
|
10
13
|
def prepare_value(val)
|
11
14
|
return val if val.respond_to?(:strftime)
|
@@ -31,6 +34,12 @@ module Spider; module Forms
|
|
31
34
|
when :time then 8
|
32
35
|
end
|
33
36
|
end
|
37
|
+
@additional_classes = []
|
38
|
+
@additional_classes << 'change-month' if @attributes[:"change-month"]
|
39
|
+
@additional_classes << 'change-year' if @attributes[:"change-year"]
|
40
|
+
yr = @attributes[:"year-range"].sub('-', 'm').sub('+', 'p').sub(':', '-') if @attributes[:"change-year"]
|
41
|
+
@additional_classes << "year-range-#{yr}" if yr
|
42
|
+
@scene.additional_classes = @additional_classes
|
34
43
|
super
|
35
44
|
end
|
36
45
|
|
@@ -2,5 +2,5 @@
|
|
2
2
|
<tpl:asset type="js" src="input.js" />
|
3
3
|
<tpl:asset name="jquery-ui-datepicker" />
|
4
4
|
<tpl:asset type="js" src="date_time.js" />
|
5
|
-
<input type="text" name="{ @name }" value="{ @formatted_value }" size="{ @size }" class="{ @mode }">
|
5
|
+
<input type="text" name="{ @name }" value="{ @formatted_value }" size="{ @size }" class="{ @mode } { @additional_classes.join(' ') }">
|
6
6
|
</sp:template>
|
@@ -1,11 +1,11 @@
|
|
1
1
|
<div>
|
2
|
+
<tpl:asset type="js" src="ckeditor/ckeditor.js" compressed="true" copy_dir="true"/>
|
3
|
+
<tpl:asset type="js" src="ckeditor/adapters/jquery.js" compressed="true" />
|
2
4
|
<tpl:asset name="jquery" />
|
3
5
|
<tpl:asset type="js" src="input.js" />
|
4
6
|
<tpl:asset type="js" src="html_area.js" /><tpl:asset type="js" src="text_area.js" />
|
5
7
|
<!--- <tpl:asset type="css" src="jwysiwyg/jquery.wysiwyg.css" />
|
6
8
|
<tpl:asset type="js" src="jwysiwyg/jquery.wysiwyg.js" /> -->
|
7
|
-
<tpl:asset type="js" src="ckeditor/ckeditor.js" compressed="true"/>
|
8
|
-
<tpl:asset type="js" src="ckeditor/adapters/jquery.js" />
|
9
9
|
<div class="initial_html" style="display:none">{ @initial_html }</div>
|
10
10
|
<div class="css" style="display:none">{ @css }</div>
|
11
11
|
<div class="options" style="display:none">{ @options }</div>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<select name="{ @value_param }" sp:attr-if="@multiple,multiple" title="">
|
2
2
|
<tpl:asset type="js" src="input.js" />
|
3
3
|
<tpl:asset type="js" src="select.js" />
|
4
|
-
<tpl:asset type="js" app="core/components" src="js/jquery/plugins/
|
5
|
-
<tpl:asset type="css" app="core/components" src="js/jquery/plugins/
|
4
|
+
<tpl:asset type="js" app="core/components" src="js/jquery/plugins/bsmselect/js/jquery.bsmselect.js" if="@multiple" />
|
5
|
+
<tpl:asset type="css" app="core/components" src="js/jquery/plugins/bsmselect/css/jquery.bsmselect.css" if="@multiple" />
|
6
6
|
<option sp:if="@blank_option"> </option>
|
7
7
|
<option sp:each_index="@data |i|" value="{ @values[i] }" sp:attr-if="@selected[values[i]],selected">
|
8
8
|
{ @data[i].to_s }
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'apps/messenger/lib/email_backend'
|
2
|
+
|
3
|
+
module Spider; module Messenger; module Backends; module Email
|
4
|
+
|
5
|
+
module Sendmail
|
6
|
+
include Messenger::EmailBackend
|
7
|
+
|
8
|
+
def self.send_message(msg)
|
9
|
+
Spider.logger.debug("Sending e-mail #{msg.ticket}")
|
10
|
+
mail = prepare_mail(msg)
|
11
|
+
mail.delivery_method :sendmail
|
12
|
+
mail.deliver
|
13
|
+
return true
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end; end; end; end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'apps/messenger/lib/email_backend'
|
2
|
-
require 'net/smtp'
|
3
2
|
|
4
3
|
module Spider; module Messenger; module Backends; module Email
|
5
4
|
|
@@ -8,19 +7,18 @@ module Spider; module Messenger; module Backends; module Email
|
|
8
7
|
|
9
8
|
def self.send_message(msg)
|
10
9
|
Spider.logger.debug("Sending e-mail #{msg.ticket}")
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
return res.string
|
10
|
+
mail = prepare_mail(msg)
|
11
|
+
mail.delivery_method :smtp, {
|
12
|
+
:address => Spider.conf.get('messenger.smtp.address'),
|
13
|
+
:port => Spider.conf.get('messenger.smpt.port'),
|
14
|
+
:domain => Spider.conf.get('messenger.smtp.domain'),
|
15
|
+
:user_name => Spider.conf.get('messenger.smtp.username'),
|
16
|
+
:password => Spider.conf.get('messenger.smtp.password'),
|
17
|
+
:authentication => Spider.conf.get('messenger.smtp.auth_scheme'),
|
18
|
+
:enable_starttls_auto => Spider.conf.get('messenger.smpt.enable_starttls_auto')
|
19
|
+
}
|
20
|
+
mail.deliver
|
21
|
+
return true
|
24
22
|
end
|
25
23
|
|
26
24
|
def self.update_statuses
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'apps/messenger/lib/email_backend'
|
2
|
+
|
3
|
+
module Spider; module Messenger; module Backends; module Email
|
4
|
+
|
5
|
+
module Test
|
6
|
+
include Messenger::EmailBackend
|
7
|
+
|
8
|
+
def self.send_message(msg)
|
9
|
+
Spider.logger.debug("Sending e-mail #{msg.ticket}")
|
10
|
+
res = false
|
11
|
+
mail = prepare_mail(msg)
|
12
|
+
mail.delivery_method :test
|
13
|
+
mail.deliver
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end; end; end; end
|
@@ -7,6 +7,7 @@ module Spider
|
|
7
7
|
config_option 'messenger.smtp.password', _("SMTP authentication password"), :default => nil
|
8
8
|
config_option 'messenger.smtp.auth_scheme', _("SMTP authentication scheme"), :default => nil, :type => Symbol,
|
9
9
|
:choices => [nil, :plain, :login, :cram_md5]
|
10
|
+
config_option 'messenger.smpt.enable_starttls_auto', _("Automatically start TLS for SMTP"), :default => false, :type => Spider::Bool
|
10
11
|
config_option 'messenger.smtp.log_path', _("Smtp logfile (e.g. /var/log/mail.log)"), :default => nil
|
11
12
|
|
12
13
|
config_option 'messenger.email.retries', _("How many times to retry sending an e-mail"), :type => Fixnum, :default => 5
|
@@ -14,15 +15,13 @@ module Spider
|
|
14
15
|
:type => Fixnum, :default => 10
|
15
16
|
config_option 'messenger.queue.run_every', _("Time in seconds between queue runs"), :type => Fixnum, :default => 60
|
16
17
|
|
17
|
-
config_option 'messenger.email.backends', _("The backends to use for sending mail (if more than one)"), :type => Array,
|
18
|
-
|
19
|
-
|
20
|
-
}
|
18
|
+
config_option 'messenger.email.backends', _("The backends to use for sending mail (if more than one)"), :type => Array,
|
19
|
+
:default => lambda{ Spider.conf.get('messenger.email.backend') ? [Spider.conf.get('messenger.email.backend')] : [] }
|
20
|
+
config_option 'messenger.email.backend', _("The backend to use for sending sms"), :type => String, :default => 'smtp'
|
21
21
|
|
22
|
-
config_option 'messenger.sms.backends', _("The backends to use for sending sms (if more than one)"), :type => Array,
|
23
|
-
|
24
|
-
|
25
|
-
}
|
22
|
+
config_option 'messenger.sms.backends', _("The backends to use for sending sms (if more than one)"), :type => Array,
|
23
|
+
:default => lambda{ Spider.conf.get('messenger.sms.backend') ? [Spider.conf.get('messenger.sms.backend')] : [] }
|
24
|
+
config_option 'messenger.sms.backend', _("The backend to use for sending sms"), :type => String
|
26
25
|
config_option 'messenger.sms.retries', _("How many times to retry sending an sms"), :type => Fixnum, :default => 5
|
27
26
|
config_option 'messenger.sms.retry_time', _("Seconds to wait until retry (will be incremented at each retry)"),
|
28
27
|
:type => Fixnum, :default => 10
|
@@ -38,6 +37,7 @@ module Spider
|
|
38
37
|
config_option 'messenger.smstools.remove_sent', _("Whether to remove failed messages from the smstools sent folder"),
|
39
38
|
:type => Spider::Bool, :default => true
|
40
39
|
config_option 'messenger.smstools.log_path', _("Smsd logfile"), :default => '/var/log/smsd.log'
|
41
|
-
|
40
|
+
config_option 'messenger.send_immediate', _("Send messages right after the controller action instead of waiting for worker"),
|
41
|
+
:type => Spider::Bool, :default => true
|
42
42
|
|
43
43
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'erb'
|
2
|
-
require '
|
2
|
+
require 'mail'
|
3
3
|
|
4
4
|
Spider.register_resource_type(:email, :extensions => ['erb'], :path => 'templates/email')
|
5
5
|
|
@@ -11,14 +11,20 @@ module Spider; module Messenger
|
|
11
11
|
# #Messenger::email
|
12
12
|
# template is the template name (found in templates/email), without the extension
|
13
13
|
# will use template.html.erb and template.txt.erb if they exist, template.erb otherwise.
|
14
|
-
# attachments must be an array
|
15
|
-
#
|
16
|
-
# :
|
14
|
+
# attachments must be an array, which items can be strings (the path to the file)
|
15
|
+
# or Hashes:
|
16
|
+
# {:filename => 'filename.png', :content => File.read('/path/to/file.jpg'),
|
17
|
+
# :mime_type => 'mime/type'}
|
18
|
+
# Attachments will be passed to the Mail gem (https://github.com/mikel/mail), so any syntax allowed by Mail
|
19
|
+
# can be used
|
17
20
|
def send_email(template, scene, from, to, headers={}, attachments=[], params={})
|
18
21
|
klass = self.class if self.class.respond_to?(:find_resouce_path)
|
19
22
|
klass ||= self.class.app if self.class.respond_to?(:app)
|
20
23
|
klass ||= Spider.home
|
21
|
-
Spider::Messenger::MessengerHelper.send_email(klass, template, scene, from, to, headers, attachments, params)
|
24
|
+
msg = Spider::Messenger::MessengerHelper.send_email(klass, template, scene, from, to, headers, attachments, params)
|
25
|
+
@messenger_sent ||= {}
|
26
|
+
@messenger_sent[:email] ||= []
|
27
|
+
@messenger_sent[:email] << msg.ticket
|
22
28
|
end
|
23
29
|
|
24
30
|
def self.send_email(klass, template, scene, from, to, headers={}, attachments=[], params={})
|
@@ -34,20 +40,33 @@ module Spider; module Messenger
|
|
34
40
|
path = klass.find_resource_path(:email, template)
|
35
41
|
text = ERB.new(IO.read(path)).result(scene_binding)
|
36
42
|
end
|
37
|
-
mail =
|
38
|
-
mail
|
39
|
-
mail
|
43
|
+
mail = Mail.new
|
44
|
+
mail[:to] = to
|
45
|
+
mail[:from] = from
|
46
|
+
mail.charset = "UTF-8"
|
40
47
|
headers.each do |key, value|
|
41
|
-
mail
|
48
|
+
mail[key] = value
|
42
49
|
end
|
43
|
-
|
44
|
-
|
45
|
-
|
50
|
+
|
51
|
+
if html
|
52
|
+
mail.text_part do
|
53
|
+
body text
|
54
|
+
end
|
55
|
+
mail.html_part do
|
56
|
+
content_type 'text/html; charset=UTF-8'
|
57
|
+
body html
|
58
|
+
end
|
59
|
+
else
|
60
|
+
mail.body = text
|
61
|
+
end
|
62
|
+
|
63
|
+
if attachments && !attachments.empty?
|
46
64
|
attachments.each do |att|
|
47
|
-
if (
|
48
|
-
|
65
|
+
if att.is_a?(Hash)
|
66
|
+
filename = att.delete(:filename)
|
67
|
+
mail.attachments[filename] = att
|
49
68
|
else
|
50
|
-
mail.
|
69
|
+
mail.add_file(att)
|
51
70
|
end
|
52
71
|
end
|
53
72
|
end
|
@@ -55,6 +74,13 @@ module Spider; module Messenger
|
|
55
74
|
mail_headers += "\r\n"
|
56
75
|
Messenger.email(from, to, mail_headers, mail_body, params)
|
57
76
|
end
|
77
|
+
|
78
|
+
def after(action='', *params)
|
79
|
+
return super unless Spider.conf.get('messenger.send_immediate') && @messenger_sent
|
80
|
+
Spider::Messenger.process_queue(:email, @messenger_sent[:email]) if @messenger_sent[:email]
|
81
|
+
Spider::Messenger.process_queue(:sms, @messenger_sent[:sms]) if @messenger_sent[:sms]
|
82
|
+
end
|
83
|
+
|
58
84
|
end
|
59
85
|
|
60
86
|
end; end
|