Merge branch 'dev_hjq' of http://repository.trustie.net/xianbo/trustie2 into dev_hjq

This commit is contained in:
whimlex 2015-04-14 19:56:19 +08:00
commit b3b9688072
18 changed files with 318 additions and 151 deletions

View File

@ -60,8 +60,12 @@ class MembersController < ApplicationController
user_ids.each do |user_id|
AppliedProject.deleteappiled(user_id, @project.id)
end
@succes_message = "拒绝成功"
end
end
respond_to do |format|
format.js
end
else
#modify by nwb
#更改课程成员逻辑
@ -117,9 +121,14 @@ class MembersController < ApplicationController
format.html { redirect_to invite_members_project_url(@project) }
end
else
unless members.present? && members.all? {|m| m.valid? }
@project_error_message = members.empty? ? l(:label_user_role_null) :members.collect {|m| m.errors.full_messages}.flatten.uniq.join(', ')
else
@succes_message = "添加成功"
end
respond_to do |format|
format.html { redirect_to_settings_in_projects }
format.js { @members = members; @applied_members = applied_members; }
format.js
format.api {
@member = members.first
if @member.valid?
@ -184,6 +193,8 @@ class MembersController < ApplicationController
end # end of params[:refusal_button]
end
def update

View File

@ -27,15 +27,7 @@ class ProjectsController < ApplicationController
menu_item :feedback, :only => :feedback
menu_item :share, :only => :share
before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join,
:course, :enterprise_course, :course_enterprise,:view_homework_attaches]
before_filter :authorize, :only => [:show, :settings, :edit, :sort_project_members, :update, :modules, :close,
:reopen,:view_homework_attaches,:course]
before_filter :find_project, :except => [ :index, :search,:list, :new, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise,:view_homework_attaches,:join_project]
# before_filter :authorize, :except => [:new_join, :new_homework, :homework, :statistics, :search, :watcherlist, :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file,
# :statistics, :feedback, :course, :enterprise_course, :course_enterprise, :project_respond, :share,
# :show_projects_score, :issue_score_index, :news_score_index, :file_score_index, :code_submit_score_index, :projects_topic_score_index]
#此条勿删 课程相关权限 ,:new_homework,:homework,:feedback,,:member
before_filter :authorize, :only => [:show, :settings, :edit, :sort_project_members, :update, :modules, :close, :reopen,:view_homework_attaches,:course]
before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches]
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar]
@ -606,6 +598,17 @@ class ProjectsController < ApplicationController
end
end
#朋友圈、科研组、开发组之间的切换
def change_project_type
@project.project_new_type = params[:project_type]
if @project.save
message = @project.project_new_type
else
message = "0"
end
render :json => message
end
private
def memberAccess

View File

