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' gem 'elasticsearch-rails'
#rails 3.2.22.2 bug #rails 3.2.22.2 bug
gem "test-unit", "~>3.0" # gem "test-unit", "~>3.0"
### profile ### profile
gem 'oneapm_rpm' # gem 'oneapm_rpm'
group :development do group :development do
gem 'grape-swagger' gem 'grape-swagger'

View File

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

View File

@ -8,18 +8,33 @@ class OrgMemberController < ApplicationController
end end
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 def create
@org = Organization.find(params[:org]) @organization = Organization.find(params[:org])
if params[:membership].nil? if params[:membership].nil?
@fail_hint = l(:label_blank_user_lists_for_org) @fail_hint = l(:label_blank_user_lists_for_org)
else else
member_ids = params[:membership][:user_ids] member_ids = params[:membership][:user_ids]
role_id = params[:orgRole] role_id = params[:orgRole]
member_ids.each do |user_id| member_ids.each do |user_id|
member = OrgMember.create(:user_id=>user_id, :created_at => Time.now) 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) OrgMemberRole.create(:org_member_id => member.id, :role_id => role_id)
end end
@members = (@organization.org_members).sort
@members = paginateHelper @members, 20
end end
respond_to do |format| respond_to do |format|
format.js format.js
@ -32,7 +47,11 @@ class OrgMemberController < ApplicationController
@member_role = @member.org_member_roles[0] @member_role = @member.org_member_roles[0]
@member_role.role_id = params[:org_member][:role_ids][0] @member_role.role_id = params[:org_member][:role_ids][0]
@member_role.save @member_role.save
@org = @member.organization @organization = @member.organization
# 成员编辑角色后分页
@members = (@organization.org_members).sort
@members = paginateHelper @members, 20
respond_to do |format| respond_to do |format|
format.js format.js
end end
@ -44,8 +63,10 @@ class OrgMemberController < ApplicationController
def destroy def destroy
member = OrgMember.find(params[:id]) member = OrgMember.find(params[:id])
@org = member.organization @organization = member.organization
member.destroy member.destroy
@members = (@organization.org_members).sort
@members = paginateHelper @members, 20
respond_to do |format| respond_to do |format|
format.js format.js
end end

View File

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

View File

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

View File

@ -2677,7 +2677,8 @@ class UsersController < ApplicationController
project_ids.each do |project_id| project_ids.each do |project_id|
project = Project.find(project_id) project = Project.find(project_id)
if project.news.map(&:id).exclude?(news.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 # record forward to table forwards if new record is valid
if message.valid? if message.valid?
news.forwards << Forward.new(:to_type => message.class.name, :to_id => message.id) 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 @order, @c_sort, @type, @list_type = 1, 2, 1, 1
#limit = 5 #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_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 @my_joined_projects_count = @my_joined_projects.count
respond_to do |format| respond_to do |format|
format.html {render :layout => 'new_base_user'} format.html {render :layout => 'new_base_user'}
end end

View File

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

View File

@ -757,6 +757,7 @@ class Issue < ActiveRecord::Base
end end
end end
# 更新issue时判断更新之前当前是否有自动更新的评论
def init_journal(user, notes = "") def init_journal(user, notes = "")
@current_journal ||= Journal.new(:journalized => self, :user => user, :notes => notes) @current_journal ||= Journal.new(:journalized => self, :user => user, :notes => notes)
if new_record? if new_record?
@ -1454,8 +1455,18 @@ class Issue < ActiveRecord::Base
end end
# Callback on file attachment # Callback on file attachment
# 在执行issue模块前 执行:当附件被添加时,产生评论
# 第一次创建issue时@current_journal为nil评论不产生
# 当附件名称重名时,也不产生评论
# 当更新isuue时第一次上传的附件的已经存在则不更新次附件评论
def attachment_added(obj) 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) @current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :value => obj.filename)
end end

View File

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

View File

