parent
5b671c5109
commit
b94c57691a
|
@ -162,7 +162,7 @@ class ProjectsController < ApplicationController
|
|||
@trackers = Tracker.sorted.all
|
||||
@project = Project.new
|
||||
@project.safe_attributes = params[:project]
|
||||
render :layout => 'base'
|
||||
render :layout => 'new_base'
|
||||
else
|
||||
redirect_to signin_url
|
||||
end
|
||||
|
@ -220,7 +220,7 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
else
|
||||
respond_to do |format|
|
||||
format.html { render :action => 'new', :layout => 'base'}#Added by young
|
||||
format.html { render :action => 'new', :layout => 'new_base'}#Added by young
|
||||
format.api { render_validation_errors(@project) }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -76,6 +76,24 @@ module ProjectsHelper
|
|||
return result
|
||||
end
|
||||
|
||||
# 项目类型
|
||||
def project_type_select
|
||||
type = []
|
||||
option1 = []
|
||||
option1 << l(:label_development_team)
|
||||
option1 << l(:label_development_team)
|
||||
option2 = []
|
||||
option2 << l(:label_research_group)
|
||||
option2 << l(:label_research_group)
|
||||
option3 = []
|
||||
option3 << l(:label_friend_organization)
|
||||
option3 << l(:label_friend_organization)
|
||||
type << option1
|
||||
type << option2
|
||||
type << option3
|
||||
type
|
||||
end
|
||||
|
||||
# 被邀请成员的状态
|
||||
def status_for_ivitied(ivite_list, project)
|
||||
if ivite_list.user.member_of?(project)
|
||||
|
|
|
@ -1,23 +1,73 @@
|
|||
<% @nav_dispaly_project_label = 1
|
||||
@nav_dispaly_forum_label = 1 %>
|
||||
|
||||
<%= labelled_form_for @project do |f| %>
|
||||
<div class="project_new">
|
||||
<%=l(:label_project_new)%>
|
||||
<span class="description">
|
||||
</span>
|
||||
<div class="box tabular" >
|
||||
<p style="font-weight: bold; color: rgb(237,137,36)">
|
||||
<%=raw l(:label_project_new_description)%>
|
||||
</p>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<span style="padding-left: 60px">
|
||||
<%= submit_tag l(:button_create), :class => "enterprise"%>
|
||||
</span>
|
||||
</div>
|
||||
<%#= submit_tag l(:button_create_and_continue), :name => 'continue' %>
|
||||
<%= javascript_tag "$('#project_name').focus();" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="project_r_h02">
|
||||
<h2 class="project_h2"><%= l(:label_project_new)%></h2>
|
||||
</div>
|
||||
<div class="hwork_new">
|
||||
<ul>
|
||||
<%= labelled_form_for @project do |f| %>
|
||||
<li class="ml45">
|
||||
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<label><span class="c_red">*</span> <%= l(:label_projects_new_name)%> :</label>
|
||||
<input type="text" name="project[name]" id="project_name" class="courses_input" maxlength="100" onkeyup="regex_project_name();">
|
||||
<span class="c_red" id="project_name_notice" style="display: none;">项目名称不能为空</span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml45 mb10">
|
||||
<label><span class="c_red">*</span> <%= l(:label_type_project)%> :</label>
|
||||
<%= select_tag :project_new_type, options_for_select(project_type_select, @project.project_new_type) %>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li class="ml45">
|
||||
<label class="fl" > <%= l(:label_tags_project_description) %> :</label>
|
||||
<textarea name="project[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl" ></textarea>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class=" mb5 ml80">
|
||||
<label >公开 :</label>
|
||||
<input id="project_is_public" name="project[is_public]" type="checkbox" value="1">
|
||||
<span class="c_grey">(打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该项目。)</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class=" ml90" >
|
||||
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_new_project();" >提交</a>
|
||||
<%= link_to "取消",user_activities_path(User.current.id),:class => "blue_btn grey_btn fl c_white"%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end%>
|
||||
</ul>
|
||||
</div><!--talknew end-->
|
||||
<div class="cl"></div>
|
||||
|
||||
<% html_title(l(:label_project_new)) -%>
|
||||
<% html_title(l(:label_project_new)) -%>
|
||||
|
||||
<script>
|
||||
//////////////////////////////////////////////////////////////
|
||||
//新建项目
|
||||
//验证项目名称
|
||||
function regex_project_name()
|
||||
{
|
||||
var name = $.trim($("#project_name").val());
|
||||
if(name.length == 0)
|
||||
{
|
||||
$("#project_name_notice").show();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#project_name_notice").hide();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//提交新建项目
|
||||
function submit_new_project()
|
||||
{
|
||||
if(regex_project_name())
|
||||
{
|
||||
$("#new_project").submit();
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -284,7 +284,8 @@ zh:
|
|||
label_tags_issue: "问题名称"
|
||||
label_tags_issue_description: 问题描述
|
||||
|
||||
label_tags_project_name: "项目名称:"
|
||||
label_tags_project_name: "项目名称:"
|
||||
label_projects_new_name: "项目名称"
|
||||
label_tags_project_description: "项目描述"
|
||||
|
||||
label_tags_user_mail: "用户邮箱:"
|
||||
|
|
|
@ -60,6 +60,7 @@ zh:
|
|||
label_friend_organization: 圈子模式
|
||||
label_research_group: 研讨模式
|
||||
label_development_team: 开发模式
|
||||
label_type_project: 项目类型
|
||||
|
||||
label_member: 成员
|
||||
project_module_attachments: 资源
|
||||
|
|
|
@ -505,4 +505,5 @@ function judgeprojectname(){
|
|||
//用户反馈
|
||||
function submitProjectFeedback() {
|
||||
$("#project_feedback_form").submit();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
.project_content{ width:940px; margin:10px auto;}
|
||||
.project_left{ float:left;}
|
||||
.project_right{ width:670px; float:left;background:#fff; padding:10px;}
|
||||
.project_r_h02{ width:920px; height:40px; background:#eaeaea; margin-bottom:10px;}
|
||||
|
||||
/*简介*/
|
||||
.project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d;}
|
||||
|
|
Loading…
Reference in New Issue