You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
111 lines
4.6 KiB
111 lines
4.6 KiB
<%= content_for(:header_tags) do %>
|
|
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
|
<% end %>
|
|
<%= error_messages_for 'project' %>
|
|
<!--<p class="mb10 mt10"><i class="fa fa-map-marker mr5 color-grey"></i>
|
|
<a href="<%#= user_path(User.current) %>"><%#= User.current.show_name %></a> > 新建项目
|
|
</p>-->
|
|
<div class="educontent mt30">
|
|
<%= form_for(@project) do |f| %>
|
|
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
|
|
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
|
|
<div class="mb10 edu-back-white">
|
|
<p class="padding10-20 bor-bottom-greyE font-18 color-grey-3">新建项目</p>
|
|
<div class="padding30-20">
|
|
<p class="color-grey-6 font-16 mb15"><%= l(:label_projects_new_name) %></p>
|
|
<div class="df">
|
|
<span class="mr30 color-orange pt10">*</span>
|
|
<div class="flex1 mr20">
|
|
<input type="text" name="project[name]" id="project_name" maxlength="60" class="input-100-45 greyInput" placeholder="例如:团队协作方法与机制研究" onkeyup="regex_project_name();">
|
|
</div>
|
|
<div style="width: 57px;"><span class="color-orange none mt8 fl" id="project_name_notice"><i class="fa fa-exclamation-circle mr3"></i>必填项</span></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb10 edu-back-white padding30-20">
|
|
<p class="color-grey-6 font-16 mb15"><%= l(:label_tags_project_description) %></p>
|
|
<div class="df">
|
|
<div class="flex1 mr20">
|
|
<%= f.kindeditor :description, :editor_id => 'project_create_editor',
|
|
:owner_id => @project.nil? ? 0: @project.id,
|
|
:owner_type => OwnerTypeHelper::PROJECT,
|
|
:width => '100%',
|
|
:height => 300,
|
|
:minHeight=> 300,
|
|
:class => 'courses_text ml5 fl',
|
|
:input_html => { :id => 'description',
|
|
:class => 'courses_text fl',
|
|
:maxlength => 5000 }
|
|
%>
|
|
</div>
|
|
<div style="width: 57px;"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb10 edu-back-white padding30-20">
|
|
<p class="color-grey-6 font-16 mb15">公开</p>
|
|
<div class="df">
|
|
<div class="flex1 mr20">
|
|
<span class="fl mr20">
|
|
<input type="checkbox" checked name="project[is_public]" value="1" id="project_is_public" class="ml5 mr5 magic-checkbox" >
|
|
<label style="top:6px" class="color-grey" for="project_is_public">(打钩为公开项目,不打钩为私有项目;私有项目仅项目成员可见)</label>
|
|
</span>
|
|
</div>
|
|
<div style="width: 57px;"></div>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix mb30 mt30">
|
|
<a href="javascript:void(0)" class="defalutSubmitbtn fl mr20" onclick="submit_new_project();">提交</a>
|
|
<%= link_to "取消", user_path(User.current), :class => "defalutCancelbtn fl" %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<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()
|
|
{
|
|
project_create_editor.sync();
|
|
if(regex_project_name())
|
|
{
|
|
$("#new_project").submit();
|
|
}
|
|
}
|
|
|
|
$(function(){
|
|
$('#project_new_type').change(function(){
|
|
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的值
|
|
// var p2=$('#param2').val();//获取本页面其他标签的值
|
|
})
|
|
|
|
})
|
|
</script>
|
|
|