@ -128,6 +128,15 @@ module ApplicationHelper
end
end
def link_to_settings_user(user, options={})
if user.is_a?(User)
name = h(user.name(options[:format]))
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.user_domain}, :class => "w90 c_orange fl"
else
h(user.to_s)
end
end
#重载上面方法,增加样式显示
def link_to_user_header user,canShowRealName=false,options={}
if user.is_a?(User)
@ -574,6 +583,15 @@ module ApplicationHelper
s.html_safe
end
# li标签checkbos扩展
def principals_check_box_tags_li(name, principals)
s = ''
principals.each do |principal|
s << "<li>#{ check_box_tag name, principal.id, false, :id => nil } #{h link_to principal.userInfo, user_path( principal.id), :class => "c_blue" }</li>\n"
end
s.html_safe
end
#扩展的checkbox生成
def principals_radio_box_tags_ex(name, principals)
s = ''
@ -1352,14 +1370,16 @@ module ApplicationHelper
def delete_link(url, options={})
options = {
:method => :delete,
:data => {:confirm => l(:text_are_you_sure)},
:class => 'icon icon-del'
:method => :delete,
:data => {:confirm => l(:text_are_you_sure)},
:class => 'icon icon-del'
}.merge(options)
link_to l(:button_delete), url, options
end
def delete_new_link(url, options={})
options = {
:method => :delete,

View File

@ -38,7 +38,7 @@ module MembersHelper
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options|
link_to text, autocomplete_project_memberships_path(project, parameters.merge(:q => params[:q],:flag => true, :format => 'js')), :remote => true
}
s + content_tag('ul', links,:class => 'wlist', :style =>"float:left;margin-top:0px;")
s + content_tag('ul', links,:class => 'wlist', :id => "course_member_pagination_links" )
end
# add by nwb
@ -55,6 +55,29 @@ module MembersHelper
s + content_tag('ul', links,:class => 'wlist',:id => "course_member_pagination_links")
end
# 项目配置中添加成员列表
def render_principals_for_new_project_members(project)
scope = Principal.active.sorted.not_member_of(project).like(params[:q])
principals = paginateHelper scope,10
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals')
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true) {|text, parameters, options|
link_to text, appliedproject_project_memberships_path(project, parameters.merge(:q => params[:q], :format => 'js')), :remote => true
}
s + content_tag('ul', links,:class => 'wlist',:id => "course_member_pagination_links")
end
# 新申请加入项目成员列表
def render_principals_for_applied_members_new project
scope = project.applied_projects.map(&:user)
principals = paginateHelper scope,10
s = content_tag('ul', principals_check_box_tags_li('membership[user_ids][]', principals), :class => 'mb5')
links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true){|text, parameters, options|
link_to text, appliedproject_project_memberships_path(project, parameters.merge(:q => params[:q],:flag => true, :format => 'js')), :remote => true
}
s + content_tag('ul', links,:class => 'wlist', :id => "course_member_pagination_links" )
end
# 当前申请加入的成员名单
def render_principals_for_applied_members(project)

View File

@ -47,7 +47,7 @@
<% end %><!--meny end -->
<!-- more -->
<div class="subNav subNav_jiantou"><%= l(:label_project_more) %></div>
<div class="subNav subNav_jiantou" onclick="expand_tools_expand();" id="expand_tools_expand"><%= l(:label_project_more) %></div>
<ul class="navContent">
<%= render 'projects/tools_expand' %>
</ul>

View File

@ -10,6 +10,6 @@
<!--退出项目-->
<% if ((User.current.member_of? @project) && User.current.login? && User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project)) %>
<%= link_to "<span class='pr_setting'></span>#{l(:button_configure)}".html_safe, settings_project_path(@project), :class => "pr_join_a" %>
<%= link_to "<span class='pr_friend'></span>#{l(:label_friend_organization)}".html_safe,"javascript:void(0)" ,:onClick => "show_window();", :class => "pr_join_a",:id => "setting_project_type"%>
<%= link_to "<span class='pr_friend'></span>#{text}".html_safe,"javascript:void(0)" ,:onClick => "show_window();", :class => "pr_join_a",:id => "setting_project_type"%>
<% end %>
</div>

View File

