Merge branch 'develop' into yuanke

This commit is contained in:
yuanke 2016-06-15 17:18:27 +08:00
commit 000d33bf0d
8 changed files with 22 additions and 12 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

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

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,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 %>

View File

@ -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("");

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>