@ -78,5 +78,5 @@
<div class="cl"></div> <div class="cl"></div>
<%= call_hook(:view_issues_form_details_bottom, {:issue => @issue, :form => f}) %> <%= call_hook(:view_issues_form_details_bottom, {:issue => @issue, :form => f}) %>
<% end %> <% 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> <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> <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"> <ul class="topnav_login_list none" id="topnav_login_list">
<li> <li>
<a href ="javascript:void(0);" class="menuGrey" disabled="true">修改资料</a> <%= link_to "修改资料", my_account_path(:tip => 1), :class => "menuGrey"%>
</li> </li>
<li> <li>
<a href ="javascript:void(0);" class="menuGrey" disabled="true">我的组织</a> <a href ="javascript:void(0);" class="menuGrey" disabled="true">我的组织</a>
@ -48,7 +48,7 @@
</li> </li>
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>--> <!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
<li> <li>
<%= link_to "退出",logout_url_without_domain,:class => "menuGrey",:method => "post"%> <%= link_to "退出", logout_url_without_domain, :class => "menuGrey", :method => "post"%>
</li> </li>
</ul> </ul>
</li> </li>

View File

@ -103,7 +103,7 @@
<div class="homepageLeft mt10" id="LSide"> <div class="homepageLeft mt10" id="LSide">
<div class="user_leftinfo mb10"> <div class="user_leftinfo mb10">
<% if User.current.logged?%> <% if User.current.logged?%>
<a href ="javascript:void(0);" disabled="true" class="user_leftinfo_img"><%= image_tag(url_to_avatar(@user),width:"74", height: "74", :id=>'nh_user_tx')%></a> <a href ="javascript:void(0);" disabled="true" class="user_leftinfo_img"><%= image_tag(url_to_avatar(@user), width:"74", height: "74", :id=>'nh_user_tx')%></a>
<% else %> <% else %>
<img src="images/user/male.jpg" width="74" height="74" /> <img src="images/user/male.jpg" width="74" height="74" />
<% end %> <% end %>
@ -112,7 +112,7 @@
<% end %> <% end %>
<div class="user_info_inner"> <div class="user_info_inner">
<div class=" user_leftinfo_namebox" > <div class=" user_leftinfo_namebox" >
<a href="javascript:void(0);" class="user_leftinfo_name"><%=@user.show_name %></a> <a href="javascript:void(0);" class="user_leftinfo_name"><%= @user.show_name %></a>
<% if @user.user_extensions && @user.user_extensions.identity %> <% if @user.user_extensions && @user.user_extensions.identity %>
<span class="user_cirbtn_yellow" ><%= get_user_roll @user %></span> <span class="user_cirbtn_yellow" ><%= get_user_roll @user %></span>
<% end%> <% end%>
@ -123,7 +123,7 @@
<%= render :partial => 'layouts/user_brief_introduction', :locals => {:user => @user} %> <%= render :partial => 'layouts/user_brief_introduction', :locals => {:user => @user} %>
</div> </div>
</div> </div>
<textarea class="homepageSignatureTextarea none" placeholder="请编辑签名" id="user_brief_introduction_edit" onblur="edit_user_introduction('<%= edit_brief_introduction_user_path(@user.id)%>');"><%= @user.user_extensions.brief_introduction %></textarea> <textarea class="homepageSignatureTextarea none" placeholder="请编辑签名" id="user_brief_introduction_edit" onblur="edit_user_introduction('<%= edit_brief_introduction_user_path(@user.id) %>');"><%= @user.user_extensions.brief_introduction %></textarea>
</div> </div>
<ul class="user_atten clear"> <ul class="user_atten clear">
<li> <li>

View File

@ -90,7 +90,7 @@
</div> </div>
<div class="homepagePostReplyDes"> <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="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> </div>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){

View File

