1、去掉项目隐藏代码库的功能

2、同步圈子的描述
3、圈子JS实现
This commit is contained in:
huang 2015-09-24 11:19:07 +08:00
parent bb676b697b
commit 6449b2563b
6 changed files with 19 additions and 14 deletions

View File

@ -188,7 +188,7 @@ class ProjectsController < ApplicationController
@project.safe_attributes = params[:project]
@project.organization_id = params[:organization_id]
@project.user_id = User.current.id
@project.project_new_type = 1
@project.project_new_type = params[:project_new_type]
if validate_parent_id && @project.save
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
# Add current user as a project member if he is not admin

View File

@ -94,6 +94,9 @@ module ProjectsHelper
type
end
# 项目类型描述
# 被邀请成员的状态
def status_for_ivitied(ivite_list, project)
if ivite_list.user.member_of?(project)

View File

@ -170,9 +170,9 @@
<div class=" mt10">
<h3 class="mb10 c_blue">请选择项目类型:</h3>
<ul class="mb10" id="project_type">
<li><input type="radio" name="project_type" <%= @project.project_new_type == 1 ? 'checked' : ''%> id="development_group"/><label class="f14">&nbsp;&nbsp;开发模式:<span class="f12 ml5 c_grey">为团队开发提供一系列在线协同工具。</span></label></li>
<li><input type="radio" name="project_type" <%= @project.project_new_type == 2 ? 'checked' : ''%> id="research_group"/><label class="f14">&nbsp;&nbsp;研讨模式:<span class="f12 ml5 c_grey">为小组研究提供阶段汇报和交流工具。</span></label></li>
<li><input type="radio" name="project_type" <%= @project.project_new_type == 3 ? 'checked' : ''%> id="friend_organization"/><label class="f14">&nbsp;&nbsp;圈子模式:<span class="f12 ml5 c_grey">为朋友圈提供简洁的交流和分享工具。</span></label></li>
<li><input type="radio" name="project_type" <%= @project.project_new_type == 1 ? 'checked' : ''%> id="development_group"/><label class="f14">&nbsp;&nbsp;开发模式:<span class="f12 ml5 c_grey">面向小组开发,支持问题跟踪、代码托管、论坛交流等所有功能。</span></label></li>
<li><input type="radio" name="project_type" <%= @project.project_new_type == 2 ? 'checked' : ''%> id="research_group"/><label class="f14">&nbsp;&nbsp;研讨模式:<span class="f12 ml5 c_grey">面向小组研究,支持任务分工、论坛交流、资源分享等。</span></label></li>
<li><input type="radio" name="project_type" <%= @project.project_new_type == 3 ? 'checked' : ''%> id="friend_organization"/><label class="f14">&nbsp;&nbsp;圈子模式:<span class="f12 ml5 c_grey">面向好友分享,支持论坛交流、资源分享等。</span></label></li>
</ul>
<a href="javascript:void(0)" class="orange_btn" onclick="click_ok('<%= change_project_type_project_path @project%>');" >确定</a>
</div>

View File

@ -17,7 +17,7 @@
<div class="cl"></div>
<li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_type_project)%>&nbsp;&nbsp;</label>
<%= select_tag :project_new_type, options_for_select(project_type_select, @project.project_new_type) %><span class=" ml15 c_orange">开发模式开发模式开发模式开发模式开发模式开发模式开发模式开发模</span>
<%= select_tag :project_new_type, options_for_select([["开发模式", "1"], ["研讨模式", "2"], ["圈子模式", "3"]]) %><span class=" ml15 c_orange">为团队提供系列在线开发工具!</span>
</li>
<div class="cl"></div>
<li class="ml45">
@ -89,5 +89,13 @@
$("#new_project").submit();
}
}
$(document).ready(function(){
$('#project_new_type').change(function(){
alert($(this).children('option:selected').val("开发模式:面向小组开发,支持问题跟踪、代码托管、论坛交流等所有功能。"));
var p1=$(this).children('option:selected').val("研讨模式:面向小组研究,支持任务分工、论坛交流、资源分享等。");//这就是selected的值
// var p2=$('#param2').val();//获取本页面其他标签的值
})
})
</script>

View File

@ -5,9 +5,8 @@
<%= render :partial=>"avatar/new_avatar_form",:locals=> {source:@project} %>
<div class="cl"></div>
</li>
<li >
<label class="label02"><span class="c_red">*</span>&nbsp;名称&nbsp;&nbsp;</label>
<label class="label02"><span class="c_red">*</span>&nbsp;项目名称&nbsp;&nbsp;</label>
<!--<input id="project_name" name="project[name]" class=" w543" type="text" value="<%#= @project.name%>">-->
<input type="text" name="project[name]" id="project_name" class="w543" maxlength="100" onkeyup="regex_project_name();" value="<%= @project.name %>">
<span class="c_red ml110" id="project_name_notice" style="display: none;">项目名称不能为空!</span>
@ -15,7 +14,7 @@
<div class="cl"></div>
<li >
<label class="label02" >&nbsp;&nbsp;描述&nbsp;&nbsp;</label>
<label class="label02" >&nbsp;&nbsp;项目描述&nbsp;&nbsp;</label>
<textarea class="w543" id="project_description" name="project[description]" rows="8" placeholder="最多3000个汉字(或6000个英文字符)"><%= @project.description%></textarea>
<div class="cl"></div>
</li>
@ -24,11 +23,6 @@
<input id="project_is_public" name="project[is_public]" type="checkbox" <%= @project.is_public ? "checked" : ""%>>
<div class="cl"></div>
</li>
<li >
<label class="label02">隐藏代码库&nbsp;&nbsp;</label>
<input id="project_hidden_repo" name="project[hidden_repo]" type="checkbox" <%= @project.hidden_repo ? "checked" : ""%>>
<div class="cl"></div>
</li>
</ul>
<a href="javascript:void(0)" class="blue_btn ml110" onclick="submit_edit_project(<%= @project.id %>);" >保存</a>
<% end %>

View File

@ -852,7 +852,7 @@ div.flash.warning, .conflict {
/*弹出框*/
.black_overlay{display:none;position:fixed;top:0px;left:0px;width:100%;height:100%;background-color:black;z-index:1001;-moz-opacity:0.8;opacity:.80;filter:alpha(opacity=80);}
.white_content{display:none;position:fixed;top:15%;left:30%;width:420px;height: auto; margin-bottom:20px;padding:16px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;}
.white_content02{display:none;position:fixed;top:15%;left:30%;width:310px;height: auto; margin-bottom:20px;padding:10px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;}
.white_content02{display:none;position:fixed;top:15%;left:30%;width:450px;height: auto; margin-bottom:20px;padding:10px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;}
.floatbox{ width:420px; border:3px solid #15bccf; background:#fff; padding:5px;}
a.box_close{ display:block; float:right; width:16px; height:16px; background:url(../images/img_floatbox.png) 0 0 no-repeat;}
a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;}