.row-fluid %label.form-label.span2 = btc('slug', Mokio::Menu) .span10 = text_field_tag '', (@menu.full_slug.nil?) ? bt('no_slug', Mokio::Menu) : "/" + @menu.full_slug.to_s, readonly: true = f.input :lang_id, collection: Mokio::Lang.all.collect{|lang| [bt(lang.name), lang.id]}, include_blank: false, disabled: !@menu.display_editable_field?('lang_id') -# = f.input :lang_id, :as => :hidden, :input_html => { :value => (@menu.lang_id.nil? ? 1 : @menu.lang_id)}, disabled: !@menu.display_editable_field?('lang_id') = f.input :active, :wrapper => :active_checkbox, disabled: !@menu.display_editable_field?('active') = f.input :visible, :wrapper => :active_checkbox, disabled: !@menu.display_editable_field?('visible') = f.input :name, disabled: !@menu.display_editable_field?('name') .row-fluid %label.form-label.span2 = btc('type', Mokio::Menu) .span10 = select_tag "menu_type", options_for_select([[btc("content",'Menu'), 'content'],[btc("external_link",'Menu'), 'external_link']], @menu.contents.empty? && !@menu.external_link.blank? ? "external_link" : "content") .row-fluid#content_box{:style => "display: #{@menu.contents.empty? && !@menu.external_link.blank? ? 'none' : 'block'};"} = dual_select_box(@menu.available_contents, 'id', 'title', @menu.contents, 'id', 'title', btc('content', 'Menu'), '','menu[content_ids][]', true, false, false, @menu.display_editable_field?('contents')) #url_box{:style => "display: #{@menu.contents.empty? && !@menu.external_link.blank? ? 'block' : 'none'};"} = f.input :external_link, label: btc("external_link",'Menu'), disabled: !@menu.display_editable_field?('external_link') = f.input :follow, :as => :select, :collection => [[bt("follow",'Menu'), "true"], [bt("nofollow",'Menu'), "false"]], :include_blank => false = f.input :parent_id, :collection => @menu.parent_tree.collect{|m| ["#{'-' * m.ancestry.count('/')}#{m.name}", m.id]}, include_blank: false, disabled: !@menu.display_editable_field?('parent_id') .row-fluid %label.form-label.span2 = btc('path', Mokio::Menu) .span10 #menu_breadcrumps = tree_menu_breadcrumps(@menu.parent) = f.input :target, :collection => [[bt("current_window_inside",Mokio::Menu), nil], [bt("new_window",Mokio::Menu), "_blank"]], include_blank: false, disabled: !@menu.display_editable_field?('target') .row-fluid %label.form-label.span2 = btc("blocks", 'Menu') .span10 .tabs_wrap %ul.nav.nav-tabs.pattern{:id => "tabs_modules"} - Mokio::ModulePosition.all.each do |mp| %li %a{:href => "#tab" + mp.id.to_s, :"data-toggle" => "tab"} = mp.name .tab-content - Mokio::ModulePosition.all.each do |mp| .tab-pane.fade{:id => "tab" + mp.id.to_s} = dual_select_box(@menu.available_modules_by_pos[mp.id].nil? ? [] : @menu.available_modules_by_pos[mp.id], 'id', 'module_title', @menu.selected_modules_by_pos[mp.id].nil? ? [] : @menu.selected_modules_by_pos[mp.id], 'id', 'module_title', mp.name, '_' + mp.id.to_s, 'menu[available_module_ids][' + mp.id.to_s + '][]', false, true, true, @menu.display_editable_field?('available_modules')) - content_for :js do = javascript_include_tag "backend/menu/menu_dual_select" :javascript $(document).ready(function() { $('#menu_parent_id').change(function() { $.ajax({ url: "#{Mokio::Engine.routes.url_helpers.root_path}menus/" + $('#menu_parent_id').val() + "/update_menu_breadcrumps", dataType: "script" }); }); $('#menu_lang_id').change(function() { var content_confirm = confirm('#{bt('content_remove_confirm', Mokio::Menu)}'); var modules_confirm = confirm('#{bt('modules_remove_confirm', Mokio::Menu)}'); $.ajax({ url: "#{Mokio::Engine.routes.url_helpers.root_path}menus/lang_changed?lang_id=" + $('#menu_lang_id').val() + '&content_confirm='+ content_confirm + '&modules_confirm=' + modules_confirm, dataType: "script" }); }); dualSelectInit('', true); #{@dual_select_str} //tabs $('#tabs_modules li').first().addClass('active'); $('.tabs_wrap .tab-pane').first().addClass('in active'); $('#menu_type').change(function() { $('#content_box').toggle(); $('#url_box').toggle(); }); });