项目、课程、组织资源描述过长不能提交的问题
This commit is contained in:
parent
d827b3e519
commit
2e94fbee81
|
@ -26,7 +26,7 @@ class FilesController < ApplicationController
|
|||
before_filter :authorize, :except => [:create,:getattachtype,:quote_resource_show,:search,:searchone4reload,:search_project,:quote_resource_show_project,
|
||||
:search_tag_attachment,:subfield_upload_file,:search_org_subfield_tag_attachment,
|
||||
:search_tag_attachment,:quote_resource_show_org_subfield,:find_org_subfield_attache,
|
||||
:search_files_in_subfield,:upload_files_menu,:file_hidden,:republish_file,:update_file_description]
|
||||
:search_files_in_subfield,:upload_files_menu,:file_hidden,:republish_file,:update_file_description, :edit_file_description]
|
||||
|
||||
helper :sort
|
||||
include SortHelper
|
||||
|
@ -981,6 +981,13 @@ class FilesController < ApplicationController
|
|||
def upload_files_menu
|
||||
|
||||
end
|
||||
|
||||
def edit_file_description
|
||||
@attachment = Attachment.find(params[:id])
|
||||
@attachment.description = params[:file_description_edit]
|
||||
@attachment.save
|
||||
end
|
||||
|
||||
def update_file_description
|
||||
@attachment = Attachment.find(params[:id])
|
||||
@attachment.description = params[:description]
|
||||
|
|
|
@ -43,8 +43,10 @@
|
|||
<div id="file_description_show_<%= file.id %>" class="fontGrey2 mb4">
|
||||
<%= render :partial => 'files/file_description', :locals => {:file => file} %>
|
||||
</div>
|
||||
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 none " placeholder="请编辑资源描述" id="file_description_edit_<%= file.id %>"
|
||||
onblur="edit_file_description('<%= update_file_description_org_subfield_file_path(file.container,file)%>','<%= file.id %>');"><%= file.description %></textarea>
|
||||
<%= form_tag(edit_file_description_org_subfield_file_path(file, :org_subfield_id => org_subfield.id ),:remote=>'true', :method => :post, :id=>"files_query_form_#{file.id}") do %>
|
||||
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 none " placeholder="请编辑资源描述" name="file_description_edit" id="file_description_edit_<%= file.id %>"
|
||||
onblur="commit_files_description('#files_query_form_<%= file.id %>');"><%= file.description %></textarea>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="fontGrey2 mb4">
|
||||
|
@ -108,3 +110,8 @@
|
|||
<%end%>
|
||||
<% end%>
|
||||
|
||||
<script>
|
||||
function commit_files_description(id) {
|
||||
$(id).submit();
|
||||
}
|
||||
</script>
|
|
@ -40,8 +40,10 @@
|
|||
<div id="file_description_show_<%= file.id %>" class="fontGrey2 mb4">
|
||||
<%= render :partial => 'files/file_description', :locals => {:file => file} %>
|
||||
</div>
|
||||
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 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>
|
||||
<%= form_tag(edit_file_description_project_file_path(file, :project_id => project.id),:remote=>'true', :method => :post, :id=>"files_query_form_#{file.id}") do %>
|
||||
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 none " placeholder="请编辑资源描述" name="file_description_edit" id="file_description_edit_<%= file.id %>"
|
||||
onblur="commit_files_description('#files_query_form_<%= file.id %>');"><%= file.description %></textarea>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="fontGrey2 mb4">
|
||||
|
@ -70,6 +72,11 @@
|
|||
<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true%>
|
||||
</ul>
|
||||
|
||||
<script>
|
||||
function commit_files_description(id) {
|
||||
$(id).submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -42,8 +42,10 @@
|
|||
<div id="file_description_show_<%= file.id %>" class="fontGrey2 mb4">
|
||||
<%= render :partial => 'files/file_description', :locals => {:file => file} %>
|
||||
</div>
|
||||
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 none " placeholder="请编辑资源描述" id="file_description_edit_<%= file.id %>"
|
||||
onblur="edit_file_description('<%= update_file_description_course_file_path(@course,file)%>','<%= file.id %>');"><%= file.description %></textarea>
|
||||
<%= form_tag(edit_file_description_course_file_path(file, :course_id => @course.id),:remote=>'true', :method => :post, :id=>"files_query_form_#{file.id}") do %>
|
||||
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 none " placeholder="请编辑资源描述" name="file_description_edit" id="file_description_edit_<%= file.id %>"
|
||||
onblur="commit_files_description('#files_query_form_<%= file.id %>');"><%= file.description %></textarea>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="fontGrey2 mb4">
|
||||
|
@ -99,4 +101,9 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="cl"></div>
|
||||
<script>
|
||||
function commit_files_description(id) {
|
||||
$(id).submit();
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
$("#file_description_show_<%= @attachment.id %>").html("<%= escape_javascript render(:partial => "files/file_description", :locals => {:file => @attachment}) %>");
|
||||
$("#file_description_show_<%= @attachment.id %>").show();
|
||||
$("#file_description_edit_<%= @attachment.id %>").hide();
|
|
@ -133,6 +133,7 @@ RedmineApp::Application.routes.draw do
|
|||
member do
|
||||
match "quote_resource_show_org_subfield", :via => [:get]
|
||||
get "update_file_description"
|
||||
post "edit_file_description"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -809,6 +810,7 @@ RedmineApp::Application.routes.draw do
|
|||
match "quote_resource_show", :via => [:get]
|
||||
get "file_hidden"
|
||||
get "update_file_description"
|
||||
post "edit_file_description"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1219,6 +1221,7 @@ RedmineApp::Application.routes.draw do
|
|||
get "file_hidden"
|
||||
post "republish_file"
|
||||
get "update_file_description"
|
||||
post "edit_file_description"
|
||||
end
|
||||
end
|
||||
resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do
|
||||
|
|
Loading…
Reference in New Issue