@ -70,15 +70,15 @@
</select> </select>
<span nhname="tag" nh_tag_1="true" style='display:none;'> <span nhname="tag" nh_tag_1="true" style='display:none;'>
<% if !User.current.user_extensions.nil? && !User.current.user_extensions.student_id.nil? %> <% if !User.current.user_extensions.nil? && !User.current.user_extensions.student_id.nil? %>
<%= text_field_tag :no, User.current.user_extensions.student_id, :placeholder => l(:label_account_identity_studentID),:style=>"width:127px;" %> <%= text_field_tag :no, User.current.user_extensions.student_id, :placeholder => l(:label_account_identity_studentID),:style => "width:127px;" %>
<% else %> <% else %>
<%= text_field_tag :no, nil, :placeholder => l(:label_account_identity_studentID),:style=>"60px" %></span> <%= text_field_tag :no, nil, :placeholder => l(:label_account_identity_studentID), :style => "60px" %></span>
<% end %> <% end %>
</span> </span>
<span id="identity_hint" style="display: none"></span> <span id="identity_hint" style="display: none"></span>
</li> </li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><%= text_field_tag :lastname,@user.lastname+@user.firstname,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210" %><span id="last_name_notice" class="none c_red">姓名不能为空</span> <li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><%= text_field_tag :lastname, @user.lastname+@user.firstname, :no_label => true, :required => true, :nh_required => "1",:class => "w210" %><span id="last_name_notice" class="none c_red">姓名不能为空</span>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"> <li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">
<% if User.current.user_extensions && User.current.user_extensions.gender && User.current.user_extensions.gender == 1 %> <% if User.current.user_extensions && User.current.user_extensions.gender && User.current.user_extensions.gender == 1 %>
@ -90,6 +90,7 @@
</li> </li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"> <li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">
<!-- 基本资料页面单位审核显示 -->
<% if User.current.user_extensions.nil? %> <% 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" 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=" --请选择您所属的单位--"/> <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> <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> </p>
<!--<input nhname="tag" nh_tag_0="true" nh_tag_1="true" id="occupation_name" type="text" style="display: none;width:117px;" readonly/>--> <!--<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 %> <% elsif User.current.user_extensions.identity == 3 || User.current.user_extensions.identity == 2 %>
<% if User.current.user_extensions.school_id.nil? %> <% 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" 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 %>" /> <input nhname="tag" nh_tag_4="true" id="occupation" name="occupation" style="display: none;" class="w210" type="text" value="<%= @user.user_extensions.occupation %>" />
<% else %> <% 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" 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 %> <% end %>
<p class="fl ml10"> <p class="fl ml10">
<!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> --> <!-- <span id="errortip" class="icons_warning fl mt5" style="display: none;"></span> -->
@ -605,12 +607,15 @@
}); });
}); });
// 基本资料页面提交表单时,判断身份与单位是否合法
function my_account_form_submit(){ function my_account_form_submit(){
if($("#userIdentity").val() == -1 ) { if($("#userIdentity").val() == -1 ) {
$("#identity_hint").html('<span style="color:red">请选择身份</span>').show(); $("#identity_hint").html('<span style="color:red">请选择身份</span>').show();
e.stopImmediatePropagation(); e.stopImmediatePropagation(); // 阻止事件冒泡
return; return;
} }
// 单位或高校必须从下拉列表中选择
if( $("input[name='province']").val().trim() != '' && $("input[name='occupation']").val().trim() == ''){ //学校名字和id不对的话 if( $("input[name='province']").val().trim() != '' && $("input[name='occupation']").val().trim() == ''){ //学校名字和id不对的话
$("#hint").html('<span style="color:red">单位名称必须是从下拉列表中选择的,不能手动修改</span>').show(); $("#hint").html('<span style="color:red">单位名称必须是从下拉列表中选择的,不能手动修改</span>').show();
e.stopImmediatePropagation(); e.stopImmediatePropagation();

View File

@ -1,8 +1,9 @@
<% if @fail_hint %> <% if @fail_hint %>
alert("<%= @fail_hint %>"); alert("<%= @fail_hint %>");
<% else %> <% 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(''); $("#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(""); $("#not_org_member_search").val("");
<% end %> <% end %>

View File

@ -1,3 +1,4 @@
// 删除成员后,同步刷新成员列表与左侧成员显示数
$("#org_members_count_id").html(""); $("#org_members_count_id").html("");
$("#org_members_count_id").html("<%= @org.org_members.count %>") $("#org_members_count_id").html("<%= @organization.org_members.count %>");
$("#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

@ -1,3 +1,4 @@
// 组织成员删除后,同步刷新成员数和成员列表
$("#org_members_count_id").html(""); $("#org_members_count_id").html("");
$("#org_members_count_id").html("<%= @org.org_members.count %>") $("#org_members_count_id").html("<%= @organization.org_members.count %>");
$("#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

@ -1,23 +1,23 @@
<% if @org%> <% if @org %>
var checked = $("#principals_for_new_member input:checked").size(); var checked = $("#principals_for_new_member input:checked").size();
if(checked > 0) if(checked > 0)
{ {
alert('翻页或搜索后将丢失当前选择的用户数据!'); 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)) %>'); $('#principals_for_new_member').html('<%= escape_javascript(find_user_not_in_current_org_by_name(@org)) %>');
<% else%> <%# end%>
$('#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"); var collection = $("#principals_for_new_member").children("#principals").children("label");
collection.css("text-overflow","ellipsis"); collection.css("text-overflow", "ellipsis");
collection.css("white-space","nowrap"); collection.css("white-space", "nowrap");
collection.css("width","200px"); collection.css("width", "200px");
collection.css("overflow","hidden"); collection.css("overflow", "hidden");
for(i=0;i<collection.length;i++){ //增加悬浮显示 for(i = 0; i < collection.length; i++){ //增加悬浮显示
var label=collection[i]; var label = collection[i];
var text=$(label).text(); var text = $(label).text();
$(label).attr("title",text); $(label).attr("title", text);
} }

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();" %> <%= 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 %> <% end %>
<% else %> <% 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 %> <% end %>
<% if User.current.logged? and User.current.admin_of_org?(organization) %> <% 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 => "发布帖子" %> <%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子" %>
<% end %> <% end %>
</div> </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> <ul>
<%= render :partial => 'organizations/org_subdomain',:locals=>{:subdomains => field.sub_domains.reorder('priority').uniq, :org_subfield_id => field.id} %> <%= render :partial => 'organizations/org_subdomain',:locals => {:subdomains => field.sub_domains.reorder('priority').uniq, :org_subfield_id => field.id} %>
</ul> </ul>
</div> </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" %> <% elsif field.field_type == "Comptec" %>
<div class="homepageLeftMenuBlock"> <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();" %> <%= 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

@ -22,10 +22,10 @@
<% end %> <% end %>
<%= hidden_field_tag 'membership[role_ids][]', '' %> <%= hidden_field_tag 'membership[role_ids][]', '' %>
<div class="pt5"> <div class="pt5">
<a href="javascript:void(0)" class="org_member_btn" onclick="$('#org-member-<%= member.id%>-roles-form').submit();" style="margin-right: 10px;"> <a href="javascript:void(0)" class="org_member_btn" onclick = "$('#org-member-<%= member.id%>-roles-form').submit();" style="margin-right: 10px;">
<%= l(:button_change)%> <%= l(:button_change)%>
</a> </a>
<a href="javascript:void(0)" class="org_member_btn" onclick="$('#org-member-<%= member.id%>-roles-form').hide();$(this).parent().parent().parent().parent().height(18)"> <a href="javascript:void(0)" class="org_member_btn" onclick = "$('#org-member-<%= member.id%>-roles-form').hide();$(this).parent().parent().parent().parent().height(18)">
<%= l(:button_cancel)%> <%= l(:button_cancel)%>
</a> </a>
</div> </div>
@ -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 )%> <% 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="$(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> <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> <div class="cl"></div>
</ul> </ul>
<div class="cl"></div> <div class="cl"></div>
<% end %> <% 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%> <% end%>
<ul class="wlist"> <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> </ul>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

View File

@ -4,7 +4,7 @@
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %> <%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_url_in_org(activity.author_id), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div> </div>
<div class="homepagePostDes"> <div class="homepagePostDes" >
<div class="homepagePostTo break_word"> <div class="homepagePostTo break_word">
<% if activity.try(:author).try(:realname) == ' ' %> <% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %> <%= link_to activity.try(:author), user_url_in_org(activity.author_id), :class => "newsBlue mr15" %>

View File

@ -1,7 +1,7 @@
<% if !@org_name.blank? %> <% if !@org_name.blank? %>
<%if @check == false %> <%if @check == false %>
$checkName = false $checkName = false;
<% if @config_page%> <% if @config_page %>
$("#check_name_hint").html('<span class="c_red">名字不能重复<span>').show(); $("#check_name_hint").html('<span class="c_red">名字不能重复<span>').show();
<% else%> <% else%>
$("#organization_name_notice").html('<span class="c_red">名字不能重复<span>').show(); $("#organization_name_notice").html('<span class="c_red">名字不能重复<span>').show();
@ -10,7 +10,7 @@
<% else %> <% else %>
$checkName = true; $checkName = true;
<% if @config_page%> <% if @config_page %>
$("#check_name_hint").html('<span class="c_green">名字可以使用</span>').show(); $("#check_name_hint").html('<span class="c_green">名字可以使用</span>').show();
<% else%> <% else%>

View File

@ -1,12 +1,14 @@
<script> <script>
function g(o){return document.getElementById(o);} function g(o){return document.getElementById(o);}
function HoverLi(n){ function HoverLi(n){
//如果有N个标签,就将i<=N; //如果有N个标签,就将i<=N;
for(var i=1;i<=3;i++){ for(var i=1;i<=3;i++){
g('orgSetting_'+i).className='orgSettingOp'; g('orgSetting_'+i).className='orgSettingOp';
g('orgContent_'+i).className='undis';} g('orgContent_'+i).className='undis';
}
g('orgContent_'+n).className='dis ml15 mr15'; g('orgContent_'+n).className='dis ml15 mr15';
g('orgSetting_'+n).className='orgSettingOp orgOpActive';} g('orgSetting_'+n).className='orgSettingOp orgOpActive';
}
//如果要做成点击后再转到请将<li>中的onmouseover 改成 onclick; //如果要做成点击后再转到请将<li>中的onmouseover 改成 onclick;
//]]> //]]>
$checkName = true; $checkName = true;
@ -16,7 +18,7 @@
return false ; return false ;
} }
$.get( $.get(
'<%= check_uniq_organizations_path%>'+'?org_name='+$("#organization_name").val().trim()+"&config_page=Y" + "&org_id="+id '<%= check_uniq_organizations_path %>'+'?org_name='+$("#organization_name").val().trim()+"&config_page=Y" + "&org_id="+id
) )
} }
function update_org(id, old_value, input_value){ function update_org(id, old_value, input_value){
@ -94,7 +96,7 @@
<!--<input id="allow_set_excellent_teachers" type="checkbox" style="margin-top:5px;" name="organization[allow_teacher]" <%#= @organization.allow_teacher==1 ? 'checked': ''%> class="ml3" />--> <!--<input id="allow_set_excellent_teachers" type="checkbox" style="margin-top:5px;" name="organization[allow_teacher]" <%#= @organization.allow_teacher==1 ? 'checked': ''%> class="ml3" />-->
<!--</div>--> <!--</div>-->
<!--<%# end %>--> <!--<%# end %>-->
<a href="javascript:void(0);" class="saveBtn ml80 db fl" onclick="update_org('<%=@organization.id %>','<%= @organization.name %>', $('#organization_name'));">保存</a> <a href="javascript:void(0);" class="saveBtn ml80 db fl" onclick = "update_org('<%=@organization.id %>', '<%= @organization.name %>', $('#organization_name'));">保存</a>
<% end %> <% end %>
</div> </div>
<div class="undis ml15 mr15" id="orgContent_2"> <div class="undis ml15 mr15" id="orgContent_2">
@ -105,16 +107,16 @@
<div class="cl"></div> <div class="cl"></div>
</ul> </ul>
<div id="org_member_list"> <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> </div>
<div class="fl ml10 orgMemContainer"> <div class="fl ml10 orgMemContainer">
<div class="orgMemberAdd"> <div class="orgMemberAdd">
<p class="fontBlue fb mb5">添加成员</p> <p class="fontBlue fb mb5">添加成员</p>
<%= form_tag url_for(:controller => 'org_member', :action => 'create', :org => @organization),:id=>'org_member_add_form',:remote=>true do |f|%> <%= form_tag url_for(:controller => 'org_member', :action => 'create', :org => @organization),:id => 'org_member_add_form', :remote => true do |f|%>
<input type="text" id="not_org_member_search" name="orgAddSearch" placeholder="支持姓名、邮箱、登录名搜索" class="orgAddSearch mb20" /> <input type="text" id="not_org_member_search" name="orgAddSearch" placeholder="支持姓名、邮箱、登录名搜索" class="orgAddSearch mb20" />
<%# if @organization.secdomain_name.nil? %> <%# if @organization.secdomain_name.nil? %>
<%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %> <%= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript "/org_member/org_member_autocomplete?" + {:org => @organization.id}.to_query }')" %>
<%#= javascript_tag "observeSearchfield('not_org_member_search', null, '#{url_for(:controller => 'organizations', :action => 'org_member_autocomplete', :org=> @organization.id)}')" %> <%#= javascript_tag "observeSearchfield('not_org_member_search', null, '#{url_for(:controller => 'organizations', :action => 'org_member_autocomplete', :org=> @organization.id)}')" %>
<%# else %> <%# else %>
<%#= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript secdomain_with_protocol(@organization.secdomain_name) + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %> <%#= javascript_tag "observeSearchfield('not_org_member_search', null, '#{ escape_javascript secdomain_with_protocol(@organization.secdomain_name) + "/org_member/org_member_autocomplete?" + {:org=> @organization.id}.to_query }')" %>
@ -143,7 +145,7 @@
<div class="undis ml15 mr15" id="orgContent_3"> <div class="undis ml15 mr15" id="orgContent_3">
<!--新增二级栏目--> <!--新增二级栏目-->
<div> <div>
<%= form_tag url_for(:controller => 'org_subfields', :action => 'create', :organization_id => @organization.id), :id=> 'add_subfield_form',:remote => true do %> <%= form_tag url_for(:controller => 'org_subfields', :action => 'create', :organization_id => @organization.id), :id => 'add_subfield_form',:remote => true do %>
<span class="fontGrey3 fb mb5 mr10" >新增一级栏目</span> <span class="fontGrey3 fb mb5 mr10" >新增一级栏目</span>
<input type="text" id="subfield_name" name="name" placeholder="栏目名称" class="orgAddSearch mb10" /> <input type="text" id="subfield_name" name="name" placeholder="栏目名称" class="orgAddSearch mb10" />
<div class="mb10"> <div class="mb10">
@ -178,6 +180,7 @@
<%= render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)} %> <%= render :partial => 'organizations/subfield_list', :locals => {:subfields => subfield_to_addmin?(@organization)} %>
</div> </div>
</div> </div>
</div> </div>
<script> <script>
function add_org_subfield(){ function add_org_subfield(){
@ -245,4 +248,5 @@
$this.bind('blur', reset); $this.bind('blur', reset);
}); });
} }
</script> </script>

