Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
234a6f0ae6 | ||
|
|
98a03c2e40 |
No files matched your search
@@ -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
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
Reference in new issue
Block a user