Merge branch 'dev_hjq' of http://repository.trustie.net/xianbo/trustie2 into dev_hjq
This commit is contained in:
commit
b3b9688072
|
@ -60,8 +60,12 @@ class MembersController < ApplicationController
|
||||||
user_ids.each do |user_id|
|
user_ids.each do |user_id|
|
||||||
AppliedProject.deleteappiled(user_id, @project.id)
|
AppliedProject.deleteappiled(user_id, @project.id)
|
||||||
end
|
end
|
||||||
|
@succes_message = "拒绝成功"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
respond_to do |format|
|
||||||
|
format.js
|
||||||
|
end
|
||||||
else
|
else
|
||||||
#modify by nwb
|
#modify by nwb
|
||||||
#更改课程成员逻辑
|
#更改课程成员逻辑
|
||||||
|
@ -117,9 +121,14 @@ class MembersController < ApplicationController
|
||||||
format.html { redirect_to invite_members_project_url(@project) }
|
format.html { redirect_to invite_members_project_url(@project) }
|
||||||
end
|
end
|
||||||
else
|
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|
|
respond_to do |format|
|
||||||
format.html { redirect_to_settings_in_projects }
|
format.html { redirect_to_settings_in_projects }
|
||||||
format.js { @members = members; @applied_members = applied_members; }
|
format.js
|
||||||
format.api {
|
format.api {
|
||||||
@member = members.first
|
@member = members.first
|
||||||
if @member.valid?
|
if @member.valid?
|
||||||
|
@ -184,6 +193,8 @@ class MembersController < ApplicationController
|
||||||
|
|
||||||
end # end of params[:refusal_button]
|
end # end of params[:refusal_button]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
|
|
@ -27,15 +27,7 @@ class ProjectsController < ApplicationController
|
||||||
menu_item :feedback, :only => :feedback
|
menu_item :feedback, :only => :feedback
|
||||||
menu_item :share, :only => :share
|
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 :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, :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 :authorize_global, :only => [:new, :create,:view_homework_attaches]
|
||||||
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar]
|
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar]
|
||||||
|
@ -606,6 +598,17 @@ class ProjectsController < ApplicationController
|
||||||
end
|
end
|
||||||
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
|
private
|
||||||
|
|
||||||
def memberAccess
|
def memberAccess
|
||||||
|
|
|
@ -128,6 +128,15 @@ module ApplicationHelper
|
||||||
end
|
end
|
||||||
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={}
|
def link_to_user_header user,canShowRealName=false,options={}
|
||||||
if user.is_a?(User)
|
if user.is_a?(User)
|
||||||
|
@ -574,6 +583,15 @@ module ApplicationHelper
|
||||||
s.html_safe
|
s.html_safe
|
||||||
end
|
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生成
|
#扩展的checkbox生成
|
||||||
def principals_radio_box_tags_ex(name, principals)
|
def principals_radio_box_tags_ex(name, principals)
|
||||||
s = ''
|
s = ''
|
||||||
|
@ -1352,14 +1370,16 @@ module ApplicationHelper
|
||||||
|
|
||||||
def delete_link(url, options={})
|
def delete_link(url, options={})
|
||||||
options = {
|
options = {
|
||||||
:method => :delete,
|
:method => :delete,
|
||||||
:data => {:confirm => l(:text_are_you_sure)},
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
:class => 'icon icon-del'
|
:class => 'icon icon-del'
|
||||||
}.merge(options)
|
}.merge(options)
|
||||||
|
|
||||||
link_to l(:button_delete), url, options
|
link_to l(:button_delete), url, options
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def delete_new_link(url, options={})
|
def delete_new_link(url, options={})
|
||||||
options = {
|
options = {
|
||||||
:method => :delete,
|
:method => :delete,
|
||||||
|
|
|
@ -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|
|
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
|
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
|
end
|
||||||
|
|
||||||
# add by nwb
|
# add by nwb
|
||||||
|
@ -55,6 +55,29 @@ module MembersHelper
|
||||||
s + content_tag('ul', links,:class => 'wlist',:id => "course_member_pagination_links")
|
s + content_tag('ul', links,:class => 'wlist',:id => "course_member_pagination_links")
|
||||||
end
|
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)
|
def render_principals_for_applied_members(project)
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
<% end %><!--meny end -->
|
<% end %><!--meny end -->
|
||||||
|
|
||||||
<!-- more -->
|
<!-- 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">
|
<ul class="navContent">
|
||||||
<%= render 'projects/tools_expand' %>
|
<%= render 'projects/tools_expand' %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -10,6 +10,6 @@
|
||||||
<!--退出项目-->
|
<!--退出项目-->
|
||||||
<% if ((User.current.member_of? @project) && User.current.login? && User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project)) %>
|
<% 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_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 %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -20,21 +20,50 @@
|
||||||
|
|
||||||
<!--项目的三种类型-->
|
<!--项目的三种类型-->
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function click_ok()
|
function click_ok(url)
|
||||||
{
|
{
|
||||||
$('#light').css('display','none');
|
$('#light').css('display','none');
|
||||||
$('#fade').css('display','none');
|
$('#fade').css('display','none');
|
||||||
//
|
//ajax处理请求
|
||||||
|
var project_type;
|
||||||
if($("#development_group").attr("checked") == "checked"){
|
if($("#development_group").attr("checked") == "checked"){
|
||||||
$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_development_team)))%>")
|
project_type = 1;
|
||||||
$("#project_memu").html('<%= escape_javascript(render(:partial => 'layouts/base_development_group')) %>');
|
|
||||||
}
|
}
|
||||||
else if($("#research_group").attr("checked") == "checked"){$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_research_group)))%>");
|
else if($("#research_group").attr("checked") == "checked"){
|
||||||
$("#project_memu").html('<%= escape_javascript(render(:partial => 'layouts/base_research_team')) %>');
|
project_type = 2;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if($("#friend_organization").attr("checked") == "checked"){$("#setting_project_type").replaceWith("<%= escape_javascript(project_type_link(l(:label_friend_organization)))%>");
|
else if($("#friend_organization").attr("checked") == "checked"){
|
||||||
$("#project_memu").html('<%= escape_javascript(render(:partial => 'layouts/base_friend_group')) %>');
|
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>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
@ -86,7 +115,8 @@
|
||||||
</div>
|
</div>
|
||||||
<!--关注、申请加入/退出项目-->
|
<!--关注、申请加入/退出项目-->
|
||||||
<div id="join_exit_project_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>
|
||||||
<!-- 项目得分 -->
|
<!-- 项目得分 -->
|
||||||
<div class="cl"></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>
|
<li><%= link_to l(:label_invite_trustie_user), :controller=>"projects", :action=>"invite_members", :id => @project %></li>
|
||||||
</ul>
|
</ul>
|
||||||
<% end %><!--end-->
|
<% end %><!--end-->
|
||||||
<!--menu 左侧工具栏 -->
|
<!--menu 左侧工具栏 -->
|
||||||
<%= render :partial => 'layouts/base_development_group', :locals => {:project => @project}%> <!-- end -->
|
<!--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><!--项目侧导航 end-->
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
||||||
|
@ -178,19 +216,18 @@
|
||||||
<%= render :partial => 'layouts/new_footer'%>
|
<%= render :partial => 'layouts/new_footer'%>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</div><!--Container end-->
|
</div><!--Container end-->
|
||||||
|
|
||||||
<!--项目类型-->
|
|
||||||
<div id="light" class="white_content02">
|
<div id="light" class="white_content02">
|
||||||
<!-- 这里写需弹出框的HTML代码 -->
|
<!-- 这里写需弹出框的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">
|
<div class=" mt10">
|
||||||
<h3 class="mb10 c_blue">请选择项目类型:</h3>
|
<h3 class="mb10 c_blue">请选择项目类型:</h3>
|
||||||
<ul class="mb10" id="project_type">
|
<ul class="mb10" id="project_type">
|
||||||
<li><input type="radio" name="project_type" checked="" id="development_group"/><label > 开发组</label></li>
|
<li><input type="radio" name="project_type" <%= @project.project_new_type == 1 ? 'checked' : ''%> id="development_group"/><label > 开发组</label></li>
|
||||||
<li><input type="radio" name="project_type" id="research_group"/><label > 科研组</label></li>
|
<li><input type="radio" name="project_type" <%= @project.project_new_type == 2 ? 'checked' : ''%> id="research_group"/><label > 科研组</label></li>
|
||||||
<li><input type="radio" name="project_type" id="friend_organization"/><label > 朋友圈</label></li>
|
<li><input type="radio" name="project_type" <%= @project.project_new_type == 3 ? 'checked' : ''%> id="friend_organization"/><label > 朋友圈</label></li>
|
||||||
</ul>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
|
@ -199,7 +236,7 @@
|
||||||
<span><%= l(:label_loading) %></span>
|
<span><%= l(:label_loading) %></span>
|
||||||
</div>
|
</div>
|
||||||
<div id="ajax-modal" style="display:none;"></div>
|
<div id="ajax-modal" style="display:none;"></div>
|
||||||
<%= call_hook :view_layouts_base_body_bottom %>
|
<%= call_hook :view_layouts_base_body_bottom %>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<% if @flag == "true"%>
|
<% if @flag == "true"%>
|
||||||
$('#principals_for_new_member').html('<%= escape_javascript(render_project_members(@project)) %>');
|
$('#principals_for_new_member').html('<%= escape_javascript(render_project_members(@project)) %>');
|
||||||
<% else%>
|
<% 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%>
|
<% end%>
|
||||||
<% elsif @course%>
|
<% elsif @course%>
|
||||||
var checked = $("#principals input:checked").size();
|
var checked = $("#principals input:checked").size();
|
||||||
|
|
|
@ -1,20 +1,11 @@
|
||||||
<%if @project%>
|
<%if @project%>
|
||||||
$('#tab-content-members').html('<%= escape_javascript(render :partial => 'projects/settings/members') %>');
|
<% if @project_error_message%>
|
||||||
|
alert("<%= @project_error_message%>");
|
||||||
<%if !@applied_members%>
|
<% else%>
|
||||||
<% if @members.present? && @members.all? {|m| m.valid? } %>
|
$('#pro_st_tbc_03').html('<%= escape_javascript(render :partial => 'projects/settings/new_members') %>');
|
||||||
<% @members.each do |member| %>
|
hideOnLoad();
|
||||||
$("#member-<%= member.id %>").effect("highlight");
|
alert("<%= @succes_message%>");
|
||||||
<% end %>
|
<% 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%>
|
<%elsif @course%>
|
||||||
<% if @create_member_error_messages%>
|
<% if @create_member_error_messages%>
|
||||||
alert("<%= @create_member_error_messages%>");
|
alert("<%= @create_member_error_messages%>");
|
||||||
|
@ -22,6 +13,5 @@ alert('<%= raw(escape_javascript(l(:notice_failed_to_save_members, :errors => er
|
||||||
$('#tbc_02').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
|
$('#tbc_02').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
|
||||||
alert("添加成功");
|
alert("添加成功");
|
||||||
<% end%>
|
<% end%>
|
||||||
|
hideOnLoad();
|
||||||
<%end%>
|
<%end%>
|
||||||
|
|
||||||
hideOnLoad();
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<%if @project%>
|
<%if @project%>
|
||||||
$('#tab-content-members').html('<%= escape_javascript(render :partial => 'projects/settings/members') %>');
|
$('#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%>
|
<%elsif @course%>
|
||||||
$('#tbc_02').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
|
$('#tbc_02').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
|
||||||
<%end%>
|
<%end%>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<%if @project%>
|
<%if @project%>
|
||||||
$('#tab-content-members').html('<%= escape_javascript(render :partial => 'projects/settings/members') %>');
|
$('#pro_st_tbc_03').html('<%= escape_javascript(render :partial => 'projects/settings/new_members') %>');
|
||||||
$("#member-<%= @member.id %>").effect("highlight");
|
|
||||||
<%elsif @course%>
|
<%elsif @course%>
|
||||||
$('#tbc_02').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
|
$('#tbc_02').html('<%= escape_javascript(render :partial => 'courses/course_members') %>');
|
||||||
<%end%>
|
<%end%>
|
||||||
|
|
|
@ -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">
|
<div class="members_left">
|
||||||
<ul style=" border-bottom:none;">
|
<% if members.any? %>
|
||||||
<li><span class="w90 f_b" >用户</span><span class="w210 f_b">角色</span><span></span></li>
|
<ul style=" border-bottom:none;">
|
||||||
<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><span class="w90 f_b" ><%= l(:label_user) %></span><span class="w210 f_b"><%= l(:label_role_plural) %></span><span></span></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>
|
<%= call_hook(:view_projects_settings_members_table_header, :project => @project) %>
|
||||||
<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>
|
<% members.each do |member| %>
|
||||||
|
<li >
|
||||||
</ul>
|
<%= link_to_user_header member.principal,false,:class => "w150 c_orange fl" %>
|
||||||
|
<span class="w150 fl">
|
||||||
</div><!-- 左边-->
|
<%= 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_right">
|
||||||
<div class="members_jion">
|
<!-- applied -->
|
||||||
<p class="c_blue mb10 fb">+申请加入</p>
|
<% if @project.applied_projects.any? %>
|
||||||
<ul class="mb10">
|
<div class="members_jion">
|
||||||
<li><input name="membership[user_ids][]" type="checkbox" value="3172"> <a href="/users/3172" class="c_blue">JackWu (巫 荣杰)</a></li>
|
<p class="c_blue mb10 fb"><%= l(:label_apply_project) %></p>
|
||||||
<li><input name="membership[user_ids][]" type="checkbox" value="3172"> <a href="/users/3172" class="c_blue">JackWu (巫 荣杰)</a></li>
|
<%= form_for(@applied_members, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
|
||||||
<li><input name="membership[user_ids][]" type="checkbox" value="3172"> <a href="/users/3172" class="c_blue">JackWu (巫 荣杰)</a></li>
|
<div id="principals_for_applied_member">
|
||||||
</ul>
|
<%= render_principals_for_applied_members_new(@project) %>
|
||||||
<ul class="mb10">
|
</div>
|
||||||
<li>角色:</li>
|
<ul class="mb10">
|
||||||
<li><input type="checkbox" /><label>Manager</label></li>
|
<li><%= l(:label_role_plural) %>:</li>
|
||||||
<li><input type="checkbox" /><label>Developer</label></li>
|
<% roles.each do |role| %>
|
||||||
<li><input type="checkbox" /><label>Reporter</label></li>
|
<li>
|
||||||
</ul>
|
<%= check_box_tag 'membership[role_ids][]', role.id %>
|
||||||
<div class="cl"></div>
|
<label ><%= h role %></label >
|
||||||
<a href="javascript:void(0)" class="blue_btn fl" >批准</a><a href="javascript:void(0)" class="grey_btn fl ml10" >拒绝</a>
|
</li>
|
||||||
|
<% end %>
|
||||||
</div><!--members_jion end-->
|
</ul>
|
||||||
<div class="cl"></div>
|
<a remote="true" href="javascript:void(0)" class="blue_btn fl" onclick="$('#new_membership').submit();">
|
||||||
<div class="members_add">
|
<%= l(:label_approve) %>
|
||||||
<p class="c_blue fb mt10 mb5">添加成员</p>
|
</a>
|
||||||
<div class="member_search">
|
<a remote="true" href="javascript:void(0)" class="grey_btn fl ml10" onclick="refusal_applied_member();">
|
||||||
<input class="member_search_input fl" type="text" name="" value="输入用户名称搜索好友"><a class="invi_search_btn fl c_white" >搜索</a>
|
<%= l(:label_refusal) %>
|
||||||
<div class="cl"></div>
|
</a>
|
||||||
<ul class="mb5">
|
<% end %>
|
||||||
<li><input type="checkbox" name="" checked=""> <label >suntao</label> </li>
|
<div class="cl"></div>
|
||||||
<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>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<% 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-->
|
</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>
|
|
@ -10,7 +10,7 @@
|
||||||
<div class="problem_main">
|
<div class="problem_main">
|
||||||
<a class="problem_pic fl"><%= image_tag(url_to_avatar(e.user), :width => "42", :height => "42") %></a>
|
<a class="problem_pic fl"><%= image_tag(url_to_avatar(e.user), :width => "42", :height => "42") %></a>
|
||||||
<div class="problem_txt fl mt5">
|
<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 />
|
<%= 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>
|
<p class="mt5"><br /> <%= l :label_create_time %> :<%= format_time(e.project.created_on) %></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -17,6 +17,7 @@ zh:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# 项目托管平台主页
|
# 项目托管平台主页
|
||||||
#
|
#
|
||||||
|
@ -86,7 +87,7 @@ zh:
|
||||||
|
|
||||||
label_project_overview: "项目简介:"
|
label_project_overview: "项目简介:"
|
||||||
label_expend_information: 展开更多信息
|
label_expend_information: 展开更多信息
|
||||||
|
label_project_create: "新建了项目"
|
||||||
|
|
||||||
#
|
#
|
||||||
# 项目托管平台
|
# 项目托管平台
|
||||||
|
|
|
@ -981,6 +981,7 @@ zh:
|
||||||
text_wiki_page_destroy_children: 删除子页面及其所有下级页面
|
text_wiki_page_destroy_children: 删除子页面及其所有下级页面
|
||||||
text_wiki_page_reassign_children: 将子页面的上级页面设置为
|
text_wiki_page_reassign_children: 将子页面的上级页面设置为
|
||||||
text_own_membership_delete_confirmation: 你正在删除你现有的某些或全部权限,如果这样做了你可能将会再也无法编辑该课程了。你确定要继续吗?
|
text_own_membership_delete_confirmation: 你正在删除你现有的某些或全部权限,如果这样做了你可能将会再也无法编辑该课程了。你确定要继续吗?
|
||||||
|
text_own_membership_for_project_confirmation: 你正在删除现有的某些或全部权限,如果这样做了你可能将会再也无法编辑该项目了。你确定要继续吗?
|
||||||
text_zoom_in: 放大
|
text_zoom_in: 放大
|
||||||
text_zoom_out: 缩小
|
text_zoom_out: 缩小
|
||||||
text_applied_project: "用户 %{id} 申请加入项目 %{project}"
|
text_applied_project: "用户 %{id} 申请加入项目 %{project}"
|
||||||
|
|
|
@ -363,6 +363,7 @@ RedmineApp::Application.routes.draw do
|
||||||
end
|
end
|
||||||
resources :projects do
|
resources :projects do
|
||||||
member do
|
member do
|
||||||
|
match 'change_project_type', :via => [:get, :post]
|
||||||
get 'settings(/:tab)', :action => 'settings', :as => 'settings'
|
get 'settings(/:tab)', :action => 'settings', :as => 'settings'
|
||||||
#by young
|
#by young
|
||||||
get 'member', :to => 'projects#member', :as => 'member'
|
get 'member', :to => 'projects#member', :as => 'member'
|
||||||
|
|
|
@ -14,15 +14,19 @@ function regexName() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 项目描述超过展开
|
// 项目描述超过展开
|
||||||
$(function(){
|
//$(function(){
|
||||||
$(".subNav").click(function(){
|
// $(".subNav").click(function(){
|
||||||
$(this).toggleClass("currentDd").siblings(".subNav").removeClass("currentDd")
|
//
|
||||||
$(this).toggleClass("currentDt").siblings(".subNav").removeClass("currentDt")
|
// })
|
||||||
|
//})
|
||||||
|
function expand_tools_expand()
|
||||||
|
{
|
||||||
|
$("#expand_tools_expand").toggleClass("currentDd").siblings(".subNav").removeClass("currentDd");
|
||||||
|
$("#expand_tools_expand").toggleClass("currentDt").siblings(".subNav").removeClass("currentDt");
|
||||||
|
|
||||||
// 修改数字控制速度, slideUp(500)控制卷起速度
|
// 修改数字控制速度, slideUp(500)控制卷起速度
|
||||||
$(this).next(".navContent").slideToggle(500).siblings(".navContent").slideUp(500);
|
$("#expand_tools_expand").next(".navContent").slideToggle(500).siblings(".navContent").slideUp(500);
|
||||||
})
|
}
|
||||||
})
|
|
||||||
|
|
||||||
// 描述显示更多信息
|
// 描述显示更多信息
|
||||||
function show_more_msg()
|
function show_more_msg()
|
||||||
|
@ -185,3 +189,10 @@ function submitModules()
|
||||||
{
|
{
|
||||||
$("#modules-form").submit();
|
$("#modules-form").submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//配置--成员---申请列表--拒绝
|
||||||
|
function refusal_applied_member()
|
||||||
|
{
|
||||||
|
$('#new_membership').append("<input name = 'refusal_button' style='display: none;'>");
|
||||||
|
$('#new_membership').submit();
|
||||||
|
}
|
Loading…
Reference in New Issue