Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop

This commit is contained in:
Tim 2016-09-09 13:27:53 +08:00
commit a88a36bd35
41 changed files with 2514 additions and 2431 deletions

View File

@ -50,10 +50,10 @@ gem 'elasticsearch-model'
gem 'elasticsearch-rails'
#rails 3.2.22.2 bug
gem "test-unit", "~>3.0"
# gem "test-unit", "~>3.0"
### profile
gem 'oneapm_rpm'
# gem 'oneapm_rpm'
group :development do
gem 'grape-swagger'

View File

@ -183,6 +183,7 @@ class IssuesController < ApplicationController
end
end
# 用户发布新issue
def create
call_hook(:controller_issues_new_before_save, { :params => params, :issue => @issue })
@issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads]))
@ -225,6 +226,7 @@ class IssuesController < ApplicationController
end
def edit
# 修改实例变量的值
return unless update_issue_from_params
respond_to do |format|
@ -233,6 +235,7 @@ class IssuesController < ApplicationController
end
end
# 用户编辑更改issue
def update
if params[:issue_detail]
issue = Issue.find(params[:id])
@ -240,6 +243,7 @@ class IssuesController < ApplicationController
@saved = update_user_issue_detail(issue, params)
return
else
# 修改实例变量的值
return unless update_issue_from_params
@issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads]))
saved = false
@ -575,6 +579,7 @@ class IssuesController < ApplicationController
@time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project)
@time_entry.attributes = params[:time_entry]
# 更新issue状态时journal表产生记录返回@current_journal
@issue.init_journal(User.current)
issue_attributes = params[:issue]

View File

@ -8,8 +8,21 @@ class OrgMemberController < ApplicationController
end
end
# 组织子成员,及其分页
def org_member_paging
@organization = Organization.find(params[:org])
if User.current.admin? || User.current.admin_of_org?(@organization)
@members = OrgMember.where(:organization_id => @organization.id).all.sort
@members = paginateHelper @members, 20
respond_to do |format|
format.js
end
end
end
def create
@org = Organization.find(params[:org])
@organization = Organization.find(params[:org])
if params[:membership].nil?
@fail_hint = l(:label_blank_user_lists_for_org)
else
@ -17,9 +30,11 @@ class OrgMemberController < ApplicationController
role_id = params[:orgRole]
member_ids.each do |user_id|
member = OrgMember.create(:user_id => user_id, :created_at => Time.now)
@org.org_members << member
@organization.org_members << member
OrgMemberRole.create(:org_member_id => member.id, :role_id => role_id)
end
@members = (@organization.org_members).sort
@members = paginateHelper @members, 20
end
respond_to do |format|
format.js
@ -32,7 +47,11 @@ class OrgMemberController < ApplicationController
@member_role = @member.org_member_roles[0]
@member_role.role_id = params[:org_member][:role_ids][0]
@member_role.save
@org = @member.organization
@organization = @member.organization
# 成员编辑角色后分页
@members = (@organization.org_members).sort
@members = paginateHelper @members, 20
respond_to do |format|
format.js
end
@ -44,8 +63,10 @@ class OrgMemberController < ApplicationController
def destroy
member = OrgMember.find(params[:id])
@org = member.organization
@organization = member.organization
member.destroy
@members = (@organization.org_members).sort
@members = paginateHelper @members, 20
respond_to do |format|
format.js
end

View File

@ -421,6 +421,8 @@ class OrganizationsController < ApplicationController
@organization = Organization.find(params[:id])
if User.current.admin? || User.current.admin_of_org?(@organization)
@members = OrgMember.where(:organization_id => @organization.id).all.sort
@members = paginateHelper @members, 20
else
render_403
end
@ -451,10 +453,11 @@ class OrganizationsController < ApplicationController
def members
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
@members = OrgMember.where("organization_id =?", @organization.id)
@members = OrgMember.where(:organization_id => @organization.id).all.sort
else
render_403
end
@members = paginateHelper @members, 20
end
def more_org_projects

View File

@ -580,6 +580,7 @@ class ProjectsController < ApplicationController
end
end
@members = paginateHelper @members
end
def update_message_status(user, project)

View File