@ -20,21 +20,50 @@
<!--项目的三种类型-->
<script type="text/javascript">
function click_ok()
function click_ok(url)
{
$('#light').css('display','none');
$('#fade').css('display','none');
//
//ajax处理请求
var project_type;
if($("#development_group").attr("checked") == "checked"){
$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_development_team)))%>")
$("#project_memu").html('<%= escape_javascript(render(:partial => 'layouts/base_development_group')) %>');
project_type = 1;
}
else if($("#research_group").attr("checked") == "checked"){$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_research_group)))%>");
$("#project_memu").html('<%= escape_javascript(render(:partial => 'layouts/base_research_team')) %>');
else if($("#research_group").attr("checked") == "checked"){
project_type = 2;
}
else if($("#friend_organization").attr("checked") == "checked"){$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_friend_organization)))%>");
$("#project_memu").html('<%= escape_javascript(render(:partial => 'layouts/base_friend_group')) %>');
else if($("#friend_organization").attr("checked") == "checked"){
project_type = 3;
}
$.get(
url,
{ project_type: project_type},
function (data) {
if(data == 1)
{
$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_development_team)))%>");
$("#project_memu").html('<%= escape_javascript(render(:partial => 'layouts/base_development_group')) %>');
$("#close_light").attr("onClick","close_window('development_group');");
}
else if(data == 2)
{
$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_research_group)))%>");
$("#project_memu").html('<%= escape_javascript(render(:partial => 'layouts/base_research_team')) %>');
$("#close_light").attr("onClick","close_window('research_group');");
}
else if(data == 3)
{
$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_friend_organization)))%>");
$("#project_memu").html('<%= escape_javascript(render(:partial => 'layouts/base_friend_group')) %>');
$("#close_light").attr("onClick","close_window('friend_organization');");
}
else
{
alert("服务器异常,请与管理员联系");
}
}
);
}
</script>
</head>
@ -86,7 +115,8 @@
</div>
<!--关注、申请加入/退出项目-->
<div id="join_exit_project_div">
<%= render 'layouts/join_exit_project' %>
<% text = @project.project_new_type == 1 ? l(:label_development_team) : (@project.project_new_type == 2 ? l(:label_research_group) : l(:label_friend_organization))%>
<%= render 'layouts/join_exit_project',{:text => text} %>
</div>
<!-- 项目得分 -->
<div class="cl"></div>
@ -133,8 +163,16 @@
<li><%= link_to l(:label_invite_trustie_user), :controller=>"projects", :action=>"invite_members", :id => @project %></li>
</ul>
<% end %><!--end-->
<!--menu 左侧工具栏 -->
<%= render :partial => 'layouts/base_development_group', :locals => {:project => @project}%> <!-- end -->
<!--menu 左侧工具栏 -->
<!--project_new_type: 1为开发组2为科研组3为朋友圈子-->
<% if @project.project_new_type == 1 || @project.project_new_type.nil? %>
<%= render :partial => 'layouts/base_development_group', :locals => {:project => @project}%>
<% elsif @project.project_new_type == 2 %>
<%= render :partial => 'layouts/base_research_team', :locals => {:project => @project}%>
<% else %>
<%= render :partial => 'layouts/base_friend_group', :locals => {:project => @project}%>
<% end %>
<!-- end -->
</div><!--项目侧导航 end-->
<div class="cl"></div>
@ -178,19 +216,18 @@
<%= render :partial => 'layouts/new_footer'%>
<div class="cl"></div>
</div><!--Container end-->
<!--项目类型-->
<div id="light" class="white_content02">
<!-- 这里写需弹出框的HTML代码 -->
<div ><a href="javascript:void(0)" onClick="close_window('development_group');" class="box_close"></a></div>
<% text = @project.project_new_type == 1 ? "development_group" : (@project.project_new_type == 2 ? "research_group" : "friend_organization")%>
<div ><a href="javascript:void(0)" onClick="close_window('<%= text%>');" class="box_close" id="close_light"></a></div>
<div class=" mt10">
<h3 class="mb10 c_blue">请选择项目类型:</h3>
<ul class="mb10" id="project_type">
<li><input type="radio" name="project_type" checked="" id="development_group"/><label >&nbsp;&nbsp;开发组</label></li>
<li><input type="radio" name="project_type" id="research_group"/><label >&nbsp;&nbsp;科研组</label></li>
<li><input type="radio" name="project_type" id="friend_organization"/><label >&nbsp;&nbsp;朋友圈</label></li>
<li><input type="radio" name="project_type" <%= @project.project_new_type == 1 ? 'checked' : ''%> id="development_group"/><label >&nbsp;&nbsp;开发组</label></li>
<li><input type="radio" name="project_type" <%= @project.project_new_type == 2 ? 'checked' : ''%> id="research_group"/><label >&nbsp;&nbsp;科研组</label></li>
<li><input type="radio" name="project_type" <%= @project.project_new_type == 3 ? 'checked' : ''%> id="friend_organization"/><label >&nbsp;&nbsp;朋友圈</label></li>
</ul>
<a href="javascript:void(0)" class="orange_btn" onclick="click_ok()" >确定</a>
<a href="javascript:void(0)" class="orange_btn" onclick="click_ok('<%= change_project_type_project_path @project%>');" >确定</a>
</div>
</div>
@ -199,7 +236,7 @@
<span><%= l(:label_loading) %></span>
</div>
<div id="ajax-modal" style="display:none;"></div>
<%= call_hook :view_layouts_base_body_bottom %>
<%= call_hook :view_layouts_base_body_bottom %>
</body>
</html>

