shixun新建和编辑同步
This commit is contained in:
parent
66fc9b858e
commit
9f0128a878
|
@ -68,7 +68,7 @@ class ShixunsController < ApplicationController
|
|||
def create
|
||||
@shixun = Shixun.new(params[:shixun])
|
||||
@shixun.user_id = User.current.id
|
||||
|
||||
params[:shixun][:is_public] == "on" ? @shixun.is_public = 1 : @shixun.is_public = 0
|
||||
respond_to do |format|
|
||||
if @shixun.save
|
||||
m = ShixunMember.new(:user_id => User.current.id, :role => 1)
|
||||
|
|
|
@ -12,12 +12,12 @@
|
|||
</div>
|
||||
<% end %>
|
||||
<li class="ml45 mb10">
|
||||
<label><span class="c_red">*</span> <%= l(:label_projects_new_name)%> :</label>
|
||||
<label><span class="c_red">*</span> 实训名称 :</label>
|
||||
<%= f.text_field :name, :class => "project_new_input project_new_input_project_new", :placeholder => "例如:团队协作方法与机制研究", :onkeyup => "regex_project_name();" %>
|
||||
<p class="c_orange ml70" id="project_name_notice" style="display: none;">项目名称不能为空</p>
|
||||
<p class="c_orange ml70" id="project_name_notice" style="display: none;">实训名称不能为空</p>
|
||||
</li>
|
||||
<li class="ml45 mb10">
|
||||
<label class="fl mr5"> <%= l(:label_tags_project_description) %> :</label>
|
||||
<label class="fl mr5"> 预备知识 :</label>
|
||||
<%= f.kindeditor :description, :editor_id => 'project_create_editor',
|
||||
:owner_id => @project.nil? ? 0: @project.id,
|
||||
:owner_type => OwnerTypeHelper::PROJECT,
|
||||
|
@ -33,7 +33,7 @@
|
|||
</li>
|
||||
<li class="mb5 ml70">
|
||||
<label > 公开 :</label>
|
||||
<%= f.text_field :is_public, :id => "project_is_public", :name => "project[is_public]", :type => "checkbox", :value => "1", :checked => "checked" %>
|
||||
<%= f.text_field :is_public, :id => "project_is_public", :name => "shixun[is_public]", :type => "checkbox", :value => "1", :checked => "checked" %>
|
||||
<span class="c_grey">(打钩为公开项目,不打钩为私有项目;私有项目仅项目成员可见。)</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<% end %>
|
||||
<%= error_messages_for 'project' %>
|
||||
<div class="project_r_h02">
|
||||
<h2 class="project_h2"><%= l(:label_project_new)%></h2>
|
||||
<h2 class="project_h2">新建实训</h2>
|
||||
</div>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
|
|
@ -149,7 +149,7 @@ a.rightbar-pause{ color:#29bd8b; font-size: 18px; margin-right:245px; margin-top
|
|||
.panel-form{ width:800px; margin:0 100px; padding:30px 0; line-height: 40px; }
|
||||
.panel-form li{ margin-bottom:20px; font-size: 14px; color:#666;}
|
||||
.panel-form-label{ display:inline-block; width:90px; text-align:right; }
|
||||
.panel-form input,.panel-form textarea{ border:1px solid #e2e2e2;color:#666;line-height: 40px;}
|
||||
.panel-form input,.panel-form textarea{ border:1px solid #e2e2e2;color:#666;line-height: 1.9;}
|
||||
.panel-form-width-690{ width: 690px; padding:5px;}
|
||||
.panel-form-width-670{ width: 670px; padding:5px;}
|
||||
.panel-form-height-150{ height: 150px;}
|
||||
|
|
Loading…
Reference in New Issue