From 67c9fefba6f97a9c73bbda9a7768f119c6fe62ce Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 10 Jun 2014 14:27:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0tab=E9=A1=B5=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E7=9A=84js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/homework_attach_helper.rb | 6 +-- ...mework.html.erb => _new_homework.html.erb} | 4 +- app/views/homework_attach/new.html.erb | 54 ++++++++++++------- 3 files changed, 38 insertions(+), 26 deletions(-) rename app/views/homework_attach/{_edit_homework.html.erb => _new_homework.html.erb} (75%) diff --git a/app/helpers/homework_attach_helper.rb b/app/helpers/homework_attach_helper.rb index ed8d0949b..85f9a64ad 100644 --- a/app/helpers/homework_attach_helper.rb +++ b/app/helpers/homework_attach_helper.rb @@ -9,12 +9,10 @@ module HomeworkAttachHelper end #作业添加、编辑界面的tab页 def homework_settings_tabs f - @project = Project.find 76 @f = f - tabs = [{:name => 'info', :action => :edit_homework, :partial => 'homework_attach/edit_homework', :label => :label_information_plural}, - {:name => 'members', :action => :homework_member, :partial => 'homework_attach/homework_member', :label => :label_member_plural} + tabs = [{:name => 'info', :partial => 'homework_attach/edit_homework', :label => :label_information_plural}, + {:name => 'members', :partial => 'homework_attach/homework_member', :label => :label_member_plural} ] - #tabs.select {|tab| User.current.allowed_to?(tab[:action], @homework)} end #作业可选成员列表分页 diff --git a/app/views/homework_attach/_edit_homework.html.erb b/app/views/homework_attach/_new_homework.html.erb similarity index 75% rename from app/views/homework_attach/_edit_homework.html.erb rename to app/views/homework_attach/_new_homework.html.erb index 25f90f186..9ff3e2ffe 100644 --- a/app/views/homework_attach/_edit_homework.html.erb +++ b/app/views/homework_attach/_new_homework.html.erb @@ -2,12 +2,12 @@

标 题: - <%= @f.text_field "name", :required => true, :size => 60, :style => "width:490px;" %> + <%= f.text_field "name", :required => true, :size => 60, :style => "width:490px;" %>

描 述: - <%= @f.text_area "description", :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %> + <%= f.text_area "description", :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %>

diff --git a/app/views/homework_attach/new.html.erb b/app/views/homework_attach/new.html.erb index 966176a1d..0ead4babd 100644 --- a/app/views/homework_attach/new.html.erb +++ b/app/views/homework_attach/new.html.erb @@ -1,3 +1,13 @@ + +

<%=h l(:label_new_homework)%>

<%= form_for('new_form', :method => :post, @@ -6,26 +16,30 @@ :user_id => User.current.id, :bid_id => @bid }) do |f|%> -

- 标 题: - <%= f.text_field "name", :required => true, :size => 60, :style => "width:490px;" %> -

-

- 描 述: - - <%= f.text_area "description", :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;" %> - -

-

-

- - <%= l(:label_attachment_plural) %> - -

- <%= render :partial => 'attachments/form' %> -

-
-

+ +
+ +
+ +
+ <%= render :partial => "new_homework",:locals => {:f => f} %> +
+ +
+ <%= render :partial => "homework_member" %> +
+

<%= submit_tag t(:label_button_ok), :sta => 0, :class => "enterprise"%>