Merge branch 'hjq_beidou' into develop

This commit is contained in:
huang 2016-06-15 14:49:10 +08:00
commit d75a8bc35a
5 changed files with 17 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -39,6 +39,15 @@
<!--<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="closeModal();"><%#= l(:button_cancel)%></a>-->
<!--<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%#= l(:button_confirm)%></a>-->
</div>
<div class="cl"></div>
<div class="mb5 mt5">
<label class="fl c_dark f14" style="line-height:30px;">描述:</label>
<div class="fl">
<input type="text" name="description" class="InputBox fl W160" value="<%= @attachment.description %>">
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
<div class="uploadResourceIntr">
<div class="uploadResourceName fl"><span id="upload_file_count">(未选择文件)</span></div>
<div class="uploadResourceIntr2 fl">您可以上传小于<span class="c_red">50MB</span>的文件</div>

View File

@ -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? %>
<div class="resources mt10" id="container_files_<%= file.id %>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">

View File

@ -1,3 +1,4 @@
<div class="por_header_top">
<div class="por_header_con" >
<%= image_tag(url_to_avatar(@organization), width:"67", height: "61", :id => 'nh_user_tx', :class => "por_logo fl ", :target => "_blank") %>
@ -5,7 +6,7 @@
<div class="navHomepageProfile" id="navHomepageProfile">
<ul>
<li class="homepageProfileMenuIcon fr mt15" id="homepageProfileMenuIcon">
<%= link_to "<div class='user-img' id='user_avatar'>#{image_tag(url_to_avatar(User.current), :width =>"40", :height => "40", :class => "portraitRadius",:alt=>"头像", :id => "nh_user_logo")}</div>".html_safe, user_activities_path(User.current.id) %>
<%= link_to "<div class='user-img' id='user_avatar'>#{image_tag(url_to_avatar(User.current), :width =>"40", :height => "40", :class => "portraitRadius",:alt=>"头像", :id => "nh_user_logo")}</div>".html_safe, user_url_in_org(User.current.id) %>
<ul class="topnav_login_list none sn-f12" id="topnav_login_list" style="text-align:left;">
<li><%= link_to "修改资料", my_account_path, :class => "menuGrey"%></li>
<li><%= link_to "我的组织", user_organizations_user_path(:id => User.current.id), :class => "menuGrey"%></li>