diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index fe3c3272a..960bc61e6 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -265,6 +265,10 @@ class AttachmentsController < ApplicationController @history.save #历史记录保存完毕 #将最新保存的记录 数据替换到 需要修改的文件记录 @old_attachment.attributes = @attachment.attributes.dup.except("id","container_id","container_type","is_public","downloads", "quotes") + # 如果附件描述被修改,则保存附件 + unless params[:description] == @attachment.description + @old_attachment.description = params[:description] + end @old_attachment.save #删除当前记录 @attachment.delete diff --git a/app/controllers/org_subfields_controller.rb b/app/controllers/org_subfields_controller.rb index 734e8a719..34e996494 100644 --- a/app/controllers/org_subfields_controller.rb +++ b/app/controllers/org_subfields_controller.rb @@ -14,10 +14,9 @@ class OrgSubfieldsController < ApplicationController SubfieldSubdomainDir.create(:org_subfield_id => @subfield.id, :name => params[:sub_dir].downcase) end end - #默认类型为帖子 - @subfield.update_attributes(:field_type => params[:field_type]||"Post") + @subfield.update_attributes(:field_type => params[:field_type]) # admin配置的类型 - update_status_by_type(@subfield, params[:field_type]||"Post") + update_status_by_type(@subfield, params[:field_type]) else @res = false end diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 857f98afc..9e785c562 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -360,7 +360,7 @@ update # ip = RepositoriesHelper::REPO_IP_ADDRESS gitlab_address = Redmine::Configuration['gitlab_address'] # REDO:需优化,仅测试用 - @zip_path = gitlab_address.to_s + "/api/v3/projects/" + @project.gpid.to_s + "/repository/archive?&private_token=YTyCv4978MXmdL2B9C62" + @zip_path = Gitlab.endpoint.to_s + "/projects/" + @project.gpid.to_s + "/repository/archive?&private_token=" + Gitlab.private_token if @repository.type.to_s == "Repository::Gitlab" @repos_url = gitlab_address.to_s+"/"+@project.owner.to_s+"/"+@repository.identifier+"."+"git" else diff --git a/app/views/attachments/_show_attachment_history.html.erb b/app/views/attachments/_show_attachment_history.html.erb index fb2afd308..6e2994a8d 100644 --- a/app/views/attachments/_show_attachment_history.html.erb +++ b/app/views/attachments/_show_attachment_history.html.erb @@ -39,6 +39,15 @@ +
+