@ -2677,7 +2677,8 @@ class UsersController < ApplicationController
project_ids.each do |project_id|
project = Project.find(project_id)
if project.news.map(&:id).exclude?(news.id)
message = Message.create(:board_id => project.boards.first.id, :subject => news.title, :content => news.description, :author_id => User.current.id)
# message = Message.create(:board_id => project.boards.first.id, :subject => news.title, :content => news.description, :author_id => User.current.id)
message = News.create(:project_id => project.id, :title => news.title, :summary => news.summary, :description => news.description, :author_id => User.current.id, :created_on => Time.now )
# record forward to table forwards if new record is valid
if message.valid?
news.forwards << Forward.new(:to_type => message.class.name, :to_id => message.id)
@ -3515,11 +3516,15 @@ class UsersController < ApplicationController
@order, @c_sort, @type, @list_type = 1, 2, 1, 1
#limit = 5
@my_projects = @user.projects.visible.where("projects.user_id = #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
# 用户的所有项目
# @my_projects = @user.projects.visible.where("projects.user_id = #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
@my_projects = @user.projects.where("projects.user_id = #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
@my_projects_count = @my_projects.count
@my_joined_projects = @user.projects.visible.where("projects.user_id != #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
#@my_joined_projects = @user.projects.visible.where("projects.user_id != #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
@my_joined_projects = @user.projects.where("projects.user_id != #{@user.id}").select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC")
@my_joined_projects_count = @my_joined_projects.count
respond_to do |format|
format.html {render :layout => 'new_base_user'}
end

View File

@ -1,5 +1,6 @@
module OrgMemberHelper
include ApplicationHelper
def find_user_not_in_current_org_by_name org
if params[:q] && params[:q].lstrip.rstrip != ""
scope = Principal.active.sorted.not_member_of_org(org).like(params[:q])

View File

@ -757,6 +757,7 @@ class Issue < ActiveRecord::Base
end
end
# 更新issue时判断更新之前当前是否有自动更新的评论
def init_journal(user, notes = "")
@current_journal ||= Journal.new(:journalized => self, :user => user, :notes => notes)
if new_record?
@ -1454,8 +1455,18 @@ class Issue < ActiveRecord::Base
end
# Callback on file attachment
# 在执行issue模块前 执行:当附件被添加时,产生评论
# 第一次创建issue时@current_journal为nil评论不产生
# 当附件名称重名时,也不产生评论
# 当更新isuue时第一次上传的附件的已经存在则不更新次附件评论
def attachment_added(obj)
if @current_journal && @current_journal.user_id == obj.author_id && JournalDetail.find_all_by_value(obj.filename).count == 0
# 找出该issue评论表中附件重名的个数
jor = Journal.where(:journalized_id => self.id)
jor_ids = jor.empty? ? "(-1)" : "(" + jor.map{|detail| detail.id}.join(",") + ")"
jor_details_count = JournalDetail.where("journal_id in #{jor_ids} and value = '#{obj.filename}'").count
if @current_journal && @current_journal.user_id == obj.author_id && jor_details_count == 0 && self.attachments.find_all_by_filename(obj.filename).count == 0
@current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :value => obj.filename)
end

View File

@ -74,7 +74,6 @@
});
function check_and_submit(doc){
$("#error").html('').hide();
check_forum_name();
if( $("textarea[name='forum[name]']").val().trim() == "" && $("textarea[name='forum[description]']").val().trim() != "" ){
$("#error").html("名称不能为空").show();
return;
@ -98,7 +97,6 @@
'<%= check_forum_name_forums_path %>',
{"forum_name":encodeURIComponent(name)},
function(data){
if( data == 'true'){
$("#error").html("贴吧名称已经存在").show();
check_pass = false;

View File

@ -78,5 +78,5 @@
<div class="cl"></div>
<%= call_hook(:view_issues_form_details_bottom, {:issue => @issue, :form => f}) %>
<% end %>
<a href="javascript:void(0);" onclick="issue_desc_editor.sync();$('#issue-form').submit();" class="blue_btn fl ml80"> 确定</a>
<a href="javascript:void(0);" onclick="issue_desc_editor.sync();$('#issue-form').submit();location.reload()" class="blue_btn fl ml80" id="issue_confirm"> 确定</a>
<a href="javascript:void(0);" onclick="issueDetailShow();" class="grey_btn fl mr50 ml10" > 取消 </a>

View File

@ -38,7 +38,7 @@
<a href ="javascript:void(0);" disabled="true"><%= image_tag(url_to_avatar(User.current),:width =>"40",:height => "40",:alt=>"头像", :id => "nh_user_logo", :class => "portraitRadius") %></a>
<ul class="topnav_login_list none" id="topnav_login_list">
<li>
<a href ="javascript:void(0);" class="menuGrey" disabled="true">修改资料</a>
<%= link_to "修改资料", my_account_path(:tip => 1), :class => "menuGrey"%>
</li>
<li>
<a href ="javascript:void(0);" class="menuGrey" disabled="true">我的组织</a>

View File

@ -90,7 +90,7 @@
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.name%></a><%= format_date(reply.created_at) %></div>
<div class="homepagePostReplyContent" id="activity_description_<%= reply.id %>"><%= h reply.content%></div>
<div class="homepagePostReplyContent" id="activity_description_<%= reply.id %>"><%= h reply.content.html_safe%></div>
</div>
<script type="text/javascript">
$(function(){

View File

@ -90,6 +90,7 @@
</li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">
<!-- 基本资料页面单位审核显示 -->
<% if User.current.user_extensions.nil? %>
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="" placeholder=" --请选择您所属的单位--"/>
@ -98,13 +99,14 @@
<span id="hint" style="color: #7f7f7f;display: none"><a id="school_num" href="javascript:void(0)" style="color: red" ></a><a id="search_condition" href="javascript:void(0)"></a></span>
</p>
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>-->
<!-- 从业者选择单位名称 -->
<% elsif User.current.user_extensions.identity == 3 || User.current.user_extensions.identity == 2 %>
<% if User.current.user_extensions.school_id.nil? %>
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text" placeholder="--请搜索您所在的高校(单位)--" >
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="<%= @user.user_extensions.occupation %>" />
<% else %>
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="province" style="display: none;" class="w210 fl" type="text"value="<%= User.current.user_extensions.school %>" >
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="<%= @user.user_extensions.occupation %>" />
<input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="<%= @user.user_extensions.school.id %>" /> <!-- 单位名称的test框选中下拉列表框的id -->
<% end %>
<p class="fl ml10">
<!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> -->
@ -605,12 +607,15 @@
});
});
// 基本资料页面提交表单时,判断身份与单位是否合法
function my_account_form_submit(){
if($("#userIdentity").val() == -1 ) {
$("#identity_hint").html('<span style="color:red">请选择身份</span>').show();
e.stopImmediatePropagation();
e.stopImmediatePropagation(); // 阻止事件冒泡
return;
}
// 单位或高校必须从下拉列表中选择
if( $("input[name='province']").val().trim() != '' && $("input[name='occupation']").val().trim() == ''){ //学校名字和id不对的话
$("#hint").html('<span style="color:red">单位名称必须是从下拉列表中选择的,不能手动修改</span>').show();
e.stopImmediatePropagation();

View File

@ -1,8 +1,9 @@
<% if @fail_hint %>
alert("<%= @fail_hint %>");
<% else %>
$("#org_member_list").html('<%= escape_javascript( render :partial=>"organizations/org_member_list",:locals=> {:members=>@org.org_members}) %>');
// 组织添加成员后,同步刷新成员列表,左侧成员数
$("#org_member_list").html('<%= escape_javascript( render :partial => "organizations/org_member_list", :locals => {:members => @members}) %>');
$("#principals_for_new_member").html('');
$("#org_members_count_id").html("<%= @org.org_members.count %>");
$("#org_members_count_id").html("<%= @organization.org_members.count %>");
$("#not_org_member_search").val("");
<% end %>

View File

@ -1,3 +1,4 @@
// 删除成员后,同步刷新成员列表与左侧成员显示数
$("#org_members_count_id").html("");
$("#org_members_count_id").html("<%= @org.org_members.count %>")
$("#org_member_list").html('<%= escape_javascript( render :partial=>"organizations/org_member_list",:locals=> {:members=>@org.org_members}) %>');
$("#org_members_count_id").html("<%= @organization.org_members.count %>");
$("#org_member_list").html('<%= escape_javascript( render :partial => "organizations/org_member_list", :locals=> {:members => @members}) %>');

View File

@ -1,3 +1,4 @@
// 组织成员删除后,同步刷新成员数和成员列表
$("#org_members_count_id").html("");
$("#org_members_count_id").html("<%= @org.org_members.count %>")
$("#org_member_list").html('<%= escape_javascript( render :partial=>"organizations/org_member_list",:locals=> {:members=>@org.org_members}) %>');
$("#org_members_count_id").html("<%= @organization.org_members.count %>");
$("#org_member_list").html('<%= escape_javascript( render :partial => "organizations/org_member_list", :locals => {:members => @members}) %>');

View File

@ -4,11 +4,11 @@
{
alert('翻页或搜索后将丢失当前选择的用户数据!');
}
<% if @flag == "true"%>
<%# if @flag == "true"%>
// $('#principals_for_new_member').html('<%#= escape_javascript(find_user_not_in_current_org_by_name(@org)) %>');
<%# else%>
$('#principals_for_new_member').html('<%= escape_javascript(find_user_not_in_current_org_by_name(@org)) %>');
<% else%>
$('#principals_for_new_member').html('<%= escape_javascript(find_user_not_in_current_org_by_name(@org)) %>');
<% end%>
<%# end%>
<% end %>
var collection = $("#principals_for_new_member").children("#principals").children("label");

View File

@ -0,0 +1,4 @@
<% if @organization %>
// 局部更新组织页面子模块 id = org_member_list
$('#org_member_list').html("<%= escape_javascript(render :partial => 'organizations/org_member_list', :locals => {:members => @members}) %>");
<% end %>

View File

@ -1 +1,2 @@
$("#org_member_list").html('<%= escape_javascript( render :partial=>"organizations/org_member_list",:locals=> {:members=>@org.org_members}) %>');
// 编辑成员列表角色后,刷新成员列表
$("#org_member_list").html('<%= escape_javascript( render :partial => "organizations/org_member_list",:locals => {:members => @members}) %>');

View File

@ -103,22 +103,20 @@
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
<% end %>
<% else %>
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
<!-- link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" -->
<a href = "javascript:void(0);" class = "homepageMenuText" onclick = "$('#PostDomain_<%= field.id %>').slideToggle();"><%= field.name %></a>
<% end %>
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子" %>
<% end %>
</div>
<div class="<%= (field.sub_domains.count == 0) ? 'homepageLeftMenuCourses':'homepageLeftMenuCourses borderBottomNone' %>" id="PostDomain_<%= field.id %>" style="display:none;">
<div class="homepageLeftMenuCourses" id="PostDomain_<%= field.id %>" style="display:<%= field.sub_domains.count == 0 ? 'none' : '' %>">
<ul>
<%= render :partial => 'organizations/org_subdomain',:locals => {:subdomains => field.sub_domains.reorder('priority').uniq, :org_subfield_id => field.id} %>
</ul>
</div>
<% unless (field.sub_domains.count == 0 || !if_hidden_subdomain(field)) %>
<li class="homepageLeftMenuMore" id="sub_domain_jiantou_<%= field %>">
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="$('#PostDomain_<%= field.id %>').slideToggle();" style="border-bottom: 1px solid #ddd;"></a>
</li>
<% end %>
<% elsif field.field_type == "Comptec" %>
<div class="homepageLeftMenuBlock">
<%= link_to "#{field.name}", teachers_organization_path(organization, :org_subfield_id => field.id, :type => "#{User.current.admin? ? "" : "famous"}"), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>

View File

@ -34,8 +34,15 @@
<% if ( (User.current.id == member.organization.creator_id || User.current.admin_of_org?(member.organization) ) && member.user_id != member.organization.creator_id )%>
<a href="javascript:void(0);" style="color: #0781B4;margin-left: 10px;float: left" onclick="$(this).parent().height();$('#org-member-<%= member.id%>-roles-form').show();">编辑</a>
<a href="javascript:void(0)" style = "color: #0781B4;margin-left: 10px;float: left" onclick = "ifDeleteOrgMember('<%= member.id %>','<%= username %>')" >删除</a>
<%#= link_to '删除', Setting.protocol + "://" + Setting.host_name + "/org_member/" + member.id.to_s,:method=>'delete',:style=>'color: #0781B4;margin-left: 30px;float: left',:confirm=>'您确定要删除么?', :remote => true %><% end %>
<%#= link_to '删除', Setting.protocol + "://" + Setting.host_name + "/org_member/" + member.id.to_s,:method=>'delete',:style=>'color: #0781B4;margin-left: 30px;float: left',:confirm=>'您确定要删除么?', :remote => true %>
<% end %>
<div class="cl"></div>
</ul>
<div class="cl"></div>
<% end %>
<ul class="wlist">
<!-- 组织配置页面,成员子页面单独分页 -->
<%= pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){ |text, parameters, options|
link_to text, org_member_paging_org_member_index_path( parameters.merge(:flag => true, :org => @organization.id, :format => 'js')), :remote => true
} %>
</ul>

View File

@ -24,7 +24,7 @@
<% end%>
<ul class="wlist">
<%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true %>
</ul>
<div class="cl"></div>
</div>

View File

@ -1,6 +1,6 @@
<% if !@org_name.blank? %>
<%if @check == false %>
$checkName = false
$checkName = false;
<% if @config_page %>
$("#check_name_hint").html('<span class="c_red">名字不能重复<span>').show();
<% else%>

View File

@ -4,9 +4,11 @@
//如果有N个标签,就将i<=N;
for(var i=1;i<=3;i++){
g('orgSetting_'+i).className='orgSettingOp';
g('orgContent_'+i).className='undis';}
g('orgContent_'+i).className='undis';
}
g('orgContent_'+n).className='dis ml15 mr15';
g('orgSetting_'+n).className='orgSettingOp orgOpActive';}
g('orgSetting_'+n).className='orgSettingOp orgOpActive';
}
//如果要做成点击后再转到请将<li>中的onmouseover 改成 onclick;
//]]>
$checkName = true;
@ -105,7 +107,7 @@
<div class="cl"></div>
</ul>
<div id="org_member_list">
<%= render :partial=>"org_member_list",:locals=> {:members=>@organization.org_members} %>
<%= render :partial => "org_member_list", :locals => {:members => @members} %>
</div>
</div>
<div class="fl ml10 orgMemContainer">
@ -178,6 +180,7 @@
<%= render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)} %>
</div>
</div>
</div>
<script>
function add_org_subfield(){
@ -246,3 +249,4 @@
});
}
</script>

