Fix for widgets edit form
This commit is contained in:
parent
18d0657321
commit
ef67941ba5
|
@ -8,6 +8,7 @@ class Admin::PagePartsController < OrbitBackendController
|
|||
@id = params[:id]
|
||||
@part = PagePart.find(params[:id])
|
||||
@module_apps = ModuleApp.for_widget_select
|
||||
Rails.logger.info"@@@@@@@@@@@@@@@@"+@module_apps.inspect
|
||||
@module_app = @part.module_app || @module_apps.first
|
||||
@module_app_categories = @module_app.categories
|
||||
@module_app_tags = @module_app.tags
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
<% content_for :page_specific_javascript do %>
|
||||
<%= javascript_include_tag "lib/items/page_part" %>
|
||||
<% end %>
|
||||
|
||||
<%= form_for @part, url: admin_page_part_path(@part), html: { class: "form-horizontal main-forms"} do |f| %>
|
||||
<%= form_for @part, url: {action: "update"}, :remote=>true, html: { class: "form-horizontal main-forms"} do |f| %>
|
||||
<%= f.error_messages %>
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
<label href="#none" class="btn btn-large" data-toggle="tab">
|
||||
|
@ -81,7 +80,7 @@
|
|||
<div class="control-group input-content">
|
||||
<%= f.label :locale, "#{t(:title)} #{I18nVariable.from_locale(locale)}", class: "control-label muted" %>
|
||||
<div class="controls">
|
||||
<%= f.text_field locale, class: 'input-xlarge page_title', placeholder: "#{t(:title)} #{I18nVariable.from_locale(locale)}", id: locale %>
|
||||
<%= f.text_field locale, class: 'input-xlarge page_title', placeholder: "#{t(:title)} #{I18nVariable.from_locale(locale)}", id: locale, :value => (@part.title_translations[locale] rescue nil) %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -102,13 +101,13 @@
|
|||
<%= f.label :categories, t(:categories), class: "control-label muted" %>
|
||||
<div class="controls">
|
||||
<%= content_tag :label, class: "checkbox" do %>
|
||||
<%= check_box_tag nil, nil, true, class: "select_all" %> <%= t(:all) %>
|
||||
<%= check_box_tag nil, nil, false, class: "select_all" %> <%= t(:all) %>
|
||||
<% end %>
|
||||
<div class="groups" id="page-category">
|
||||
<%= content_tag_for(:label, @module_app_categories, class: "checkbox inline") do |category|%>
|
||||
<%= check_box_tag("page_part[tag][]", category.id, (@part.category.include?(category.id) rescue false) ) %>
|
||||
<%= check_box_tag("page_part[category][]", category.id, (@part.category.include?(category.id.to_s) rescue false) ) %>
|
||||
<%= category.title %>
|
||||
<% end if @module_app_tags %>
|
||||
<% end if @module_app_categories %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -120,7 +119,7 @@
|
|||
<% end %>
|
||||
<div class="groups" id="page-tags">
|
||||
<%= content_tag_for(:label, @module_app_tags, class: "checkbox inline") do |tag|%>
|
||||
<%= check_box_tag("page_part[tag][]", tag.id, (@part.tag.include?(tag.id) rescue false) ) %>
|
||||
<%= check_box_tag("page_part[tag][]", tag.id, (@part.tag.include?(tag.id.to_s) rescue false) ) %>
|
||||
<%= tag.name %>
|
||||
<% end if @module_app_tags %>
|
||||
</div>
|
||||
|
@ -160,4 +159,4 @@
|
|||
$("#public_r_tag").on("change", "#tag_list select", function() {
|
||||
$.getScript($(this).attr('rel') + '?type=' + $(this).val() + "&id=" + "<%= @part.id %>" );
|
||||
});
|
||||
</script>
|
||||
</script>
|
Loading…
Reference in New Issue