修改项目上传资源链接

This commit is contained in:
sw 2015-03-11 15:32:50 +08:00
parent 52dfb0b0ed
commit 1e262ec731
3 changed files with 3 additions and 2 deletions

View File

@ -99,6 +99,7 @@ class FilesController < ApplicationController
end
def index
@flag = params[:flag] || false
#sort_init 'filename', 'asc'
sort_init 'created_on', 'desc'
sort_update 'created_on' => "#{Attachment.table_name}.created_on",

View File

@ -11,7 +11,7 @@
<%= link_to(l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @project) %>
<%= link_to(l(:label_relation_files), 'javascript:void(0);', :onclick => "$('#upload_file_div').slideUp();$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %>
<p></p>
<div id="upload_file_div" class="relation_file_div hidden">
<div id="upload_file_div" class="relation_file_div <%= !@flag.nil?&&@flag=="true" ? '' : 'hidden'%>">
<%= render :partial => 'new', locals: {project: @project} %>
</div>
<div id="relation_file_div" class="relation_file_div hidden">

View File

@ -159,7 +159,7 @@
<div class="subNav">
<%= link_to l(:label_course_file), project_files_path(@project), :style => "color:#3CA5C6" %><span class="subnav_num">(<%= @project.attachments.count %>)</span>
<% if User.current.logged? && User.current.member_of?(@project) %>
<%= link_to "+上传资源", new_project_file_path(@project),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %>
<%= link_to "+上传资源", project_files_path(@project, :flag => true),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %>
<% end %>
</div>
<% end%>