forgeos_cms 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +2 -0
- data/README.textile +42 -0
- data/app/assets/images/forgeos/admin/favicon.gif +0 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_cms/carousels.js +56 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_cms/menus.js +93 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_cms/overlay.js +86 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_cms/trees.js +8 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_cms/widget_actualities.js +117 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_cms/carousels.js +131 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_cms/menus.js +294 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_cms/overlays.js +71 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_cms/trees.js +94 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_cms/widget_actualities.js +23 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_cms/widget_faq.js +13 -0
- data/app/assets/stylesheets/forgeos/admin/base.css.sass +2 -0
- data/app/assets/stylesheets/forgeos/admin/forgeos_cms/_all.css.sass +1 -0
- data/app/assets/stylesheets/forgeos/admin/forgeos_cms/_blocks.css.sass +220 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/bubble-quantity-products.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/check-checked.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/check-unchecked.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/context.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/create.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/dark-blue-minus.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/dark-blue-plus.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/dot.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/f.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/fminus.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/fminus_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/folder.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/fplus.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/fplus_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/lastli.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/lastli_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/li.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/remove.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/rename.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/style.css.sass +219 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_page/throbber.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/brown-minus.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/brown-plus.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/bubble-quantity-products.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/context.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/create.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/dot.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/f.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/fminus.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/fminus_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/fplus.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/fplus_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/lastli.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/lastli_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/li.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/remove.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/rename.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/style.css.sass +138 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/block_category/throbber.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/big-drag-and-drop.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/bubble-quantity-products.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/check-checked.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/check-unchecked.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/context.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/create.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/dark-blue-minus.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/dark-blue-plus.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/dot.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/drag-drop.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/f.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/fminus.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/fminus_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/folder.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/fplus.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/fplus_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/lastli.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/lastli_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/li.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/remove.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/rename.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/style.css.sass +186 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/menu-tree/throbber.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/brown-minus.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/brown-plus.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/bubble-quantity-products.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/context.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/create.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/dot.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/f.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/fminus.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/fminus_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/fplus.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/fplus_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/lastli.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/lastli_rtl.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/li.gif +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/remove.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/rename.png +0 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/style.css.sass +138 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/page_category/throbber.gif +0 -0
- data/app/controllers/actualities_controller.rb +11 -0
- data/app/controllers/admin/actualities_controller.rb +100 -0
- data/app/controllers/admin/base_controller.rb +11 -0
- data/app/controllers/admin/carousels_controller.rb +101 -0
- data/app/controllers/admin/import_controller.rb +20 -0
- data/app/controllers/admin/menus_controller.rb +104 -0
- data/app/controllers/admin/newsletters_controller.rb +110 -0
- data/app/controllers/admin/pages_controller.rb +169 -0
- data/app/controllers/admin/static_content_blocks_controller.rb +174 -0
- data/app/controllers/admin/statistics_controller.rb +29 -0
- data/app/controllers/admin/widget_actualities_controller.rb +101 -0
- data/app/controllers/admin/widget_faqs_controller.rb +71 -0
- data/app/controllers/admin/widgets_controller.rb +83 -0
- data/app/controllers/forgeos/application_controller.rb +21 -0
- data/app/controllers/newsletters_controller.rb +11 -0
- data/app/controllers/pages_controller.rb +24 -0
- data/app/controllers/search_controller.rb +7 -0
- data/app/helpers/application_helper.rb +43 -0
- data/app/helpers/menu_helper.rb +46 -0
- data/app/helpers/routes_helper.rb +19 -0
- data/app/models/actuality.rb +21 -0
- data/app/models/block.rb +65 -0
- data/app/models/block_category.rb +7 -0
- data/app/models/carousel.rb +14 -0
- data/app/models/carousel_item.rb +12 -0
- data/app/models/category_link.rb +2 -0
- data/app/models/comment.rb +6 -0
- data/app/models/external_link.rb +5 -0
- data/app/models/faq.rb +10 -0
- data/app/models/link_page.rb +2 -0
- data/app/models/menu.rb +30 -0
- data/app/models/menu_category.rb +7 -0
- data/app/models/menu_link.rb +57 -0
- data/app/models/newsletter.rb +5 -0
- data/app/models/page.rb +85 -0
- data/app/models/page_category.rb +11 -0
- data/app/models/page_col.rb +14 -0
- data/app/models/page_link.rb +17 -0
- data/app/models/page_sweeper.rb +54 -0
- data/app/models/static_content_block.rb +2 -0
- data/app/models/static_content_category.rb +2 -0
- data/app/models/widget.rb +2 -0
- data/app/models/widget_actuality.rb +19 -0
- data/app/models/widget_category.rb +2 -0
- data/app/models/widget_faq.rb +12 -0
- data/app/views/actualities/rss.rxml +20 -0
- data/app/views/admin/actualities/_form.html.haml +38 -0
- data/app/views/admin/actualities/_tabs.html.haml +5 -0
- data/app/views/admin/actualities/edit.html.haml +3 -0
- data/app/views/admin/actualities/index.html.haml +10 -0
- data/app/views/admin/actualities/index.json.erb +34 -0
- data/app/views/admin/actualities/new.html.haml +3 -0
- data/app/views/admin/blocks/_associated_pages.html.haml +33 -0
- data/app/views/admin/blocks/_tabs.html.haml +8 -0
- data/app/views/admin/carousels/_attachments_popups.html.haml +81 -0
- data/app/views/admin/carousels/_form.html.haml +95 -0
- data/app/views/admin/carousels/_form_item.html.haml +54 -0
- data/app/views/admin/carousels/_item.html.haml +25 -0
- data/app/views/admin/carousels/edit.html.haml +1 -0
- data/app/views/admin/carousels/new.html.haml +1 -0
- data/app/views/admin/carousels/show.html.haml +40 -0
- data/app/views/admin/categories/_block.html.haml +4 -0
- data/app/views/admin/categories/_list_blocks.html.haml +13 -0
- data/app/views/admin/categories/_list_pages.html.haml +13 -0
- data/app/views/admin/categories/_page.html.haml +2 -0
- data/app/views/admin/dashboard/index.html.haml +19 -0
- data/app/views/admin/menu_links/_show.html.haml +8 -0
- data/app/views/admin/menus/_empty_menu_link.html.haml +45 -0
- data/app/views/admin/menus/_form.html.haml +27 -0
- data/app/views/admin/menus/_form_menu_links.html.haml +60 -0
- data/app/views/admin/menus/_lang_switcher.html.haml +2 -0
- data/app/views/admin/menus/_tabs.html.haml +5 -0
- data/app/views/admin/menus/_types_popups.html.haml +21 -0
- data/app/views/admin/menus/edit.html.haml +1 -0
- data/app/views/admin/menus/index.html.haml +13 -0
- data/app/views/admin/menus/index.json.erb +31 -0
- data/app/views/admin/menus/new.html.haml +1 -0
- data/app/views/admin/menus/show.html.haml +22 -0
- data/app/views/admin/newsletters/_form.html.haml +19 -0
- data/app/views/admin/newsletters/_tabs.html.haml +3 -0
- data/app/views/admin/newsletters/edit.html.haml +2 -0
- data/app/views/admin/newsletters/index.html.haml +14 -0
- data/app/views/admin/newsletters/index.json.erb +22 -0
- data/app/views/admin/newsletters/new.html.haml +2 -0
- data/app/views/admin/pages/_block_popup.html.haml +18 -0
- data/app/views/admin/pages/_blocks.html.haml +29 -0
- data/app/views/admin/pages/_codes.html.haml +33 -0
- data/app/views/admin/pages/_form.html.haml +15 -0
- data/app/views/admin/pages/_general.html.haml +64 -0
- data/app/views/admin/pages/_seo.html.haml +31 -0
- data/app/views/admin/pages/_tabs.html.haml +5 -0
- data/app/views/admin/pages/_tabs_show.html.haml +9 -0
- data/app/views/admin/pages/edit.html.haml +1 -0
- data/app/views/admin/pages/index.html.haml +13 -0
- data/app/views/admin/pages/index.json.erb +37 -0
- data/app/views/admin/pages/new.html.haml +2 -0
- data/app/views/admin/pages/show.html.haml +100 -0
- data/app/views/admin/static_content_blocks/_form.html.haml +41 -0
- data/app/views/admin/static_content_blocks/edit.html.haml +1 -0
- data/app/views/admin/static_content_blocks/index.html.haml +16 -0
- data/app/views/admin/static_content_blocks/index.json.erb +28 -0
- data/app/views/admin/static_content_blocks/new.html.haml +1 -0
- data/app/views/admin/static_content_blocks/show.html.haml +23 -0
- data/app/views/admin/statistics/index.html.haml +57 -0
- data/app/views/admin/users/_tabs.html.haml +3 -0
- data/app/views/admin/widget_actualities/_form.html.haml +87 -0
- data/app/views/admin/widget_actualities/_form_item.html.haml +28 -0
- data/app/views/admin/widget_actualities/_item.html.haml +11 -0
- data/app/views/admin/widget_actualities/_tabs.html.haml +8 -0
- data/app/views/admin/widget_actualities/edit.html.haml +2 -0
- data/app/views/admin/widget_actualities/new.html.haml +2 -0
- data/app/views/admin/widget_actualities/show.html.haml +39 -0
- data/app/views/admin/widget_faqs/_form.html.haml +68 -0
- data/app/views/admin/widget_faqs/_tabs.html.haml +8 -0
- data/app/views/admin/widget_faqs/edit.html.haml +2 -0
- data/app/views/admin/widget_faqs/new.html.haml +2 -0
- data/app/views/admin/widgets/_tabs.html.haml +8 -0
- data/app/views/admin/widgets/index.html.haml +28 -0
- data/app/views/admin/widgets/index.json.erb +27 -0
- data/app/views/layouts/admin/_menu.html.haml +0 -0
- data/app/views/layouts/application.html.haml +21 -0
- data/app/views/pages/_linked_pages.html.haml +4 -0
- data/app/views/pages/_page.html.haml +15 -0
- data/app/views/pages/show.html.haml +9 -0
- data/app/views/search/index.html.haml +8 -0
- data/config/locales/activerecord/en.yml +48 -0
- data/config/locales/activerecord/fr.yml +77 -0
- data/config/locales/admin/actuality/en.yml +30 -0
- data/config/locales/admin/actuality/fr.yml +30 -0
- data/config/locales/admin/block/en.yml +38 -0
- data/config/locales/admin/block/fr.yml +38 -0
- data/config/locales/admin/carousel/en.yml +24 -0
- data/config/locales/admin/carousel/fr.yml +24 -0
- data/config/locales/admin/menu/en.yml +33 -0
- data/config/locales/admin/menu/fr.yml +38 -0
- data/config/locales/admin/newsletter/en.yml +30 -0
- data/config/locales/admin/newsletter/fr.yml +30 -0
- data/config/locales/admin/page/en.yml +77 -0
- data/config/locales/admin/page/fr.yml +77 -0
- data/config/locales/admin/section/en.yml +23 -0
- data/config/locales/admin/section/fr.yml +23 -0
- data/config/locales/admin/static_content_block/en.yml +43 -0
- data/config/locales/admin/static_content_block/fr.yml +42 -0
- data/config/locales/admin/widget/en.yml +34 -0
- data/config/locales/admin/widget/fr.yml +34 -0
- data/config/locales/admin/widget_actuality/en.yml +23 -0
- data/config/locales/admin/widget_actuality/fr.yml +23 -0
- data/config/locales/admin/widget_faq/en.yml +22 -0
- data/config/locales/admin/widget_faq/fr.yml +30 -0
- data/config/locales/common/en.yml +208 -0
- data/config/locales/common/fr.yml +209 -0
- data/config/routes.rb +73 -0
- data/db/fixtures/menu_link_translations.yml +5 -0
- data/db/fixtures/menu_links.yml +5 -0
- data/db/fixtures/menus.yml +3 -0
- data/db/fixtures/page_translations.yml +19 -0
- data/db/fixtures/pages.yml +5 -0
- data/db/fixtures/people.yml +11 -0
- data/db/migrate/20091009134405_create_actualities.rb +18 -0
- data/db/migrate/20091009134503_create_blocks.rb +15 -0
- data/db/migrate/20091009134510_create_blocks_pages.rb +13 -0
- data/db/migrate/20091009134518_create_carousel_items.rb +17 -0
- data/db/migrate/20091009134729_create_pages.rb +18 -0
- data/db/migrate/20091009134736_create_pages_links.rb +12 -0
- data/db/migrate/20091027153116_create_menus.rb +14 -0
- data/db/migrate/20091027153659_create_menu_links.rb +19 -0
- data/db/migrate/20091208113459_create_page_translations.rb +9 -0
- data/db/migrate/20091208113460_create_block_translations.rb +9 -0
- data/db/migrate/20091208113461_create_menu_link_translations.rb +9 -0
- data/db/migrate/20091208170256_remove_translations_to_page.rb +10 -0
- data/db/migrate/20091208170257_remove_translations_to_block.rb +9 -0
- data/db/migrate/20091208170258_remove_translations_to_menu_link.rb +9 -0
- data/db/migrate/20100203102853_add_actuality_translations.rb +9 -0
- data/db/migrate/20100203102914_add_carousel_item_translations.rb +9 -0
- data/db/migrate/20100203125804_remove_translated_columns_to_actualities.rb +9 -0
- data/db/migrate/20100203125820_remove_translated_columns_to_carousel_items.rb +10 -0
- data/db/migrate/20100405095844_create_page_cols_table.rb +12 -0
- data/db/migrate/20100405101416_create_blocks_page_cols.rb +13 -0
- data/db/migrate/20100407093551_create_table_translation_for_page_cols.rb +13 -0
- data/db/migrate/20100413134832_add_index_on_menu_links.rb +11 -0
- data/db/migrate/20100501150819_add_code_to_pages.rb +13 -0
- data/db/migrate/20100511161012_create_faqs.rb +13 -0
- data/db/migrate/20100526163534_add_popup_to_menu_link.rb +9 -0
- data/db/migrate/20100929183346_change_answer_type.rb +9 -0
- data/db/migrate/20101015095242_update_actualities.rb +11 -0
- data/db/migrate/20101216155044_create_newsletter.rb +12 -0
- data/db/migrate/20110310092311_add_indexes_to_menu.rb +9 -0
- data/db/migrate/20110408133955_add_summary_to_menu_link_translations.rb +7 -0
- data/lib/forgeos/admin_menu.rb +14 -0
- data/lib/forgeos/cms.rb +8 -0
- data/lib/forgeos/cms/engine.rb +8 -0
- data/lib/forgeos/cms/statistics.rb +16 -0
- data/lib/forgeos_cms.rb +3 -0
- data/lib/tasks/install.rake +9 -0
- data/lib/tasks/upgrade.rake +22 -0
- data/recipes/deploy.rb +14 -0
- metadata +375 -0
@@ -0,0 +1,294 @@
|
|
1
|
+
jQuery(document).ready(function(){
|
2
|
+
// Add root menu link
|
3
|
+
jQuery('.button-menu-link').live('click',function(){
|
4
|
+
var menu = jQuery('#menu-tree').children('ul');
|
5
|
+
var new_menu_link = '<li class="file last closed">';
|
6
|
+
new_menu_link += jQuery('#empty_menu_link').html().replace(/EMPTY_ID/g, false_id).replace(/EMPTY_NAME/g, false_id);
|
7
|
+
new_menu_link += '</li>';
|
8
|
+
|
9
|
+
jQuery(menu).append(new_menu_link);
|
10
|
+
update_menu_positions(menu);
|
11
|
+
|
12
|
+
false_id--;
|
13
|
+
return false;
|
14
|
+
});
|
15
|
+
|
16
|
+
// Add sub menu link
|
17
|
+
jQuery('.tree-menu-tree li .menu_link .action-links .add-green-plus').live('click',function(){
|
18
|
+
var current_menu_link = jQuery(this).parents('li:first');
|
19
|
+
|
20
|
+
// get list of the current menu_link or create one
|
21
|
+
var menu_list = jQuery(current_menu_link).children('ul');
|
22
|
+
if (menu_list.length == 0) {
|
23
|
+
jQuery(current_menu_link).append(jQuery('<ul>'));
|
24
|
+
menu_list = jQuery(current_menu_link).children('ul');
|
25
|
+
}
|
26
|
+
|
27
|
+
// get menu_link ancestors
|
28
|
+
var ancestor_ids = [];
|
29
|
+
jQuery(this).parents('li').each(function(){
|
30
|
+
var attributes = jQuery(this).find('input:first').attr('name').split('[');
|
31
|
+
var ancestor_id = attributes[attributes.length-2].replace(']','');
|
32
|
+
ancestor_ids.push(ancestor_id);
|
33
|
+
});
|
34
|
+
|
35
|
+
// constructs new menu_link id/name depending on its ancestors
|
36
|
+
var new_id = false_id;
|
37
|
+
var new_name = false_id;
|
38
|
+
if (ancestor_ids.length > 0){
|
39
|
+
ancestor_ids = ancestor_ids.reverse();
|
40
|
+
new_id = ancestor_ids.join('_children_attributes_') + '_children_attributes_' + false_id;
|
41
|
+
new_name = ancestor_ids.join('][children_attributes][') + '][children_attributes][' + false_id;
|
42
|
+
}
|
43
|
+
|
44
|
+
// create new menu link and append it to the list of the current menu_link
|
45
|
+
var new_menu_link = '<li class="file last closed">';
|
46
|
+
new_menu_link += jQuery('#empty_menu_link').html().replace(/EMPTY_ID/g, new_id).replace(/EMPTY_NAME/g, new_name);
|
47
|
+
new_menu_link += '</li>';
|
48
|
+
jQuery(menu_list).append(new_menu_link);
|
49
|
+
|
50
|
+
// update positions and open current menu_link
|
51
|
+
update_menu_positions(jQuery('#menu-tree').children('ul'));
|
52
|
+
toggle_menu_link(current_menu_link, 'open');
|
53
|
+
|
54
|
+
false_id--;
|
55
|
+
return false;
|
56
|
+
});
|
57
|
+
|
58
|
+
// Edition mode in menu link edit
|
59
|
+
jQuery('.tree-menu-tree li .menu_link .action-links .edit-link, .tree-menu-tree li .menu_link .actions .back-link, .tree-menu-tree li .menu_link .editing .save').live('click',function(){
|
60
|
+
var menu_link = jQuery(this).parents('li:first');
|
61
|
+
var link = jQuery(menu_link).find('a.tree-link:first');
|
62
|
+
var link_span = jQuery(link).find('.name');
|
63
|
+
|
64
|
+
var edition_block = jQuery(menu_link).find('.editing:first');
|
65
|
+
var edition_span = jQuery(edition_block).find('.linked-to-span');
|
66
|
+
var edition_link = jQuery(edition_span).find('a');
|
67
|
+
|
68
|
+
// toggle link and edition_block
|
69
|
+
link.toggle();
|
70
|
+
edition_block.toggle();
|
71
|
+
|
72
|
+
// on closing edition part
|
73
|
+
if (!jQuery(edition_block).is(':visible')){
|
74
|
+
var back_link = jQuery(this).hasClass('back-link');
|
75
|
+
|
76
|
+
// back-link is pressed then reset icon else update icon
|
77
|
+
if (back_link)
|
78
|
+
update_menu_span_icon(link_span, edition_span);
|
79
|
+
else
|
80
|
+
update_menu_span_icon(edition_span, link_span);
|
81
|
+
|
82
|
+
// back-link is pressed then reset attributes else update attributes
|
83
|
+
jQuery(edition_block).find('input, textarea, select').each(function(){
|
84
|
+
switch(get_rails_element_id(jQuery(this)))
|
85
|
+
{
|
86
|
+
// TODO: interactivity
|
87
|
+
case 'title':
|
88
|
+
if (back_link){
|
89
|
+
// reset title text field...
|
90
|
+
jQuery(this).val(link_span.html());
|
91
|
+
|
92
|
+
// and edition link title
|
93
|
+
if (edition_span.hasClass('external'))
|
94
|
+
// edition link url
|
95
|
+
edition_link.html(link.attr('href'));
|
96
|
+
else
|
97
|
+
// target name
|
98
|
+
edition_link.html(jQuery(edition_block).find('.linked-to').html());
|
99
|
+
}
|
100
|
+
else{
|
101
|
+
// update view link title
|
102
|
+
link_span.html(jQuery(this).val());
|
103
|
+
jQuery(edition_block).find('.linked-to').html(edition_link.html());
|
104
|
+
}
|
105
|
+
break;
|
106
|
+
|
107
|
+
case 'url':
|
108
|
+
if (back_link){
|
109
|
+
// reset url hidden field and edition link url
|
110
|
+
jQuery(this).val(link.attr('href'));
|
111
|
+
edition_link.attr('href', link.attr('href'));
|
112
|
+
}
|
113
|
+
else
|
114
|
+
// update view link url
|
115
|
+
link.attr('href', edition_link.attr('href'));
|
116
|
+
break;
|
117
|
+
|
118
|
+
case 'active':
|
119
|
+
status_span = link.find('.status');
|
120
|
+
if (back_link){
|
121
|
+
// update select
|
122
|
+
jQuery(this).val(status_span.hasClass('see-on') ? 1 : 0);
|
123
|
+
rebuild_custom_select('.select-status');
|
124
|
+
}
|
125
|
+
else {
|
126
|
+
// set visible or not
|
127
|
+
status_span.removeClass((jQuery(this).val() == '1') ? 'see-off' : 'see-on');
|
128
|
+
status_span.addClass((jQuery(this).val() == '1') ? 'see-on' : 'see-off');
|
129
|
+
}
|
130
|
+
break;
|
131
|
+
}
|
132
|
+
});
|
133
|
+
}
|
134
|
+
return false;
|
135
|
+
});
|
136
|
+
|
137
|
+
// Remove menu link
|
138
|
+
jQuery('.tree-menu-tree li .menu_link .action-links .destroy-link').live('click',function(){
|
139
|
+
var menu_link = jQuery(this).parents('li:first');
|
140
|
+
|
141
|
+
// set the menu link and all its children to deleted
|
142
|
+
jQuery(menu_link).find('.menu_link').each(function(){
|
143
|
+
jQuery(this).find('.delete').val(1);
|
144
|
+
});
|
145
|
+
|
146
|
+
// hide menu link and its children and update positions
|
147
|
+
jQuery(menu_link).children().hide();
|
148
|
+
update_menu_positions(jQuery('#menu-tree').children('ul'));
|
149
|
+
|
150
|
+
// close parent menu_link if there was only one sub menu_link
|
151
|
+
var parent_menu_link = menu_link.parents('li:first');
|
152
|
+
var sub_menu_links = parent_menu_link.find('li.open:visible, li.closed:visible');
|
153
|
+
if (sub_menu_links.length == 0)
|
154
|
+
toggle_menu_link(parent_menu_link, 'closed');
|
155
|
+
|
156
|
+
return false;
|
157
|
+
});
|
158
|
+
|
159
|
+
// Dialog to change menu link type
|
160
|
+
jQuery('#menuLinkTypeDialog').dialog({
|
161
|
+
autoOpen:false,
|
162
|
+
modal:true,
|
163
|
+
minHeight: 380,
|
164
|
+
width: 800,
|
165
|
+
resizable:'se',
|
166
|
+
buttons: {
|
167
|
+
Ok: function(){
|
168
|
+
jQuery('#fileSelectDialog').dialog('close');
|
169
|
+
}
|
170
|
+
},
|
171
|
+
open: function(e,ui){
|
172
|
+
eval(jQuery('#table-files').data('dataTables_init_function')+'()');
|
173
|
+
}
|
174
|
+
});
|
175
|
+
|
176
|
+
// Change menu link type
|
177
|
+
jQuery('.tree-menu-tree li .menu_link .editing .change-type').live('click',function(){
|
178
|
+
var edition_block = jQuery(this).parents('.editing');
|
179
|
+
var link_type = jQuery(edition_block).find('.input-type');
|
180
|
+
|
181
|
+
var title = jQuery(edition_block).find('.input-title');
|
182
|
+
var url = jQuery(edition_block).find('.input-url');
|
183
|
+
var span = jQuery(edition_block).find('.linked-to-span');
|
184
|
+
var link = jQuery(edition_block).find('.linked-to-span a');
|
185
|
+
var target_id = jQuery(edition_block).find('.input-target-id');
|
186
|
+
var target_type = jQuery(edition_block).find('.input-target-type');
|
187
|
+
var overlay_url = jQuery('#overlay-url');
|
188
|
+
|
189
|
+
// on open - show overlay and hide other overlays
|
190
|
+
jQuery('#menuLinkTypeDialog').bind('dialogopen', function(event, ui) {
|
191
|
+
var overlay_tab;
|
192
|
+
var overlay_type = 'target-link';
|
193
|
+
|
194
|
+
switch(link_type.val())
|
195
|
+
{
|
196
|
+
case 'PageLink':
|
197
|
+
overlay_tab = 'page';
|
198
|
+
update_current_dataTable_source('#table-files','/admin/pages.json?mode=menu_link');
|
199
|
+
break;
|
200
|
+
|
201
|
+
case 'ProductLink':
|
202
|
+
overlay_tab = 'product';
|
203
|
+
update_current_dataTable_source('#table-files','/admin/products.json?mode=menu_link');
|
204
|
+
break;
|
205
|
+
|
206
|
+
case 'CategoryLink':
|
207
|
+
overlay_tab = 'category';
|
208
|
+
update_current_dataTable_source('#table-files',"/admin/categories.json?mode=menu_link&types[]=page&types[]=product");
|
209
|
+
break;
|
210
|
+
|
211
|
+
default:
|
212
|
+
overlay_tab = 'external';
|
213
|
+
overlay_type = 'external-link';
|
214
|
+
// set overlay input value
|
215
|
+
overlay_url.val(url.val());
|
216
|
+
}
|
217
|
+
|
218
|
+
toggleSelectedOverlay('#inner-lightbox.backgrounds .' + overlay_tab);
|
219
|
+
toggle_menu_types_overlays(overlay_type);
|
220
|
+
});
|
221
|
+
|
222
|
+
// on OK button pressed - update link, hidden fields and close dialog
|
223
|
+
jQuery('#menuLinkTypeDialog').dialog('option', 'buttons', {
|
224
|
+
"Ok": function(){
|
225
|
+
var current_tab = jQuery('#inner-lightbox.backgrounds .selected');
|
226
|
+
|
227
|
+
span.removeClass('external page product category');
|
228
|
+
|
229
|
+
if (current_tab.hasClass('external')){
|
230
|
+
update_menu_link(title, span, link, url, link_type, target_id, target_type, {
|
231
|
+
'title': title.val(),
|
232
|
+
'type': 'external',
|
233
|
+
'link_name': overlay_url.val(),
|
234
|
+
'link_url': overlay_url.val(),
|
235
|
+
'hidden_url': overlay_url.val(),
|
236
|
+
'hidden_type': 'ExternalLink',
|
237
|
+
'hidden_target_id': '',
|
238
|
+
'hidden_target_type': ''
|
239
|
+
}
|
240
|
+
);
|
241
|
+
}
|
242
|
+
else{
|
243
|
+
dataTableSelectRows('#table-files:visible',function(current_table,indexes){
|
244
|
+
var row = current_table.fnGetData(indexes[0]);
|
245
|
+
var id = row.slice(-2,-1)[0];
|
246
|
+
var name = row.slice(-3,-2)[0];
|
247
|
+
var target = row.slice(-1)[0];
|
248
|
+
|
249
|
+
var type;
|
250
|
+
if (current_tab.hasClass('page'))
|
251
|
+
type = 'page';
|
252
|
+
else if (current_tab.hasClass('product'))
|
253
|
+
type = 'product';
|
254
|
+
else if (current_tab.hasClass('category'))
|
255
|
+
type = 'category';
|
256
|
+
|
257
|
+
update_menu_link(title, span, link, url, link_type, target_id, target_type, {
|
258
|
+
'title': jQuery(name).html(),
|
259
|
+
'type': type,
|
260
|
+
'link_name': jQuery(name).html(),
|
261
|
+
'link_url': jQuery(target).attr('href'),
|
262
|
+
'hidden_url': '',
|
263
|
+
'hidden_type': capitalize(type)+'Link',
|
264
|
+
'hidden_target_id': id,
|
265
|
+
'hidden_target_type': capitalize(type)
|
266
|
+
}
|
267
|
+
);
|
268
|
+
});
|
269
|
+
}
|
270
|
+
|
271
|
+
jQuery(this).dialog("close");
|
272
|
+
}
|
273
|
+
});
|
274
|
+
|
275
|
+
// on close - reset overlay url input text field
|
276
|
+
jQuery('#menuLinkTypeDialog').bind('dialogbeforeclose', function(event, ui) {
|
277
|
+
overlay_url.val('');
|
278
|
+
});
|
279
|
+
|
280
|
+
jQuery('#menuLinkTypeDialog').dialog('open');
|
281
|
+
return false;
|
282
|
+
});
|
283
|
+
|
284
|
+
//add hover on menu list elments
|
285
|
+
jQuery('.tree-menu-tree').find('li').live('mouseover',function(){
|
286
|
+
jQuery('.action-links').hide();
|
287
|
+
jQuery(this).find('.action-links:first').show();
|
288
|
+
|
289
|
+
});
|
290
|
+
|
291
|
+
jQuery('.tree-menu-tree').find('li').live('mouseout',function(){
|
292
|
+
jQuery('.action-links').hide();
|
293
|
+
});
|
294
|
+
});
|
@@ -0,0 +1,71 @@
|
|
1
|
+
jQuery(document).ready(function(){
|
2
|
+
/*
|
3
|
+
*Add click function on a.page-link items
|
4
|
+
*Those items are links that shows dialogBox to add a page to blocks
|
5
|
+
**/
|
6
|
+
jQuery('a.page-link').live('click',function(){
|
7
|
+
openPageDialog(jQuery(this));
|
8
|
+
return false;
|
9
|
+
});
|
10
|
+
|
11
|
+
/*
|
12
|
+
*Add click function on .small-icons.page items
|
13
|
+
*Those items are li in page tree (in dialog box)
|
14
|
+
* sends ajax request to link a page with a block
|
15
|
+
* add the new linked page in pages list
|
16
|
+
*and close the dialogg box
|
17
|
+
**/
|
18
|
+
jQuery('.link-page.small-icons.page').bind('click',function(){
|
19
|
+
if(!jQuery(this).hasClass('active')){
|
20
|
+
var url = jQuery(this).attr('href');
|
21
|
+
var block_id = url.split('/')[5];
|
22
|
+
var page_id = jQuery(this).parent().attr('id').substr(5);
|
23
|
+
jQuery.ajax({
|
24
|
+
url: url,
|
25
|
+
complete: putInPageList(jQuery(this).text(), jQuery(this).attr('title'), block_id, page_id),
|
26
|
+
data: 'authenticity_token=' + encodeURIComponent(window._forgeos_js_vars.token),
|
27
|
+
dataType:'script',
|
28
|
+
type:'post'
|
29
|
+
});
|
30
|
+
closeDialogBox();
|
31
|
+
}
|
32
|
+
return false;
|
33
|
+
});
|
34
|
+
|
35
|
+
/*
|
36
|
+
*Add click function on .static-tab,.widget-tab items
|
37
|
+
*Those items are headers links in blocks/widget dialog box
|
38
|
+
*that display the widgets or blocks trees
|
39
|
+
**/
|
40
|
+
jQuery('.static-tab,.widget-tab').bind('click',function(){
|
41
|
+
toggleHoverlayTrees(jQuery(this).attr('class'));
|
42
|
+
return false;
|
43
|
+
});
|
44
|
+
|
45
|
+
jQuery('.lightbox-actuality').dialog({
|
46
|
+
autoOpen:false,
|
47
|
+
modal:true,
|
48
|
+
minHeight: 400,
|
49
|
+
width: 950,
|
50
|
+
open: function(){ tmce_load_children('#form_actuality'); },
|
51
|
+
beforeclose: function(){ tmce_unload_children('#form_actuality'); },
|
52
|
+
resizable: 'se'
|
53
|
+
});
|
54
|
+
|
55
|
+
jQuery('.add-actuality').live('click',function(){
|
56
|
+
empty_actuality_overlay_fields();
|
57
|
+
tmce_unload_children('#form_actuality');
|
58
|
+
jQuery('.lightbox-actuality').dialog('open');
|
59
|
+
jQuery('#submit_actuality').addClass('create-actuality');
|
60
|
+
jQuery('#submit_actuality').removeClass('update-actuality');
|
61
|
+
return false;
|
62
|
+
});
|
63
|
+
|
64
|
+
jQuery('.edit-actuality').live('click',function(){
|
65
|
+
tmce_unload_children('#form_actuality');
|
66
|
+
jQuery('.lightbox-actuality').dialog('open');
|
67
|
+
jQuery('#submit_actuality').removeClass('create-actuality');
|
68
|
+
jQuery('#submit_actuality').addClass('update-actuality');
|
69
|
+
return false;
|
70
|
+
});
|
71
|
+
});
|
@@ -0,0 +1,94 @@
|
|
1
|
+
jQuery(document).ready(function(){
|
2
|
+
//init the tree for pages, blocks, widgets
|
3
|
+
jQuery("#page-tree").tree({
|
4
|
+
ui: {
|
5
|
+
theme_path: '/stylesheets/jstree/themes/',
|
6
|
+
theme_name : 'product_category',
|
7
|
+
selected_parent_close: false
|
8
|
+
},
|
9
|
+
callback: {
|
10
|
+
onload: function(TREE_OBJ){
|
11
|
+
tree_id = jQuery(TREE_OBJ.container).attr('id');
|
12
|
+
jQuery(TREE_OBJ.container).removeClass('tree-default');
|
13
|
+
}
|
14
|
+
}
|
15
|
+
});
|
16
|
+
|
17
|
+
// init the category tress
|
18
|
+
init_category_tree("#page-tree",'PageCategory','/admin/page_categories.json');
|
19
|
+
init_category_tree("#block-tree",'StaticContentCategory','/admin/static_content_categories.json');
|
20
|
+
init_category_tree("#widget-tree",'WidgetCategory','/admin/widget_categories.json');
|
21
|
+
|
22
|
+
// init the tress for category associations
|
23
|
+
init_association_block_category_tree('#association-static-content-tree', 'static_content_block');
|
24
|
+
init_association_block_category_tree('#association-carousel-tree', 'carousel');
|
25
|
+
init_association_block_category_tree('#association-widget-actuality-tree', 'widget_actuality');
|
26
|
+
init_association_block_category_tree('#association-widget-faq-tree', 'widget_faq');
|
27
|
+
|
28
|
+
// init the trees for page associations
|
29
|
+
init_association_page_tree('#association-static-content-page-tree', 'static_content_block');
|
30
|
+
init_association_page_tree('#association-carousel-page-tree', 'carousel');
|
31
|
+
init_association_page_tree('#association-widget-actuality-page-tree', 'widget_actuality');
|
32
|
+
init_association_page_tree('#association-widget-faq-page-tree', 'widget_faq');
|
33
|
+
|
34
|
+
//init the tree of blocks
|
35
|
+
jQuery('.blocks-tree').tree({
|
36
|
+
ui: {
|
37
|
+
theme_path: '/stylesheets/jstree/themes/',
|
38
|
+
theme_name : 'block_category',
|
39
|
+
selected_parent_close: false
|
40
|
+
},
|
41
|
+
callback: {
|
42
|
+
onload: function(TREE_OBJ){
|
43
|
+
tree_id = jQuery(TREE_OBJ.container).attr('id');
|
44
|
+
jQuery(TREE_OBJ.container).removeClass('tree-default');
|
45
|
+
},
|
46
|
+
onselect: function(NODE,TREE_OBJ){
|
47
|
+
/*
|
48
|
+
*Add click function on .small-icons.block items
|
49
|
+
*Those items are li in blocks/widget tree (in dialog box)
|
50
|
+
*and close the dialogg box
|
51
|
+
**/
|
52
|
+
var link = jQuery(NODE).find('a:first');
|
53
|
+
if(!link.hasClass('active')){
|
54
|
+
putInBlockList(link.attr('title'), link.text(), jQuery(NODE).attr('id').substr(6));
|
55
|
+
closeDialogBox();
|
56
|
+
jQuery('.selectedPageCol').removeClass('selectedPageCol');
|
57
|
+
}
|
58
|
+
return false;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
});
|
62
|
+
|
63
|
+
//init the tree of pages
|
64
|
+
jQuery(".pages-tree").tree({
|
65
|
+
ui: {
|
66
|
+
theme_path: '/stylesheets/jstree/themes/',
|
67
|
+
theme_name : 'page_category',
|
68
|
+
selected_parent_close: false
|
69
|
+
},
|
70
|
+
callback: {
|
71
|
+
onload: function(TREE_OBJ){
|
72
|
+
tree_id = jQuery(TREE_OBJ.container).attr('id');
|
73
|
+
jQuery(TREE_OBJ.container).removeClass('tree-default');
|
74
|
+
},
|
75
|
+
onselect: function(NODE,TREE_OBJ){
|
76
|
+
var link = jQuery(NODE).children('a');
|
77
|
+
if(!link.hasClass('active')){
|
78
|
+
var url = jQuery(link).attr('href');
|
79
|
+
var block_id = url.split('/')[5];
|
80
|
+
var page_id = get_rails_element_id(NODE);
|
81
|
+
jQuery.ajax({
|
82
|
+
url: url,
|
83
|
+
complete: putInPageList(jQuery(link).text(), jQuery(link).attr('title'), block_id, page_id),
|
84
|
+
data: 'authenticity_token=' + encodeURIComponent(window._forgeos_js_vars.token),
|
85
|
+
dataType:'text',
|
86
|
+
type:'post'
|
87
|
+
});
|
88
|
+
closeDialogBox();
|
89
|
+
}
|
90
|
+
return false;
|
91
|
+
}
|
92
|
+
}
|
93
|
+
});
|
94
|
+
});
|