diff --git a/app/views/admin/page_parts/_widget_options.html.erb b/app/views/admin/page_parts/_widget_options.html.erb new file mode 100644 index 00000000..731fdc38 --- /dev/null +++ b/app/views/admin/page_parts/_widget_options.html.erb @@ -0,0 +1,13 @@ +<% if (@module_app && @module_app.widget_options) %> + <%= label_tag('widget_options') %> + <% if @module_app.widget_options.has_key? @part.widget_path%> + <% @module_app.widget_options[@part.widget_path].each do |key,options| %> + <%= label_tag(t(@module_app.widget_options_fields_i18n[@part.widget_path][key]))%> + <%= select_tag "page_part[widget_options][#{key}]", options_for_select(options,(@part.widget_options[key] rescue nil)) %> + + + <% end %> + + <% end %> + +<% end %> \ No newline at end of file diff --git a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb index fcd5f205..aba0e814 100644 --- a/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb +++ b/vendor/built_in_modules/announcement/app/controllers/panel/announcement/back_end/bulletins_controller.rb @@ -207,31 +207,6 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController # PUT /bulletins/1.xml def update - if params[:bulletin_link] - - @bulletin_link = BulletinLink.find(params[:id]) - @link_url = panel_announcement_back_end_bulletin_path(@bulletin_link) - - respond_to do |format| - if @bulletin_link.update_attributes(params[:bulletin_link]) - # format.html { redirect_to(panel_announcement_back_end_bulletins_url) } - format.js { render 'update_bulletin_link' } - end - end - - elsif params[:bulletin_file] - - @bulletin_file = BulletinFile.find(params[:id]) - @file_url = panel_announcement_back_end_bulletin_path(@bulletin_file) - respond_to do |format| - - if @bulletin_file.update_attributes(params[:bulletin_file]) - # format.html { redirect_to(panel_announcement_back_end_bulletins_url) } - format.js { render 'update_bulletin_file' } - end - end - - else @bulletin = Bulletin.find(params[:id]) @@ -362,10 +337,10 @@ class Panel::Announcement::BackEnd::BulletinsController < OrbitBackendController def clean_values if params[:bulletin] params[:bulletin][:bulletin_links_attributes].each_with_index do |link, index| - params[:bulletin][:bulletin_links_attributes].delete(index.to_s) if link[1]['url'].blank? and link[1]['title'].blank? + params[:bulletin][:bulletin_links_attributes].delete(index.to_s) if link[1]['url'].blank? and link[1]['title_translations'].blank? end rescue nil params[:bulletin][:bulletin_files_attributes].each_with_index do |link, index| - params[:bulletin][:bulletin_files_attributes].delete(index.to_s) if link[1]['file'].blank? and link[1]['title'].blank? + params[:bulletin][:bulletin_files_attributes].delete(index.to_s) if link[1]['file'].blank? and link[1]['title_translations'].blank? end rescue nil end end diff --git a/vendor/built_in_modules/announcement/app/models/bulletin.rb b/vendor/built_in_modules/announcement/app/models/bulletin.rb index 42407007..85d1b654 100644 --- a/vendor/built_in_modules/announcement/app/models/bulletin.rb +++ b/vendor/built_in_modules/announcement/app/models/bulletin.rb @@ -51,7 +51,7 @@ class Bulletin validates :title, :at_least_one => true - before_save :check_deadline, :update_avliable_language, :clean_values + before_save :check_deadline, :update_avliable_language, :clean_values#, :save_bulletin_links, :save_bulletin_files searchable do text :titles do diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb index 02182008..77ac7c9e 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form.html.erb @@ -253,39 +253,16 @@
<%= t("sys.limit_of_upload_file_size",:best_size => '3MB') %>
<%= t("sys.preview_only_for_img") %>
- - - <%# @bulletin.bulletin_files.each_with_index do |bulletin_file, i| %> + <% @bulletin.bulletin_files.each_with_index do |bulletin_file, i| %> <%#= fields_for "bulletin[bulletin_files][]", bulletin_file do |f| %> - <%#= f.fields_for :bulletin_files do |f| %> - <%#= render :partial => 'form_bulletin_file', :object => bulletin_file, :locals => {:f => f, :i => i} %> - <%# end %> - <%# end %> + <%= f.fields_for :bulletin_files, bulletin_file do |f| %> + <%= render :partial => 'form_bulletin_file', :object => bulletin_file, :locals => {:f => f, :i => i} %> + <% end %> + <% end %> diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb index 24214877..a1697b2a 100644 --- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb +++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_file.html.erb @@ -59,16 +59,16 @@