View File

@ -7,7 +7,7 @@
<%= render :partial => 'users/show_detail_info', :locals => {:user => user} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word">
<div class="homepagePostTo break_word" style="width:620px">
<% if user.try(:realname) == ' ' %>
<%= link_to user, user_path(user), :class => "newsBlue mr15" %>
<% else %>

View File

@ -25,3 +25,6 @@
<div class="cl"></div>
</div>
</div>

View File

@ -5,7 +5,7 @@
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word">
<div class="homepagePostTo break_word" style="width:620px">
<%= link_to activity.author.show_name, user_path(activity.author_id), :class => "newsBlue mr15" %>
TO
<%= link_to activity.project.name.to_s+" | 项目新闻", project_news_index_path(activity.project), :class => "newsBlue ml15" %>

View File

@ -5,7 +5,7 @@
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word">
<div class="homepagePostTo break_word" style="width:620px">
<% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %>

View File

@ -5,7 +5,7 @@
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word">
<div class="homepagePostTo break_word" style="width:620px">
<% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %>

View File

@ -1,17 +1,23 @@
<div class="syllabus_category">
<% unless projects.empty? %>
<% if @type.to_i == 2 %>
<%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :style => "margin-right: 5px;", :remote => true %>
<%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id => @user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 },
:class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :style => "margin-right: 5px;", :remote => true %>
<% else %>
<%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortdownbtn sort_no fr", :style => "margin-right: 5px;", :remote => true %>
<%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id => @user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 },
:class => "sortdownbtn sort_no fr", :style => "margin-right: 5px;", :remote => true %>
<% end %>
<%= link_to "人气", {:controller => 'users', :action => 'sort_project_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortTxt fr", :remote => true %>
<%= link_to "人气", {:controller => 'users', :action => 'sort_project_list', :id => @user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 },
:class => "sortTxt fr", :remote => true %>
<% if @type.to_i == 1 %>
<%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :remote => true %>
<%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id => @user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 },
:class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :remote => true %>
<% else %>
<%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortdownbtn sort_no fr", :remote => true %>
<%= link_to "", {:controller => 'users', :action => 'sort_project_list', :id => @user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 },
:class => "sortdownbtn sort_no fr", :remote => true %>
<% end %>
<%= link_to "时间", {:controller => 'users', :action => 'sort_project_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt fr", :remote => true %>
<%= link_to "时间", {:controller => 'users', :action => 'sort_project_list', :id => @user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 },
:class => "sortTxt fr", :remote => true %>
<% end %>
<span class="grayTxt fl "><%= @user == User.current ? "我" : "他" %><%= list_type == 1 ? "创建" : "参与"%>的项目</span>
<div class="cl"></div>
@ -31,11 +37,13 @@
<% else %>
<% projects.each_with_index do |project, i| %>
<div class="syllabus_courses_list <%= i > 4 ? 'none' : ''%>" style="cursor: default;">
<% allow_visit = User.current.member_of?(project) || User.current.admin? || project.is_public == 1 %>
<div class="sy_courses_open">
<span id="collect_project_icon_<%= project.id %>">
<%=render :partial => 'collect_project', :locals => {:project => project} %>
</span>
<h3><%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%></h3>
<h3><%= link_to project.name, allow_visit ? project_path(project.id,:host=>Setting.host_name) : 'javascript:void(0)', :target => '_blank',
:class => "new_project_title fl",:id => "show_project_#{project.id}", :title => (allow_visit ? "#{project.name}" : "私有项目不可访问") %></h3>
<% unless project.is_public? %>
<span class="syllabus_class_private fl ml10 mt3 syllabus_class_property">私有</span>
<% end %>
@ -58,7 +66,8 @@
<% end %>
<% if count > 5 %>
<div class="syllabus_courses_list">
<p class="new_projectlist_more"><a id="project_more_<%=list_type %>" href="javascript:void(0);" data-count="<%= count %>" data-init="0" onclick="expand_projects('#project_more_<%=list_type %>', '#project_li_<%=list_type %>', <%=count%>);">共<%=count %>个项目,点击全部展开</a></p>
<p class="new_projectlist_more"><a id="project_more_<%=list_type %>" href="javascript:void(0);" data-count="<%= count %>" data-init="0" onclick="expand_projects('#project_more_<%=list_type %>',
'#project_li_<%=list_type %>', <%=count%>);">共<%=count %>个项目,点击全部展开</a></p>
</div>
<% end %>
<% end %>

