组织、项目的资源文件增加描述修改及上传文件时候添加描述,并且所有操作对超级管理员开放
This commit is contained in:
parent
f9f66bac7b
commit
70a762220a
|
@ -483,6 +483,7 @@ class FilesController < ApplicationController
|
|||
if !attachments.empty? && attachments[:files] && tag_name != ""
|
||||
attachments[:files].each do |attachment|
|
||||
attachment.tag_list.add(tag_name)
|
||||
attachment.description = params[:description]
|
||||
attachment.save
|
||||
end
|
||||
end
|
||||
|
@ -493,6 +494,7 @@ class FilesController < ApplicationController
|
|||
if !attachments.empty? && attachments[:files] && tag_name != ""
|
||||
attachments[:files].each do |attachment|
|
||||
attachment.tag_list.add(tag_name)
|
||||
attachment.description = params[:description]
|
||||
attachment.save
|
||||
end
|
||||
end
|
||||
|
@ -600,6 +602,7 @@ class FilesController < ApplicationController
|
|||
if !attachments.empty? && attachments[:files] && tag_name != ""
|
||||
attachments[:files].each do |attachment|
|
||||
attachment.tag_list.add(tag_name)
|
||||
attachment.description = params[:description]
|
||||
attachment.save
|
||||
end
|
||||
end
|
||||
|
@ -610,6 +613,7 @@ class FilesController < ApplicationController
|
|||
if !attachments.empty? && attachments[:files] && tag_name != ""
|
||||
attachments[:files].each do |attachment|
|
||||
attachment.tag_list.add(tag_name)
|
||||
attachment.description = params[:description]
|
||||
attachment.save
|
||||
end
|
||||
end
|
||||
|
|
|
@ -36,6 +36,25 @@
|
|||
<p class="f_l mb5 fontGrey2">文件大小:<%= number_to_human_size(file.filesize) %></p>
|
||||
<p class="fl ml15 fontGrey2">下载<%= file.downloads%> | 引用<span id="reference_number_<%= file.id %>"><%= file.quotes.nil? ? 0:file.quotes %></span></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<% if User.current.logged? && ((delete_allowed || User.current.id == file.author_id) && file.container_id == org_subfield.id && file.container_type == "OrgSubfield" )%>
|
||||
<div>
|
||||
<div id="file_description_show_<%= file.id %>" class="fontGrey2 mb4">
|
||||
<%= render :partial => 'files/file_description', :locals => {:file => file} %>
|
||||
</div>
|
||||
<textarea class="homepageSignatureTextarea none" placeholder="请编辑资源描述" id="file_description_edit_<%= file.id %>"
|
||||
onblur="edit_file_description('<%= update_file_description_org_subfield_file_path(file.container.organization,file)%>','<%= file.id %>');"><%= file.description %></textarea>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="fontGrey2 mb4">
|
||||
<% unless file.description.blank? %>
|
||||
<div class="cl"></div>
|
||||
<div class="fontGrey2 mb4">资源描述:<%= file.description %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="cl"></div>
|
||||
<div class="tag_h">
|
||||
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %>
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
<%= link_to truncate(file.filename,length: 35, omission: '...'),
|
||||
download_named_attachment_path(file.id, file.filename),
|
||||
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %>
|
||||
<% if User.current.logged? %>
|
||||
<% if (manage_allowed || file.author_id == User.current.id) && project_contains_attachment?(project,file) %>
|
||||
<% if User.current.logged? || User.current.admin? %>
|
||||
<% if ((manage_allowed || file.author_id == User.current.id) && project_contains_attachment?(project,file)) || User.current.admin? %>
|
||||
<%= link_to(l(:label_slected_to_other_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %>
|
||||
<% if authority_pubilic_for_files(project, file) && delete_allowed %>
|
||||
<span id="is_public_<%= file.id %>">
|
||||
|
@ -43,6 +43,22 @@
|
|||
<p class="f_r c_grey02" ><%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %> | 下载<%= file.downloads %> | 引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if User.current.admin? || ( User.current.logged? && ( (manage_allowed || file.author_id == User.current.id) && project_contains_attachment?(project,file))) %>
|
||||
<div>
|
||||
<div id="file_description_show_<%= file.id %>" class="fontGrey2 mb4">
|
||||
<%= render :partial => 'files/file_description', :locals => {:file => file} %>
|
||||
</div>
|
||||
<textarea class="homepageSignatureTextarea none" placeholder="请编辑资源描述" id="file_description_edit_<%= file.id %>"
|
||||
onblur="edit_file_description('<%= update_file_description_project_file_path(project,file)%>','<%= file.id %>');"><%= file.description %></textarea>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="fontGrey2 mb4">
|
||||
<% unless file.description.blank? %>
|
||||
<div class="cl"></div>
|
||||
<div class="fontGrey2 mb4">资源描述:<%= file.description %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="tag_h">
|
||||
<!-- container_type = 2 代表是项目里的资源 -->
|
||||
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %>
|
||||
|
|
|
@ -35,6 +35,22 @@
|
|||
<p class="fl ml15 fontGrey2">下载<%= file.downloads%> | 引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if User.current.admin? || (User.current.logged? && ( (is_project_manager?(User.current, project) || file.author_id == User.current.id) && project_contains_attachment?(project, file)) && ((delete_allowed || User.current.id == file.author_id) && file.container_id == project.id && file.container_type == "Project")) %>
|
||||
<div>
|
||||
<div id="file_description_show_<%= file.id %>" class="fontGrey2 mb4">
|
||||
<%= render :partial => 'files/file_description', :locals => {:file => file} %>
|
||||
</div>
|
||||
<textarea class="homepageSignatureTextarea none" placeholder="请编辑资源描述" id="file_description_edit_<%= file.id %>"
|
||||
onblur="edit_file_description('<%= update_file_description_project_file_path(project,file)%>','<%= file.id %>');"><%= file.description %></textarea>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="fontGrey2 mb4">
|
||||
<% unless file.description.blank? %>
|
||||
<div class="cl"></div>
|
||||
<div class="fontGrey2 mb4">资源描述:<%= file.description %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="tag_h">
|
||||
<!-- container_type = 1 代表是课程里的资源 -->
|
||||
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
</div>
|
||||
<%# unless file.description.blank? %>
|
||||
<div class="cl"></div>
|
||||
<% if User.current.logged? && ((is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file)) && ((delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course") %>
|
||||
<% if User.current.admin? || ( User.current.logged? && ((is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file)) && ((delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course")) %>
|
||||
<div>
|
||||
<div id="file_description_show_<%= file.id %>" class="fontGrey2 mb4">
|
||||
<%= render :partial => 'files/file_description', :locals => {:file => file} %>
|
||||
|
@ -63,9 +63,9 @@
|
|||
<div class="homepagePostSetting">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<% if User.current.logged? %>
|
||||
<% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %>
|
||||
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course" %>
|
||||
<% if User.current.logged? || User.current.admin? %>
|
||||
<% if User.current.admin? || ((is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file)) %>
|
||||
<% if User.current.admin? || ((delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course") %>
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
|
||||
<li><%= link_to '延期发布',file_hidden_course_file_path(@course,file),:class => "postOptionLink",:remote=>true %></li>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<% if User.current.logged? %>
|
||||
<% if (is_project_manager?(User.current, project) || file.author_id == User.current.id) && project_contains_attachment?(project, file) %>
|
||||
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == project.id && file.container_type == "Project" %>
|
||||
<% if User.current.admin? || (User.current.logged? ) %>
|
||||
<% if User.current.admin? || ((is_project_manager?(User.current, project) || file.author_id == User.current.id) && project_contains_attachment?(project, file)) %>
|
||||
<% if User.current.admin? || ((delete_allowed || User.current.id == file.author_id) && file.container_id == project.id && file.container_type == "Project") %>
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><%= link_to("发 送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
|
||||
<li><%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li>
|
||||
|
|
|
@ -22,6 +22,13 @@
|
|||
<%= render :partial => 'files/new_style_attachment_list',:locals => {:container => project} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="mb5">
|
||||
<label class="fl c_dark f14" style="margin-top: 4px;">文件描述:</label>
|
||||
<div class="fl">
|
||||
<input type="text" name="description" placeholder="文件描述" class="InputBox fl W160">
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</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>-->
|
||||
|
|
|
@ -16,6 +16,13 @@
|
|||
<!--<input type="hidden" name="org_subfield_attachment_type" value="<%#= org_subfield_attachment_type%>">-->
|
||||
<%= render :partial => 'files/org_subfield_upload_attachment_list', :locals => {:container => org_subfield}%>
|
||||
<div class="cl"></div>
|
||||
<div class="mb5">
|
||||
<label class="fl c_dark f14" style="margin-top: 4px;">文件描述:</label>
|
||||
<div class="fl">
|
||||
<input type="text" name="description" placeholder="文件描述" class="InputBox fl W160">
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</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>
|
||||
<% end %>
|
||||
|
|
|
@ -130,6 +130,7 @@ RedmineApp::Application.routes.draw do
|
|||
end
|
||||
member do
|
||||
match "quote_resource_show_org_subfield", :via => [:get]
|
||||
get "update_file_description"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -779,6 +780,7 @@ RedmineApp::Application.routes.draw do
|
|||
member do
|
||||
match "quote_resource_show", :via => [:get]
|
||||
get "file_hidden"
|
||||
get "update_file_description"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue