From bde5cb930221ea268bd239035c3a97075bb40739 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 3 Nov 2014 15:35:29 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E4=BF=AE=E6=94=B9=202.=E4=BD=9C=E4=B8=9A=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E5=8F=96=E6=B6=88=E5=8A=A0=E7=B2=97=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=203.=E4=BD=9C=E4=B8=9A=E5=88=9B=E5=BB=BA=E3=80=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=BB=BA=E4=B8=9A=E9=A1=B5=E9=9D=A2=E9=AB=98=E5=BA=A6?= =?UTF-8?q?=E4=B8=BA=E8=87=AA=E5=8A=A8=204.=E5=88=A0=E9=99=A4=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E6=88=90=E5=91=98=E5=A2=9E=E5=8A=A0=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/_form.html.erb | 41 +++-- app/views/attachments/_links.html.erb | 4 +- .../homework_attach/_homework_member.html.erb | 42 +++-- app/views/homework_attach/edit.html.erb | 168 ++++++++++-------- app/views/homework_attach/new.html.erb | 69 +++---- public/stylesheets/css.css | 11 +- 6 files changed, 180 insertions(+), 155 deletions(-) diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb index 52050ee06..c97da6d66 100644 --- a/app/views/attachments/_form.html.erb +++ b/app/views/attachments/_form.html.erb @@ -27,25 +27,28 @@ // file.click(); // } - -<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %> - -<%= button_tag "浏览", :type=>"button", :onclick=>"_file.click()",:onmouseover => 'this.focus()' %> -<%= file_field_tag 'attachments[dummy][file]', - :id => '_file', - :class => 'file_selector', - :multiple => true, - :onchange => 'addInputFiles(this);', - :style => 'display:none', - :data => { - :max_file_size => Setting.attachment_max_size.to_i.kilobytes, - :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), - :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, - :upload_path => uploads_path(:format => 'js'), - :description_placeholder => l(:label_optional_description) - } %> -<%= l(:label_no_file_uploaded)%> -(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) + + <%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %> + + <%= button_tag "浏览", :type=>"button", :onclick=>"_file.click()",:onmouseover => 'this.focus()' %> + <%= file_field_tag 'attachments[dummy][file]', + :id => '_file', + :class => 'file_selector', + :multiple => true, + :onchange => 'addInputFiles(this);', + :style => 'display:none', + :data => { + :max_file_size => Setting.attachment_max_size.to_i.kilobytes, + :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)), + :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i, + :upload_path => uploads_path(:format => 'js'), + :description_placeholder => l(:label_optional_description) + } %> + + <%= l(:label_no_file_uploaded)%> + + (<%= l(:label_max_size) %>: + <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>) <% content_for :header_tags do %> diff --git a/app/views/attachments/_links.html.erb b/app/views/attachments/_links.html.erb index 9326b32ec..29ed094bf 100644 --- a/app/views/attachments/_links.html.erb +++ b/app/views/attachments/_links.html.erb @@ -1,7 +1,7 @@ -
+
<% for attachment in attachments %>

- + <% if options[:length] %> <%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true,:length => options[:length] -%> <% else %> diff --git a/app/views/homework_attach/_homework_member.html.erb b/app/views/homework_attach/_homework_member.html.erb index 9dfe170bd..f85333d69 100644 --- a/app/views/homework_attach/_homework_member.html.erb +++ b/app/views/homework_attach/_homework_member.html.erb @@ -4,8 +4,12 @@ - - + + @@ -19,9 +23,15 @@ <% hoemwork_users.each do |user| %> <% if homework.user != user %> - - - + + + <% end %> <% end %> @@ -31,14 +41,18 @@
<%= form_for(hoemwork_users, {:url => add_homework_users_homework_attach_path(homework), :remote => true, :method => :post}) do |f| %> -
- <%= l(:label_member_new) %> -

<%= label_tag "principal_search", l(:label_principal_search) %><%= text_field_tag 'principal_search', nil %>

- <%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript get_homework_member_list_homework_attach_index_path(:q => params[:q], :bid_id => params[:id]||homework, :format => 'js') }')" %> -
- <%= render_new_members_for_homework(members) %> -
-

<%= submit_tag l(:button_add), :id => 'member-add-submit' %>

-
+ + <%= l(:label_member_new) %> + +

+ <%= label_tag "principal_search", l(:label_principal_search) %> + <%= text_field_tag 'principal_search', nil %>

+ <%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript get_homework_member_list_homework_attach_index_path(:q => params[:q], :bid_id => params[:id]||homework, :format => 'js') }')" %> +
+ <%= render_new_members_for_homework(members) %> +
+

+ <%= submit_tag l(:button_add), :id => 'member-add-submit' %> +

<% end %>
diff --git a/app/views/homework_attach/edit.html.erb b/app/views/homework_attach/edit.html.erb index d7764f347..9f81a3d19 100644 --- a/app/views/homework_attach/edit.html.erb +++ b/app/views/homework_attach/edit.html.erb @@ -1,75 +1,103 @@ + + + + + 新建作业 + <%= stylesheet_link_tag 'css'%> + + - + +
+
+
+
    +
  • + 修改作业 +
  • +
  • + 成员 +
  • +
  • + <%= link_to(l(:label_project_new), {:controller => 'projects', + :action => 'new', + :course => 0, + :project_type => 0}) if User.current.allowed_to?(:add_project, nil, :global => true) %> +
  • +
