Compare commits

...
3 changed files with 11 additions and 3 deletions

No files matched your search

+1 -2
View File
@@ -54,10 +54,9 @@ class Admin::DesignsController < OrbitBackendController
when 'javascripts', 'themes'#, 'images'
@object = @design.send(params[:type]).find(params[:object_id])
end
Dir.mktmpdir('f_path') { |dir|
temp_file = File.new(dir + '/' + File.basename(@object.file.url), 'w+')
temp_file.write(params[:file][:content].force_encoding('UTF-8'))
temp_file.write(params[:html_code].force_encoding('UTF-8'))
@object.remove_file!
@object.file = temp_file
@object.save
@@ -341,9 +341,18 @@ class ApplicationController < ActionController::Base
else
objects = get_viewable(object_class, query)
end
if (!user_signed_in? && object_class == "bulletin")
objects = get_bulletins_for_open_backend(objects)
end
Kaminari.paginate_array(filter_authorized_objects(objects)).page(params[:page]).per(10)
end
def get_bulletins_for_open_backend(objects)
objects.select{|object| object.is_rejected == false && object.is_pending == false}
end
def get_string_value_from_object(object)
s = object.name_translations[I18n.locale.to_s] unless s rescue nil
s = object.title_translations[I18n.locale.to_s] unless s rescue nil
+1 -1
View File
@@ -126,7 +126,7 @@
</div>
<% @design.javascripts.each do |js| %>
<div class="clearfix tab-pane fade active in" id="#<%= dom_id js %>">
<div class="clearfix tab-pane fade active in" id="<%= dom_id js %>">
<%= render :partial => 'tab_form', :locals => {:type => :javascripts, :object => js} %>
</div>
<% end %>