View File

@ -2,7 +2,7 @@
<% if @flag == "true"%>
$('#principals_for_new_member').html('<%= escape_javascript(render_project_members(@project)) %>');
<% else%>
$('#principals_for_new_member').html('<%= escape_javascript(render_principals_for_new_members(@project)) %>');
$('#principals_for_new_member').html('<%= escape_javascript(render_project_members(@project)) %>');
<% end%>
<% elsif @course%>
var checked = $("#principals input:checked").size();

View File

@ -1,27 +1,17 @@
<%if @project%>
$('#tab-content-members').html('<%= escape_javascript(render :partial => 'projects/settings/members') %>');
<%if !@applied_members%>
<% if @members.present? && @members.all? {|m| m.valid? } %>
<% @members.each do |member| %>
$("#member-<%= member.id %>").effect("highlight");
<% end %>
<% else %>
<% if @members %>
<% errors = @members.collect {|m| m.errors.full_messages}.flatten.uniq.join(', ')%>
alert('<%= raw(escape_javascript(l(:notice_failed_to_save_members, :errors => errors || ''))) %>');
<% else%>
// alert('');
<% end%>
<% end %>
<% end %>
<%elsif @course%>
<% if @create_member_error_messages%>
alert("<%= @create_member_error_messages%>");
<% else%>
$('#tbc_02').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
alert("添加成功");
<% end%>
<%end%>
hideOnLoad();
<%if @project%>
<% if @project_error_message%>
alert("<%= @project_error_message%>");
<% else%>
$('#pro_st_tbc_03').html('<%= escape_javascript(render :partial => 'projects/settings/new_members') %>');
hideOnLoad();
alert("<%= @succes_message%>");
<% end%>
<%elsif @course%>
<% if @create_member_error_messages%>
alert("<%= @create_member_error_messages%>");
<% else%>
$('#tbc_02').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
alert("添加成功");
<% end%>
hideOnLoad();
<%end%>

View File

@ -1,6 +1,7 @@
<%if @project%>
$('#tab-content-members').html('<%= escape_javascript(render :partial => 'projects/settings/members') %>');
<%elsif @course%>
$('#tbc_02').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
<%end%>
hideOnLoad();
<%if @project%>
$('#pro_st_tbc_03').html('<%= escape_javascript(render :partial => 'projects/settings/new_members') %>');
// $('#tab-content-members').html('<%#= escape_javascript(render :partial => 'projects/settings/members') %>');
<%elsif @course%>
$('#tbc_02').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
<%end%>
hideOnLoad();

View File

@ -1,9 +1,8 @@
<%if @project%>
$('#tab-content-members').html('<%= escape_javascript(render :partial => 'projects/settings/members') %>');
$("#member-<%= @member.id %>").effect("highlight");
<%elsif @course%>
$('#tbc_02').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
<%end%>
hideOnLoad();
<%if @project%>
$('#pro_st_tbc_03').html('<%= escape_javascript(render :partial => 'projects/settings/new_members') %>');
<%elsif @course%>
$('#tbc_02').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
<%end%>
hideOnLoad();

View File

@ -1,67 +1,136 @@
<%= error_messages_for 'member' %>
<%
roles = Role.givable.all
if @project.project_type == Project::ProjectType_course
roles = roles[3..5]
else
roles = roles[0..2]
end
members = @project.member_principals.includes(:roles, :principal).all.sort
%>
<div class="members_left">
<ul style=" border-bottom:none;">
<li><span class="w90 f_b" >用户</span><span class="w210 f_b">角色</span><span></span></li>
<li ><a href="javascript:void(0)" class="w90 c_orange fl">gugu01</a><span class="w210 fl">Manager, Developer</span><a href="javascript:void(0)" class="c_dblue ml15 fl">编辑</a><a href="javascript:void(0)" class="c_dblue ml30 fl">删除</a></li>
<li ><a href="javascript:void(0)" class="w90 c_orange fl">gugu01</a><span class="w210 fl">Manager, Developer, Reporter</span><a href="javascript:void(0)" class="c_dblue ml15 fl">编辑</a><a href="javascript:void(0)" class="c_dblue ml30 fl">删除</a></li>
<li ><a href="javascript:void(0)" class="w90 c_orange fl">gugu01</a><span class="w210 fl">Manager</span><a href="javascript:void(0)" class="c_dblue ml15 fl">编辑</a><a href="javascript:void(0)" class="c_dblue ml30 fl">删除</a></li>
</ul>
</div><!-- 左边-->
<% if members.any? %>
<ul style=" border-bottom:none;">
<li><span class="w90 f_b" ><%= l(:label_user) %></span><span class="w210 f_b"><%= l(:label_role_plural) %></span><span></span></li>
<%= call_hook(:view_projects_settings_members_table_header, :project => @project) %>
<% members.each do |member| %>
<li >
<%= link_to_user_header member.principal,false,:class => "w150 c_orange fl" %>
<span class="w150 fl">
<%= h member.roles.sort.collect(&:to_s).join(', ') %>
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),
:method => :put,
:html => {:id => "member-#{member.id}-roles-form", :class => 'hol'}}
) do |f| %>
<% roles.each do |role| %>
<ul style="text-align: left;" class="ml20">
<%= check_box_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
:disabled => member.member_roles.detect { |mr| mr.role_id == role.id && !mr.inherited_from.nil? } %>
<label ><%= h role %></label>
</ul>
<!--<br/>-->
<% end %>
<%= hidden_field_tag 'membership[role_ids][]', '' %>
<div class="ml20">
<a href="javascript:void(0)" class="member_btn" onclick="$('#member-<%= member.id%>-roles-form').submit();" style="margin-right: 10px;">
<%= l(:button_change)%>
</a>
<a href="javascript:void(0)" class="member_btn" onclick="$('#member-<%= member.id%>-roles-form').hide();$(this).parent().parent().parent().parent().height(30)">
<%= l(:button_cancel)%>
</a>
</div>
<% end %>
</span>
<% unless member.user_id == @project.user_id %>
<a href="javascript:void(0) " class="c_dblue ml15 fl" onclick="$('#member-<%= member.id%>-roles-form').show();$(this).parent().height(110);">编辑</a>
<%= delete_link membership_path(member),
:remote => true,
:class => "c_dblue ml30 fl",
:data => (!User.current.admin? && member.include?(User.current) ? {:confirm => l(:text_own_membership_for_project_confirmation)} : {confirm: l(:label_delete_confirm)}) if member.deletable? %>
<% end%>
</li>
<% end%>
</ul>
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>
</div><!-- left -->
<!--right begin-->
<% if roles.any? %>
<div class="members_right">
<div class="members_jion">
<p class="c_blue mb10 fb">+申请加入</p>
<ul class="mb10">
<li><input name="membership[user_ids][]" type="checkbox" value="3172"> <a href="/users/3172" class="c_blue">JackWu (巫 荣杰)</a></li>
<li><input name="membership[user_ids][]" type="checkbox" value="3172"> <a href="/users/3172" class="c_blue">JackWu (巫 荣杰)</a></li>
<li><input name="membership[user_ids][]" type="checkbox" value="3172"> <a href="/users/3172" class="c_blue">JackWu (巫 荣杰)</a></li>
</ul>
<ul class="mb10">
<li>角色:</li>
<li><input type="checkbox" /><label>Manager</label></li>
<li><input type="checkbox" /><label>Developer</label></li>
<li><input type="checkbox" /><label>Reporter</label></li>
</ul>
<div class="cl"></div>
<a href="javascript:void(0)" class="blue_btn fl" >批准</a><a href="javascript:void(0)" class="grey_btn fl ml10" >拒绝</a>
</div><!--members_jion end-->
<div class="cl"></div>
<div class="members_add">
<p class="c_blue fb mt10 mb5">添加成员</p>
<div class="member_search">
<input class="member_search_input fl" type="text" name="" value="输入用户名称搜索好友"><a class="invi_search_btn fl c_white" >搜索</a>
<div class="cl"></div>
<ul class="mb5">
<li><input type="checkbox" name="" checked=""> <label >suntao</label> </li>
<li><input type="checkbox" name="" > <label >suntaoalibb</label> </li>
<li><input type="checkbox" name="" > <label >用户名称</label> </li>
<li><input type="checkbox" name="" > <label >suntao</label> </li>
<li><input type="checkbox" name="" checked=""> <label >suntao</label> </li>
<li><input type="checkbox" name="" > <label >suntaoalibb</label> </li>
<li><input type="checkbox" name="" > <label >用户名称</label> </li>
<li><input type="checkbox" name="" > <label >suntao</label> </li>
<li><input type="checkbox" name="" > <label >用户名称</label> </li>
<li><input type="checkbox" name="" > <label >suntao</label> </li>
</ul>
<div class="cl"></div>
<ul class="wlist mr40" >
<li><a href="javascript:void(0)">下一页</a></li>
<li><a href="javascript:void(0)">...</a></li>
<li><a href="javascript:void(0)">2</a></li>
<li class="wlist_select" ><a href="javascript:void(0)">1</a></li>
<li><a href="javascript:void(0)">上一页</a></li>
</ul>
<div class="cl"></div>
<ul class="rolebox mb10 mt10">
<li class="fb">角色: </li>
<li ><input class="fl" type="checkbox" name="" checked=""> <label >TeachingAsistant</label> </li>
<li ><input type="checkbox" name="" > <label >Teacher</label> </li>
<li ><input type="checkbox" name="" > <label >Student</label> </li>
</ul>
<div class="cl"></div>
<a href="javascript:void(0)" class=" blue_btn">新增成员</a>
<!-- applied -->
<% if @project.applied_projects.any? %>
<div class="members_jion">
<p class="c_blue mb10 fb"><%= l(:label_apply_project) %></p>
<%= form_for(@applied_members, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
<div id="principals_for_applied_member">
<%= render_principals_for_applied_members_new(@project) %>
</div>
<ul class="mb10">
<li><%= l(:label_role_plural) %>:</li>
<% roles.each do |role| %>
<li>
<%= check_box_tag 'membership[role_ids][]', role.id %>
<label ><%= h role %></label >
</li>
<% end %>
</ul>
<a remote="true" href="javascript:void(0)" class="blue_btn fl" onclick="$('#new_membership').submit();">
<%= l(:label_approve) %>
</a>
<a remote="true" href="javascript:void(0)" class="grey_btn fl ml10" onclick="refusal_applied_member();">
<%= l(:label_refusal) %>
</a>
<% end %>
<div class="cl"></div>
</div>
</div>
</div><!-- 右边 end-->
<% end %><!--members_jion end-->
<div class="cl"></div>
<!-- add members -->
<p class="c_blue fb mt10 mb5"><%= l(:label_member_new) %></p>
<%= form_for(@member, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
<div class="member_search">
<input id="principal_search" class="member_search_input fl" type="text" placeholder="请输入用户名称来搜索好友">
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js') }')" %>
<div class="cl"></div>
<div id="principals_for_new_member">
<%= render_principals_for_new_project_members(@project) %>
</div>
<div class="cl"></div>
<ul class="rolebox mb10 mt10">
<li class="fb">
<%= l(:label_role_plural) %>
</li>
<% roles.each do |role| %>
<li>
<%= check_box_tag 'membership[role_ids][]', role.id %>
<label ><%= h role %></label>
</li>
<% end %>
</ul>
<div class="cl mb10"></div>
<a href="javascript:void(0)" class="member_btn" onclick="$(this).parent().parent().submit();">
新增成员
</a>
</div>
<% end%>
</div><!-- 右边 end-->
<% end %>
<script type="text/javascript">
$(document).ready(function () {
var collection=$("#principals_for_new_member").children("#principals").children("label");
collection.css("text-overflow","ellipsis");
collection.css("white-space","nowrap");
collection.css("width","200px");
collection.css("overflow","hidden");
for(i=0;i<collection.length;i++){ //增加悬浮显示
var label=collection[i];
var text=$(label).text();
$(label).attr("title",text);
}
});
</script>

View File

@ -10,7 +10,7 @@
<div class="problem_main">
<a class="problem_pic fl"><%= image_tag(url_to_avatar(e.user), :width => "42", :height => "42") %></a>
<div class="problem_txt fl mt5">
<%= link_to e.user, user_path(e.user), :class => "problem_name c_orange fl" %><span class="fl"> <%= l(:label_project_new) %> </span>
<%= link_to e.user, user_path(e.user), :class => "problem_name c_orange fl" %> <span class="fl"> <%= l(:label_project_create) %> </span>
<%= link_to e.project.name, :class => "problem_tit fl fb" %></a><br />
<p class="mt5"><br /> <%= l :label_create_time %> <%= format_time(e.project.created_on) %></p>
</div>

View File

@ -17,6 +17,7 @@ zh:
#
# 项目托管平台主页
#
@ -86,7 +87,7 @@ zh:
label_project_overview: "项目简介:"
label_expend_information: 展开更多信息
label_project_create: "新建了项目"
#
# 项目托管平台

View File

@ -981,6 +981,7 @@ zh:
text_wiki_page_destroy_children: 删除子页面及其所有下级页面
text_wiki_page_reassign_children: 将子页面的上级页面设置为
text_own_membership_delete_confirmation: 你正在删除你现有的某些或全部权限,如果这样做了你可能将会再也无法编辑该课程了。你确定要继续吗?
text_own_membership_for_project_confirmation: 你正在删除现有的某些或全部权限,如果这样做了你可能将会再也无法编辑该项目了。你确定要继续吗?
text_zoom_in: 放大
text_zoom_out: 缩小
text_applied_project: "用户 %{id} 申请加入项目 %{project}"

View File

@ -363,6 +363,7 @@ RedmineApp::Application.routes.draw do
end
resources :projects do
member do
match 'change_project_type', :via => [:get, :post]
get 'settings(/:tab)', :action => 'settings', :as => 'settings'
#by young
get 'member', :to => 'projects#member', :as => 'member'

View File

@ -14,15 +14,19 @@ function regexName() {
}
// 项目描述超过展开
$(function(){
$(".subNav").click(function(){
$(this).toggleClass("currentDd").siblings(".subNav").removeClass("currentDd")
$(this).toggleClass("currentDt").siblings(".subNav").removeClass("currentDt")
//$(function(){
// $(".subNav").click(function(){
//
// })
//})
function expand_tools_expand()
{
$("#expand_tools_expand").toggleClass("currentDd").siblings(".subNav").removeClass("currentDd");
$("#expand_tools_expand").toggleClass("currentDt").siblings(".subNav").removeClass("currentDt");
// 修改数字控制速度, slideUp(500)控制卷起速度
$(this).next(".navContent").slideToggle(500).siblings(".navContent").slideUp(500);
})
})
// 修改数字控制速度, slideUp(500)控制卷起速度
$("#expand_tools_expand").next(".navContent").slideToggle(500).siblings(".navContent").slideUp(500);
}
// 描述显示更多信息
function show_more_msg()
@ -184,4 +188,11 @@ function project_setting(n)
function submitModules()
{
$("#modules-form").submit();
}
//配置--成员---申请列表--拒绝
function refusal_applied_member()
{
$('#new_membership').append("<input name = 'refusal_button' style='display: none;'>");
$('#new_membership').submit();
}