View File

@ -5,7 +5,7 @@
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word">
<div class="homepagePostTo break_word" style="width:620px">
<%= link_to activity.author.show_name, user_path(activity.author_id), :class => "newsBlue mr15" %>
TO
<%= link_to activity.project.name.to_s+" | 项目讨论区",project_boards_path(activity.project), :class => "newsBlue ml15 mr5"%>

View File

@ -31,6 +31,6 @@ button:
name: "联系我们"
key: "FEEDBACK"
-
type: "click"
name: "解除绑定"
key: "UNBIND"
type: "view"
name: "个人资料"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=edit_userinfo#wechat_redirect"

View File

@ -116,6 +116,7 @@ RedmineApp::Application.routes.draw do
end
collection do
get 'org_member_autocomplete'
get 'org_member_paging'
get 'deleteOrgMember'
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20160905084821) do
ActiveRecord::Schema.define(:version => 20160907080621) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -56,8 +56,8 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
t.integer "user_id"
t.integer "applied_id"
t.string "applied_type"
t.integer "viewed", :default => 0
t.integer "status", :default => 0
t.integer "viewed"
t.integer "status"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "name"
@ -173,6 +173,7 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
t.integer "quotes"
t.integer "is_publish", :default => 1
t.date "publish_time"
t.boolean "init_file", :default => false
end
add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id"
@ -318,6 +319,8 @@ ActiveRecord::Schema.define(:version => 20160905084821) do
t.date "commit_date"
t.string "scmid"
t.integer "user_id"
t.integer "project_id"
t.integer "type", :default => 0
end
add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on"

View File

@ -550,8 +550,8 @@ function observeSearchfield(fieldId, targetId, url) {
dataType: 'jsonp',
data: {q: $this.val()},
success: function(data){ if(targetId) $('#'+targetId).html(data); },
beforeSend: function(){ $this.addClass('ajax-loading'); },
complete: function(){ $this.removeClass('ajax-loading'); }
beforeSend: function(){ $this.addClass('ajax-loading'); }, // 添加成员加载完成前,显示载入中
complete: function(){ $this.removeClass('ajax-loading'); } // 完成后,移除
});
}
};

View File

@ -1,4 +1,5 @@
//<2F><><EFBFBD><EFBFBD><EFBFBD>֯<EFBFBD><D6AF>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><E1BDBB><EFBFBD><EFBFBD>
// 组织:新增成员
function submit_add_org_members(){
$("#org_member_add_form").submit();
}

View File

@ -21,7 +21,6 @@ app.controller('EditUserInfoController', ['$scope', 'config','$http', 'auth','$l
vm.lastname = vm.user.lastname;
vm.mail = vm.user.mail;
vm.sex = vm.user.gender;
vm.user.img_url = vm.user.img_url +"?t="+Math.random();
}
);
};