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/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index ad6b2e504..0c38335bf 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -41,7 +41,7 @@ <% when 1 %> <%= link_to '关闭匿评', stop_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true %> <% when 2 %> - 已关闭匿评 + 匿评结束 <% end %> <%= link_to( diff --git a/app/views/bids/_homework.html.erb b/app/views/bids/_homework.html.erb index 0b38d07d9..9265f23f0 100644 --- a/app/views/bids/_homework.html.erb +++ b/app/views/bids/_homework.html.erb @@ -29,7 +29,8 @@ window.onready = function() { - <% if !@is_teacher && @homework_list.count > 0%> + <% if !@is_teacher && @homework_list.count > 0 && @bid.comment_status == 1%> + //登录者不是老师,且作业列表数目不为0,且作业处于开启匿评阶段 $('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_attach/praise_alert') %>'); showModal('ajax-modal', '480px'); $('#ajax-modal').css('height','240px'); diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index 828474acb..2b7b87b0f 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -34,9 +34,12 @@

  • <%= link_to "我的作品", get_my_homework_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%>
  • -
  • - <%= link_to "所有作品", get_homeworks_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%> -
  • + <% if @bid.comment_status == 2 %> + +
  • + <%= link_to "所有作品", get_homeworks_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%> +
  • + <% end %>
  • <%= link_to "留言", get_homework_jours_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%> ( diff --git a/app/views/homework_attach/_homework.html.erb b/app/views/homework_attach/_homework.html.erb index e9252edf3..c6b7895cc 100644 --- a/app/views/homework_attach/_homework.html.erb +++ b/app/views/homework_attach/_homework.html.erb @@ -61,13 +61,24 @@ <% end %>
  • <% elsif is_student_batch_homework%> - -
  • - <%= link_to l(:label_work_rating),homework_attach_path(homework),:remote => true %> - <% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %> -   迟交! - <% end %> -
  • + + <% if @bid.comment_status == 1 %> + +
  • + <%= link_to l(:label_work_rating),homework_attach_path(homework),:remote => true %> + <% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %> +   迟交! + <% end %> +
  • + <% elsif @bid.comment_status == 2%> + +
  • + 评分 + <% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %> +   迟交! + <% end %> +
  • + <% end %> <% else %>
  • diff --git a/app/views/homework_attach/_homework_member.html.erb b/app/views/homework_attach/_homework_member.html.erb index 9dfe170bd..82e4a3b36 100644 --- a/app/views/homework_attach/_homework_member.html.erb +++ b/app/views/homework_attach/_homework_member.html.erb @@ -1,11 +1,22 @@ + + <%= error_messages_for 'member' %>
    - - + + @@ -19,9 +30,15 @@ <% hoemwork_users.each do |user| %> <% if homework.user != user %> - - - + + + <% end %> <% end %> @@ -31,14 +48,23 @@
    <%= 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 %>

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

    + <%= label_tag "principal_search", l(:label_principal_search) %> + <%= text_field_tag 'principal_search', nil ,{:class => "N_search",:style => "width:50%;"}%> +

    <%= 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(:button_add) %> + +

    +
    <% end %>
    diff --git a/app/views/homework_attach/_homeworks_list.html.erb b/app/views/homework_attach/_homeworks_list.html.erb index ef2b9a001..514820fdd 100644 --- a/app/views/homework_attach/_homeworks_list.html.erb +++ b/app/views/homework_attach/_homeworks_list.html.erb @@ -32,9 +32,16 @@
  • 您还没交作业,请创建作业!
  • -
  • - <%= link_to "创建作业", new_exercise_book_path(@bid), :style => "width:80px; margin:20px 0 0 350px;" %> -
  • + <% if @bid.comment_status == 0 %> + +
  • + <%= link_to "创建作业", new_exercise_book_path(@bid), :style => "width:80px; margin:20px 0 0 350px;" %> +
  • + <% else %> +
  • + 创建作业 +
  • + <% end %>
    <% 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%> +

    +
    +
    + <%= 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个汉字" %> +

    +
    +

    + + <%#= 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' %> +

    +

    + +

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

    +

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

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

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

    -
    -

    -

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

    - <% 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 a54030902..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' %> - - - - - +
    @@ -22,23 +13,22 @@ 创建作品
  • - - 创建项目 - + <%= 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) %>
  • -
    -
    -
    -
    - <%= 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"} %> @@ -67,14 +57,11 @@

    -

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

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

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

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

    @@ -84,25 +71,11 @@ <%= l(:label_button_ok) %> - - - - + 取  消

    - <% end %> - -
    - -
    + <% end %> +
    - -
    - - - -
    - - diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css index 3df7df034..6c72186bd 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 !important; border:1px solid #999 !important;} /* 匿名评分弹框 */ .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) %> +