2014-10-23 11:30:34 +08:00
|
|
|
|
<% @nav_dispaly_project_label = 1
|
|
|
|
|
@nav_dispaly_forum_label = 1 %>
|
2015-09-24 09:47:40 +08:00
|
|
|
|
<%= error_messages_for 'project' %>
|
2015-09-23 17:36:36 +08:00
|
|
|
|
<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>
|
2015-09-24 11:44:02 +08:00
|
|
|
|
<%= select_tag :project_new_type, options_for_select([["开发模式", "1"], ["研讨模式", "2"], ["圈子模式", "3"]]) %>
|
2015-09-24 14:01:29 +08:00
|
|
|
|
<span class=" ml15 c_orange" id = "project_newtype_select"><%=l(:label_type_des_development) %></span>
|
2015-09-23 17:36:36 +08:00
|
|
|
|
</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>
|
2015-09-24 09:47:40 +08:00
|
|
|
|
<li>
|
|
|
|
|
<p style="display: none" >
|
|
|
|
|
<%= f.text_field :identifier, :required => true, :size => 60, :style => "width:488px;", :disabled => @project.identifier_frozen?, :maxlength => Project::IDENTIFIER_MAX_LENGTH,
|
|
|
|
|
value:"#{User.current.id.to_s + '_' +Time.now.to_s.gsub(' ','_').gsub(':','').gsub('+','')}" %>
|
|
|
|
|
<% unless @project.identifier_frozen? %>
|
|
|
|
|
<em class="info">
|
|
|
|
|
<%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %>
|
|
|
|
|
<%= l(:text_project_identifier_info).html_safe %>
|
|
|
|
|
</em>
|
|
|
|
|
<% end %></p>
|
|
|
|
|
</li>
|
2015-09-23 17:36:36 +08:00
|
|
|
|
<li class=" mb5 ml80">
|
|
|
|
|
<label >公开 :</label>
|
2015-09-24 09:47:40 +08:00
|
|
|
|
<input id="project_is_public" name="project[is_public]" type="checkbox" value="1" checked="checked">
|
2015-09-23 17:36:36 +08:00
|
|
|
|
<span class="c_grey">(打钩为公开,不打钩则不公开,若不公开,仅项目成员可见该项目。)</span>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
</li>
|
2015-09-24 09:47:40 +08:00
|
|
|
|
<li>
|
|
|
|
|
<p style="display:none;">
|
|
|
|
|
<%= f.text_field :project_type, :value => 0 %>
|
|
|
|
|
</p>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<%= render :partial => 'form_new', :locals => { :f => f } %>
|
|
|
|
|
</li>
|
2015-09-23 17:36:36 +08:00
|
|
|
|
<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>
|
2014-10-23 11:30:34 +08:00
|
|
|
|
|
2015-09-23 17:36:36 +08:00
|
|
|
|
<% 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();
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-09-24 11:19:07 +08:00
|
|
|
|
|
2015-09-24 11:44:02 +08:00
|
|
|
|
$(function(){
|
2015-09-24 11:19:07 +08:00
|
|
|
|
$('#project_new_type').change(function(){
|
2015-09-24 11:44:02 +08:00
|
|
|
|
var type = $('#project_new_type').val();
|
|
|
|
|
if(type == '1'){
|
|
|
|
|
$(this).next().html("<%= l(:label_type_des_development)%>");
|
|
|
|
|
}
|
|
|
|
|
else if(type == '2'){
|
|
|
|
|
$(this).next().html("<%= l(:label_type_des_research)%>");
|
|
|
|
|
}
|
|
|
|
|
else if(type == '3'){
|
|
|
|
|
$(this).next().html("<%= l(:label_type_des_friend)%>");
|
|
|
|
|
}
|
|
|
|
|
// var p1=$(this).children('option:selected').val("研讨模式:面向小组研究,支持任务分工、论坛交流、资源分享等。");//这就是selected的值
|
2015-09-24 11:19:07 +08:00
|
|
|
|
// var p2=$('#param2').val();//获取本页面其他标签的值
|
|
|
|
|
})
|
2015-09-24 11:44:02 +08:00
|
|
|
|
|
2015-09-24 11:19:07 +08:00
|
|
|
|
})
|
2015-09-24 09:47:40 +08:00
|
|
|
|
</script>
|
|
|
|
|
|