logo图标替换

dev_wuhao
huang 9 years ago
parent 218a6b9358
commit ac1b3338c5

@ -629,32 +629,16 @@ class FilesController < ApplicationController
# redirect_to org_subfield_files_url(@org_subfield) # redirect_to org_subfield_files_url(@org_subfield)
# } # }
end end
elsif @organization # 组织添加附件,为了修改图片
elsif params[:organization_id]
@organization = Organization.find(params[:organization_id])
@addTag=false @addTag=false
attachments = Attachment.attach_filesex(@organization, params[:attachments], params[:org_attachment_type]) # atttchment_type = 0为logo 1为banner
if params[:logo]
if params[:org_attachment_type] && params[:org_attachment_type].is_a?(Array) attachments = Attachment.attach_filesex(@organization, params[:attachments], false)
params[:org_attachment_type].each do |type|
tag_name = get_tag_name_by_type_number type
if !attachments.empty? && attachments[:files] && tag_name != ""
attachments[:files].each do |attachment|
attachment.tag_list.add(tag_name)
attachment.save
end
end
end
else else
if params[:org_attachment_type] && params[:org_attachment_type] != "5" attachments = Attachment.attach_filesex(@organization, params[:attachments], true)
tag_name = get_tag_name_by_type_number params[:org_attachment_type]
if !attachments.empty? && attachments[:files] && tag_name != ""
attachments[:files].each do |attachment|
attachment.tag_list.add(tag_name)
attachment.save
end
end
end
end end
# TODO: 临时用 nyan # TODO: 临时用 nyan
sort_init 'created_on', 'desc' sort_init 'created_on', 'desc'
sort_update 'created_on' => "#{Attachment.table_name}.created_on", sort_update 'created_on' => "#{Attachment.table_name}.created_on",

@ -1,11 +1,11 @@
<div id="popbox_upload" class="mb10" style="margin-top: -30px;color:#15bccf; font-size:16px;"> <div id="popbox_upload" class="mb10" style="margin-top: -30px;color:#15bccf; font-size:16px;">
<div class="upload_con"> <div class="upload_con">
<h2 style="text-align: center"><%= l(:label_upload_files)%></h2> <h2 style="text-align: center">更换Logo</h2>
<div class="upload_box"> <div class="upload_box">
<p>尺寸最好55*33</p>
<%= error_messages_for 'attachment' %> <%= error_messages_for 'attachment' %>
<div id="network_issue" style="color: red; display: none;"><%= l(:label_file_upload_error_messages)%></div> <div id="network_issue" style="color: red; display: none;"><%= l(:label_file_upload_error_messages)%></div>
<%= form_tag(organization_files_path(org, :in_org => params[:in_org]), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %> <%= form_tag(organization_files_path(org, :in_org => params[:in_org], :logo => true), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
<!--<input type="hidden" name="org_subfield_attachment_type" value="<%#= org_subfield_attachment_type%>">--> <!--<input type="hidden" name="org_subfield_attachment_type" value="<%#= org_subfield_attachment_type%>">-->
<%= render :partial => 'files/org_subfield_upload_attachment_list', :locals => {:container => org}%> <%= render :partial => 'files/org_subfield_upload_attachment_list', :locals => {:container => org}%>
<div class="cl"></div> <div class="cl"></div>

@ -66,18 +66,9 @@ $("#resource_list").html('<%= j(render partial: "subfield_files" ,locals: {org_
<% end %> <% end %>
<% end %> <% end %>
<% elsif @organization %> //组织单独处理 <% elsif @organization %> //组织单独处理
<% if params[:in_org] %>
window.location.href = '<%= organization_files_path @organization %>';
<%else %>
hideModal(); hideModal();
$("#resource_list").html('<%= j(render partial: "subfield_files" ,locals: {org_subfield: @org_subfield}) %>'); window.location.href = '<%= organization_path @organization %>';
// 添加文件上传成功提示,
<% unless params[:attachments].nil? %>
// var div = $('<div id="addBox" class="flash notice">文件上传成功!</div>');
// $("#org_subfield_list").prepend(div);
// setTimeout( function(){div.remove();},3000);
<% end %>
<% end %>
<% end %> <% end %>
<% end %> <% end %>
$(document).ready(img_thumbnails); $(document).ready(img_thumbnails);

Loading…
Cancel
Save