View File

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

View File

@ -24,4 +24,7 @@
</ul> </ul>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>

View File

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

View File

@ -1,5 +1,5 @@
<div class="project_r_h"> <div class="project_r_h">
<h2 class="project_h2 fl"><%= @subPage_title%></h2> <h2 class="project_h2 fl"><%= @subPage_title %></h2>
<% if is_project_manager?(User.current, @project) %> <% if is_project_manager?(User.current, @project) %>
<span class="fr f14 fontGrey2" style="height: 40px; line-height: 40px; margin-right: 15px;"> <span class="fr f14 fontGrey2" style="height: 40px; line-height: 40px; margin-right: 15px;">
<%=link_to "成员管理", :controller => 'projects', :action => 'settings', :id => @project.id, :tab => 'members' %> <%=link_to "成员管理", :controller => 'projects', :action => 'settings', :id => @project.id, :tab => 'members' %>

View File

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

View File

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

View File

@ -1,19 +1,25 @@
<div class="syllabus_category"> <div class="syllabus_category">
<% unless projects.empty? %> <% unless projects.empty? %>
<% if @type.to_i == 2 %> <% 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 %> <% 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 %> <% 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 %> <% 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 %> <% 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 %> <% 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 %> <% end %>
<span class="grayTxt fl "><%=@user == User.current ? "我" : "他" %><%= list_type == 1 ? "创建" : "参与"%>的项目</span> <span class="grayTxt fl "><%= @user == User.current ? "我" : "他" %><%= list_type == 1 ? "创建" : "参与"%>的项目</span>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="syllabus_courses_box" id="project_li_<%=list_type %>"> <div class="syllabus_courses_box" id="project_li_<%=list_type %>">
@ -21,7 +27,7 @@
<div class="icons_tishi"><img src="/images/sy/icons_tan.png" width="110" height="110" alt="" ></div> <div class="icons_tishi"><img src="/images/sy/icons_tan.png" width="110" height="110" alt="" ></div>
<% if list_type == 1 %> <% if list_type == 1 %>
<p class="sy_tab_con_p"><%=@user == User.current ? "您" : "他" %>还没有创建项目~~<br /> <p class="sy_tab_con_p"><%=@user == User.current ? "您" : "他" %>还没有创建项目~~<br />
<%= link_to "创建项目", new_project_path(:host=> Setting.host_name), :target => "_blank", :class => "sy_btn_green ml5 mt5" if @user == User.current %> <%= link_to "创建项目", new_project_path(:host => Setting.host_name), :target => "_blank", :class => "sy_btn_green ml5 mt5" if @user == User.current %>
</p> </p>
<% else %> <% else %>
<p class="sy_tab_con_p"><%=@user == User.current ? "您" : "他" %>还没有加入项目~~<br /> <p class="sy_tab_con_p"><%=@user == User.current ? "您" : "他" %>还没有加入项目~~<br />
@ -31,16 +37,18 @@
<% else %> <% else %>
<% projects.each_with_index do |project, i| %> <% projects.each_with_index do |project, i| %>
<div class="syllabus_courses_list <%= i > 4 ? 'none' : ''%>" style="cursor: default;"> <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"> <div class="sy_courses_open">
<span id="collect_project_icon_<%=project.id %>"> <span id="collect_project_icon_<%= project.id %>">
<%=render :partial => 'collect_project', :locals => {:project => project} %> <%=render :partial => 'collect_project', :locals => {:project => project} %>
</span> </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? %> <% unless project.is_public? %>
<span class="syllabus_class_private fl ml10 mt3 syllabus_class_property">私有</span> <span class="syllabus_class_private fl ml10 mt3 syllabus_class_property">私有</span>
<% end %> <% end %>
<% projectUser = User.where("id=?",project.user_id).first %> <% projectUser = User.where("id=?",project.user_id).first %>
<%=link_to "<span class='fr grayTxt'>创建者:#{projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)}</span>".html_safe, user_path(projectUser) %> <%= link_to "<span class='fr grayTxt'>创建者:#{projectUser.try(:realname) != " " ? projectUser.lastname + projectUser.firstname : projectUser.try(:login)}</span>".html_safe, user_path(projectUser) %>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div> <div>
@ -58,7 +66,8 @@
<% end %> <% end %>
<% if count > 5 %> <% if count > 5 %>
<div class="syllabus_courses_list"> <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> </div>
<% end %> <% end %>
<% end %> <% end %>

