From 48aacc70c96162607f30aa89a4c3f89d187ecaa3 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 6 Nov 2014 13:53:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=AD=A6=E7=94=9F=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E3=80=81=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_attach/edit.html.erb | 36 +++++++++++++------------ app/views/homework_attach/new.html.erb | 16 +++++------ 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/app/views/homework_attach/edit.html.erb b/app/views/homework_attach/edit.html.erb index 5530b8cff..55015e2f9 100644 --- a/app/views/homework_attach/edit.html.erb +++ b/app/views/homework_attach/edit.html.erb @@ -64,18 +64,6 @@ <%= f.text_field :name, :required => true, :name => "homework_name", :class => "w430 bo", :maxlength => 254, :placeholder => "作品名称", :onblur => "regexName();"%>

-

- - <% if @homework.project.nil? %> - <%= f.select :project_id, options_for_select(user_projects_option),{}, {:name => "project_id", :required => true,:class => "w350 bo"}%> - <% else %> - <%= f.select :project_id, options_for_select(user_projects_option,@homework.project.id),{},{:name => "project_id", :required => true, :class => "w350 bo"}%> - <% end %> -

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

- <% options = {:author => true, :deletable => attach_delete(@homework)} %> - <%= render :partial => 'attachments/links', - :locals => {:attachments => @homework.attachments, :options => options} %> -

+ <% unless @homework.attachments.empty?%> +

+ <% options = {:author => true, :deletable => attach_delete(@homework)} %> + <%= render :partial => 'attachments/links', + :locals => {:attachments => @homework.attachments, :options => options} %> +

+ <% end %>

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

+

+ + <% if @homework.project.nil? %> + <%= f.select :project_id, options_for_select(user_projects_option),{}, {:name => "project_id", :required => true,:class => "w350 bo"}%> + <% else %> + <%= f.select :project_id, options_for_select(user_projects_option,@homework.project.id),{},{:name => "project_id", :required => true, :class => "w350 bo"}%> + <% end %> +

diff --git a/app/views/homework_attach/new.html.erb b/app/views/homework_attach/new.html.erb index efe143cf0..be40ed485 100644 --- a/app/views/homework_attach/new.html.erb +++ b/app/views/homework_attach/new.html.erb @@ -54,14 +54,6 @@ <%= f.text_field "name", :required => true, :size => 60, :class => "w430 bo", :maxlength => 254, :placeholder => "作品名称", :onblur => "regexName();" %>

-

- - <%= f.select :project_id,options_for_select(user_projects_option), {},{:class => "w350 bo"} %> -

+

+ + <%= f.select :project_id,options_for_select(user_projects_option), {},{:class => "w350 bo"} %> +