-

<%=raw l(:label_edit_homework)%>

- -
- <%= form_for(@homework) do |f|%> -

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

-

- 提交项目  : - <% if @homework.project.nil? %> - <%= f.select :project_id, options_for_select(user_projects_option),:name => "project_id", :required => true%> - <% else %> - <%= f.select :project_id, options_for_select(user_projects_option,@homework.project.id),:name => "project_id", :required => true%> - <% end %> - - <%= link_to '创建项目', new_project_path(course: 0, project_type: 0), :target => '_blank' %> -

提交项目可以为空

-

-

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

-

-

-

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

+
+
+ <%= form_for(@homework) do |f|%> +

+ + <%= f.text_field :name, :required => true, :name => "homework_name", :class => "w430 bo", :maxlength => 254, :placeholder => "作品名称"%> +

+

+ + <% 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 %> +

+

+ + <%= f.text_area :description, :rows => 8, :name => "homework_description", :class => "w620", + :maxlength => 3000, :placeholder => "最多3000个汉字" %>

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

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

+

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

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

+

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

- -

-

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

- <% end %> -
- +

+ +                        + + + <%= l(:label_button_ok) %> + + 取  消 +

+

+ <% end %> +
+
+ +
+ <%= render :partial => "homework_member",:locals => {:members => @members,:hoemwork_users =>@hoemwork_users,:homework => @homework} %> +
+
+
+ + diff --git a/app/views/homework_attach/new.html.erb b/app/views/homework_attach/new.html.erb index fcf4099ab..8a8e3b1c8 100644 --- a/app/views/homework_attach/new.html.erb +++ b/app/views/homework_attach/new.html.erb @@ -1,19 +1,10 @@ - - - - - 新建作业 - <%= stylesheet_link_tag 'css', :media => 'all' %> - - - - - +
@@ -28,18 +19,16 @@ :project_type => 0}) if User.current.allowed_to?(:add_project, nil, :global => true) %> -
-
-
-
- <%= form_for(HomeworkAttach.new, :method => :post, - :name => 'new_form', - :url => {:controller => 'homework_attach', - :action => 'create', - :user_id => User.current.id, - :bid_id => @bid - }) do |f|%> +
+
+ <%= form_for(HomeworkAttach.new, :method => :post, + :name => 'new_form', + :url => {:controller => 'homework_attach', + :action => 'create', + :user_id => User.current.id, + :bid_id => @bid + }) do |f|%>

<%= f.select :project_id,options_for_select(user_projects_option), {},{:class => "w350 bo"} %> @@ -68,14 +57,11 @@

-

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

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

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

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

@@ -86,25 +72,10 @@ <%= l(:label_button_ok) %> 取  消 - - - -

- <% end %> - -
- -
+ <% end %> +
- -
- - - -
- - diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css index 3df7df034..244447ec7 100644 --- a/public/stylesheets/css.css +++ b/public/stylesheets/css.css @@ -118,7 +118,7 @@ a:hover.ping_sub{ background:#14a8b9;} /* 创建作业 */ -.Newwork{ width:940px; height:auto; border:1px solid #c3c3c3;} +.Newwork{ width:940px; border:1px solid #c3c3c3;} .N_top{ height:35px; background:#e5e5e5; border:1px solid #fff; width:691px; padding:5px 10px 0 15px;} .N_top h2{ color:#616161; font-size:14px; float:left;} .N_top a{ float:right; font-size:14px; color:#15bccf; display:block; background:url(images/pic_ad.png) 0 5px no-repeat; height:20px; width:60px; padding-left:16px;} @@ -131,6 +131,15 @@ a:hover.ping_sub{ background:#14a8b9;} .bo{height:26px; border:1px solid #CCC !important; padding: 0 !important;} a.tijiao{ height:28px !important; display:block !important; width:80px !important; color:#fff !important; background:#15bccf !important; text-align:center !important; padding-top:4px !important; float:left !important; margin-right:10px !important;} a:hover.tijiao{ background:#0f99a9 !important;} +.members_left{ float:left; width:570px; margin-right:20px;} +.members_left{} +.members_left ul li{ height:30px; border-bottom:1px solid #CCC; width:570px; padding-top:5px; } +.members_left ul li a{ float:left;} +.members_left ul li span{ float:left; text-align:center; color:#484747;} +.w260{ text-align:center; width:260px;} +.f_b{ font-weight: bold;} +.members_right label{ margin-left:15px;} +.N_search{ height:20px; border:1px s #999;} /* 匿名评分弹框 */ .alert .close02{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-490px;background:url(images/close.png) no-repeat;cursor:pointer;}
<%= l(:label_user) %><%= l(:label_role_plural) %> + <%= l(:label_user) %> + + <%= l(:label_role_plural) %> +
<%= link_to_user user %> 参与人员 <%= link_to l(:button_delete),destory_homework_users_homework_attach_path(:user_id=>user),:remote => true, :method => :post %> + <%= link_to_user user %> + + 参与人员 + + <%= link_to l(:button_delete),destory_homework_users_homework_attach_path(:user_id=>user),:remote => true, :method => :post, :confirm => l(:label_delete_confirm) %> +