解决上传图片问题

This commit is contained in:
huang 2016-04-08 09:55:02 +08:00
parent c83eefbbaa
commit 320ed07b31
1 changed files with 15 additions and 7 deletions

View File

@ -62,9 +62,9 @@
<!--add by huang-->
<script type="text/javascript">
function orge_new_files_upload()
function org_new_files_upload()
{
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_org_new_files',:locals => {:org => @organization, :org_attachment_type => 1}) %>');
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_org_new_files',:locals => {:org => @organization, :org_attachment_type => 0}) %>');
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
@ -72,7 +72,7 @@
$('#ajax-modal').parent().addClass("popbox_polls");
}
function orge_new_files_banner_upload()
function org_new_files_banner_upload()
{
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_org_new_files_banner',:locals => {:org => @organization, :org_attachment_type => 1}) %>');
showModal('ajax-modal', '513px');
@ -89,12 +89,20 @@
<div class="header-con">
<% if User.current.admin_of_org?(@organization) %>
<div class="logo fl">
<% if @org_logo_attchment.blank? %>
<a class="logo-img"><img src="/images/org_new_style/logo.jpg" alt=""/></a>
<a href="" class="logo-add" title="点击替换LOGO" onclick="orge_new_files_upload();"></a>
<% else %>
<img src="/attachments/<%= @org_logo_attchment.id %>/<%= @org_logo_attchment.filename %>" class="logo-img">
<% end %>
<a href="#" class="logo-add" title="点击替换LOGO" onclick="org_new_files_upload();"></a>
</div>
<% else %>
<div class="logo fl">
<% if @org_logo_attchment.blank? %>
<a class="logo-img"><img src="/images/org_new_style/logo.jpg" alt=""/></a>
<% else %>
<img src="/attachments/<%= @org_logo_attchment.id %>/<%= @org_logo_attchment.filename %>" class="logo-img">
<% end %>
</div>
<% end %>
<%= render :partial => 'organizations/org_logined_header' %>
@ -140,7 +148,7 @@
<% else %>
<img src="/attachments/<%= @org_banner_attchment.id %>/<%= @org_banner_attchment.filename %>" class="banner-img">
<% end %>
<a href="#" class="banner-add" title="点击替换图片" onclick="orge_new_files_banner_upload();"></a>
<a href="#" class="banner-add" title="点击替换图片" onclick="org_new_files_banner_upload();"></a>
<div class="banner-txt">
<p ><%= @organization.name %></p>
</div>