|
|
|
@ -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>
|