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 @@ +
+
+ +
+ +
+
+
+
(未选择文件)
您可以上传小于50MB的文件
diff --git a/app/views/files/_org_subfield_list.html.erb b/app/views/files/_org_subfield_list.html.erb index 66b68e895..a3337b1ce 100644 --- a/app/views/files/_org_subfield_list.html.erb +++ b/app/views/files/_org_subfield_list.html.erb @@ -1,7 +1,7 @@ <% delete_allowed = User.current.admin? %> <% org_subfield_attachments.each do |file| %> - <% if file.is_public == 1 or User.current.member_of_org?(file.container.organization) %> + <% if file.is_public == 1 or User.current.member_of_org?(file.container.organization) || User.current.admin? %>
diff --git a/app/views/forums/create.js.erb b/app/views/forums/create.js.erb index aae5122e4..88e535e72 100644 --- a/app/views/forums/create.js.erb +++ b/app/views/forums/create.js.erb @@ -1,7 +1,6 @@ <%if @save_flag%> -//$('#new_forum_div').slideToggle();$('#create_btn').parent().slideToggle(); -//$('#reorder_time').click(); - window.location.href= "http://"+"<%= Setting.host_name%>"+"/forums/" + "<%= @forum.id%>" +$('#new_forum_div').slideToggle();$('#create_btn').parent().slideToggle(); +$('#reorder_time').click(); <%else%> - $("#error").html("<%= @forum.errors.full_messages[0]%>").show(); +$("#error").html("<%= @forum.errors.full_messages[0]%>").show(); <%end %> \ No newline at end of file diff --git a/app/views/org_subfields/create.js.erb b/app/views/org_subfields/create.js.erb index a65f53719..952ed7b2c 100644 --- a/app/views/org_subfields/create.js.erb +++ b/app/views/org_subfields/create.js.erb @@ -4,8 +4,6 @@ $("#sub_field_left_lists").html(""); $("#sub_field_left_lists").html("<%= escape_javascript(render :partial => 'organizations/org_left_subfield_list', :locals => {:organization => @organization}) %>"); $("#org_custom_admin").html("<%= escape_javascript(render :partial => 'organizations/org_custom_admin') %>"); - //默认选中第一个 - $("input[name='field_type']").get(0).checked=true; <% end %> $("#subfield_name").val(""); $("#sub_dir").val(""); \ No newline at end of file diff --git a/app/views/organizations/_org_custom_header.html.erb b/app/views/organizations/_org_custom_header.html.erb index 91ca5aafb..c7aca1e6a 100644 --- a/app/views/organizations/_org_custom_header.html.erb +++ b/app/views/organizations/_org_custom_header.html.erb @@ -1,3 +1,4 @@ +
<%= image_tag(url_to_avatar(@organization), width:"67", height: "61", :id => 'nh_user_tx', :class => "por_logo fl ", :target => "_blank") %> @@ -5,7 +6,7 @@