资源栏目增加资源

This commit is contained in:
ouyangxuhua 2015-12-14 16:41:18 +08:00
parent b72cc82e4d
commit a5fa68c928
7 changed files with 24 additions and 9 deletions

View File

@ -392,8 +392,8 @@ class FilesController < ApplicationController
sort = "#{Attachment.table_name}.created_on desc"
end
@container_type = 2
@organization = Organization.find(params[:organization_id])
@containers = [ OrgSubfield.includes(:attachments).reorder(sort).find(@org_subfield.id)]
@organization = Organization.find(@containers.first.organization_id)
show_attachments @containers
render :layout => 'base_org'
# @subfield = params[:org_subfield_id]
@ -733,4 +733,8 @@ class FilesController < ApplicationController
# format.html
end
end
def subfield_upload_file
@org_subfield = OrgSubfield.find(params[:org_subfield_id])
end
end

View File

@ -10,7 +10,7 @@
<!-- <label style="margin-top:3px;"><#%= l(:label_file_upload)%></label> -->
<!--<input type="hidden" name="in_org_subfield_toolbar" value="Y">-->
<input type="hidden" name="org_subfield_attachment_type" value="<%= org_subfield_attachment_type%>">
<%= render :partial => 'files/attachement_list',:locals => {:org_subfield => org_subfield} %>
<%= render :partial => 'files/attachement_list'%>
<div class="cl"></div>
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="hideModal();"><%= l(:button_cancel)%></a>
<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%= l(:button_confirm)%></a>
@ -18,9 +18,7 @@
</div>
</div>
<% content_for :header_tags do %>
<%= javascript_include_tag 'attachments' %>
<% end %>
</div>
<script>

View File

@ -0,0 +1,6 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_subfield_file',:locals => {:org_subfield => @org_subfield,:org_subfield_attachment_type => 1}) %>');
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>");
$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("popbox_polls");

View File

@ -12,9 +12,9 @@
<%= favicon %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository','org' %>
<%= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository','courses','org' %>
<%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move','org'%>
<%= javascript_include_tag 'attachments' %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>

View File

@ -29,7 +29,11 @@
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText" %>
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子"%>
<% else %>
<%= link_to "#{field.name}", org_subfield_files_path(field, :organization_id => organization.id), :class => "homepageMenuText" %>
<%= link_to "#{field.name}", org_subfield_files_path(field), :class => "homepageMenuText" %>
<% if User.current.member_of_org?organization %>
<%= link_to "", subfield_upload_file_org_subfield_files_path(field.id),:method => "post", :remote => true, :class => "homepageMenuSetting fr", :title => "上传资源" %>
<!--<a class="homepageMenuSetting fr" title="上传资源" href="javascript:void(0);" onclick="org_subfield_files_upload(<%#= field.id %>);"> </a>-->
<% end %>
<!--<a href="javascript:void(0);" class="homepageMenuText"><%#= field.name %></a>-->
<% end %>
</div>

View File

@ -78,6 +78,7 @@ RedmineApp::Application.routes.draw do
match "search_files_in_subfield",:via => [:post,:get]
match "searchone4reload",:via => [:post,:get]
match "search_tag_attachment", :via => [:post,:get]
match "subfield_upload_file", :via => :post
end
member do
match "quote_resource_show", :via => [:get]

View File

@ -83,4 +83,6 @@ a.linkGrey8:hover {color:#585858;}
.re_con{ margin:5px; width:665px;}
.re_con_top{color:#494949; }
.re_con_top span{ color:#999999; font-weight:bold;}
ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; }
ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; }
.popbox_polls{width:300px;height:100px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-100px 0 0 -150px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}