View File

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

View File

@ -20,7 +20,7 @@
<%= hidden_field_tag(:send_ids, send_ids) %> <%= hidden_field_tag(:send_ids, send_ids) %>
<input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入班级ID或者名称搜索" class="searchResourcePopup" /> <input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入班级ID或者名称搜索" class="searchResourcePopup" />
<script> <script>
observeSearchfieldOnInput('search_course_input','<%= search_user_course_user_path(user)%>','<%= send_id %>','<%= send_ids%>','news') observeSearchfieldOnInput('search_course_input', '<%= search_user_course_user_path(user)%>', '<%= send_id %>', '<%= send_ids%>', 'news')
</script> </script>
<!--<a href="javascript:void(0);" class="searchIconPopup"></a>--> <!--<a href="javascript:void(0);" class="searchIconPopup"></a>-->
<%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %> <%= submit_tag '',:class=>'searchIcon2',:onfocus=>"this.blur();",:style=>'border-style:none' %>

View File

@ -31,6 +31,6 @@ button:
name: "联系我们" name: "联系我们"
key: "FEEDBACK" key: "FEEDBACK"
- -
type: "click" type: "view"
name: "解除绑定" name: "个人资料"
key: "UNBIND" 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 end
collection do collection do
get 'org_member_autocomplete' get 'org_member_autocomplete'
get 'org_member_paging'
get 'deleteOrgMember' get 'deleteOrgMember'
end end
end end

File diff suppressed because it is too large Load Diff

View File

@ -550,8 +550,8 @@ function observeSearchfield(fieldId, targetId, url) {
dataType: 'jsonp', dataType: 'jsonp',
data: {q: $this.val()}, data: {q: $this.val()},
success: function(data){ if(targetId) $('#'+targetId).html(data); }, success: function(data){ if(targetId) $('#'+targetId).html(data); },
beforeSend: function(){ $this.addClass('ajax-loading'); }, beforeSend: function(){ $this.addClass('ajax-loading'); }, // 添加成员加载完成前,显示载入中
complete: function(){ $this.removeClass('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> //<2F><><EFBFBD><EFBFBD><EFBFBD>֯<EFBFBD><D6AF>Ա<EFBFBD><D4B1><EFBFBD><EFBFBD><E1BDBB><EFBFBD><EFBFBD>
// 组织:新增成员
function submit_add_org_members(){ function submit_add_org_members(){
$("#org_member_add_form").submit(); $("#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.lastname = vm.user.lastname;
vm.mail = vm.user.mail; vm.mail = vm.user.mail;
vm.sex = vm.user.gender; vm.sex = vm.user.gender;
vm.user.img_url = vm.user.img_url +"?t="+Math.random();
} }
); );
}; };