From f3fefe50f1135a37ab3838dda7bd3147eebd35ec Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 23 Mar 2015 18:40:58 +0800 Subject: [PATCH 1/6] =?UTF-8?q?1=E3=80=81=E5=A2=9E=E5=8A=A0flash=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=A0=B7=E5=BC=8F=202=E3=80=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=80=81=E5=B8=88=E5=88=9B=E5=BB=BA=E4=BD=9C=E4=B8=9A=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E7=9A=84js=203=E3=80=81=E4=BF=AE=E6=94=B9=E8=80=81?= =?UTF-8?q?=E5=B8=88=E5=88=9B=E5=BB=BA=E4=BD=9C=E4=B8=9A=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/_form.html.erb | 2 +- app/views/bids/_new_homework_form.html.erb | 63 ++++++++++++---------- app/views/courses/new_homework.html.erb | 7 +-- public/javascripts/course.js | 4 +- public/stylesheets/public.css | 47 ++++++++++++++++ 5 files changed, 85 insertions(+), 38 deletions(-) diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb index 034cbdf1a..8b22ea417 100644 --- a/app/views/attachments/_form.html.erb +++ b/app/views/attachments/_form.html.erb @@ -31,7 +31,7 @@ <%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %> - <%= button_tag "文件浏览", :type=>"button", :onclick=>"_file.click()",:onmouseover => 'this.focus()',:class => 'sb' %> + <%= button_tag "文件浏览", :type=>"button", :onclick=>"_file.click()",:onmouseover => 'this.focus()',:class => 'sub_btn' %> <%= file_field_tag 'attachments[dummy][file]', :id => '_file', :class => 'file_selector', diff --git a/app/views/bids/_new_homework_form.html.erb b/app/views/bids/_new_homework_form.html.erb index 3150d6b6a..ae091159a 100644 --- a/app/views/bids/_new_homework_form.html.erb +++ b/app/views/bids/_new_homework_form.html.erb @@ -6,36 +6,41 @@
diff --git a/app/views/courses/new_homework.html.erb b/app/views/courses/new_homework.html.erb index 04456c4d2..29e09e18d 100644 --- a/app/views/courses/new_homework.html.erb +++ b/app/views/courses/new_homework.html.erb @@ -1,8 +1,3 @@ <%= labelled_form_for @homework, :url => {:controller => 'bids', :action => 'create_homework',:course_id => "#{params[:id] || params[:course_id]}"} do |f| %> - <%= render :partial => 'bids/new_homework_form', :locals => { :f => f } %> -
  • - <%= l(:button_create)%> - <%= link_to l(:button_cancel), homework_course_path(@course), :class => "blue_btn grey_btn fl c_white"%> -
    -
  • + <%= render :partial => 'bids/new_homework_form', :locals => { :bid_id => "new_bid" } %> <% end %> \ No newline at end of file diff --git a/public/javascripts/course.js b/public/javascripts/course.js index fdcac6601..f6bc4933c 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -116,10 +116,10 @@ $(function(){ }); }); -function submit_new_bid() +function submit_new_bid(id) { if(regex_bid_name()&®ex_evaluation_num()) { - $("#new_bid").submit(); + $("#"+id).submit(); } } \ No newline at end of file diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index d2528510c..7f2641b42 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -214,6 +214,53 @@ html>body #ajax-indicator { position: fixed; } padding-left: 26px; vertical-align: bottom; } +/***** end Ajax indicator ******/ + +/***** Flash & error messages ****/ +#errorExplanation, div.flash, .nodata, .warning, .conflict { + padding: 4px 4px 4px 30px; + margin-bottom: 12px; + font-size: 1.1em; + border: 2px solid; +} + +div.flash {margin-top: 8px;} + +div.flash.error, #errorExplanation { + background: url(../images/exclamation.png) 8px 50% no-repeat; + background-color: #ffe3e3; + border-color: #dd0000; + color: #880000; +} + +div.flash.notice { + background: url(../images/true.png) 8px 5px no-repeat; + background-color: #dfffdf; + border-color: #9fcf9f; + color: #005f00; +} + +div.flash.warning, .conflict { + background: url(../images/warning.png) 8px 5px no-repeat; + background-color: #FFEBC1; + border-color: #FDBF3B; + color: #A6750C; + text-align: left; +} + +.nodata, .warning { + text-align: center; + background-color: #FFEBC1; + border-color: #FDBF3B; + color: #A6750C; +} + +#errorExplanation ul { font-size: 0.9em;} +#errorExplanation h2, #errorExplanation p { display: none; } + +.conflict-details {font-size:80%;} +/***** end Flash & error messages ****/ + /*弹出框*/ .black_overlay{display:none;position:fixed;top:0px;left:0px;width:100%;height:100%;background-color:black;z-index:1001;-moz-opacity:0.8;opacity:.80;filter:alpha(opacity=80);} .white_content{display:none;position:fixed;top:15%;left:30%;width:420px;height: auto; margin-bottom:20px;padding:16px;border:3px solid #15bccf;background-color:white;z-index:1002;overflow:auto;} From 20d97848e78423da5a22cc2c233162b68eb1c5ee Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 23 Mar 2015 18:51:59 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=BB=98=E8=AE=A4=E5=80=BC=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_new_homework_form.html.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/bids/_new_homework_form.html.erb b/app/views/bids/_new_homework_form.html.erb index ae091159a..b9aaf7184 100644 --- a/app/views/bids/_new_homework_form.html.erb +++ b/app/views/bids/_new_homework_form.html.erb @@ -13,22 +13,22 @@
  • - +
  • - + <%= calendar_for('bid_deadline')%>
  • - +
  • - + <%= l(:label_evaluation_description)%>

  • From 37bd3383110469234b29f0aefcb3d4b2dcff1c00 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 23 Mar 2015 19:55:29 +0800 Subject: [PATCH 3/6] =?UTF-8?q?1=E3=80=81=E8=80=81=E5=B8=88=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BD=9C=E4=B8=9A=E5=A2=9E=E5=8A=A0=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC=E6=98=BE=E7=A4=BA=202=E3=80=81=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BD=9C=E4=B8=9A=E5=88=97=E8=A1=A8=E4=BF=AE?= =?UTF-8?q?=E6=94=B9layout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/bids_controller.rb | 21 +-- app/controllers/homework_attach_controller.rb | 2 +- app/views/bids/_new_homework_form.html.erb | 12 +- app/views/bids/edit.html.erb | 130 +----------------- app/views/courses/new_homework.html.erb | 2 +- public/stylesheets/css.css | 10 +- 6 files changed, 26 insertions(+), 151 deletions(-) diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index a22012390..ff9b018df 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -230,7 +230,7 @@ class BidsController < ApplicationController case @bid.reward_type when 3 html_title(l(:label_question_student)) - layout_file = 'base_homework' + layout_file = 'base_courses' when 1 layout_file = 'base_bids' else @@ -307,7 +307,7 @@ class BidsController < ApplicationController respond_to do |format| if @bid.reward_type == 3 format.html { - render :layout => 'base_homework' + render :layout => 'base_courses' } elsif @bid.reward_type == 1 format.html { @@ -333,7 +333,7 @@ class BidsController < ApplicationController respond_to do |format| if @bid.reward_type == 3 format.html { - render :layout => 'base_homework' + render :layout => 'base_courses' } elsif @bid.reward_type == 1 format.html { @@ -361,7 +361,7 @@ class BidsController < ApplicationController respond_to do |format| if @bid.reward_type == 3 format.html { - render :layout => 'base_homework' + render :layout => 'base_courses' } elsif @bid.reward_type == 1 format.html { @@ -439,7 +439,7 @@ class BidsController < ApplicationController respond_to do |format| if @bid.reward_type == 3 format.html { - render :layout => 'base_homework' + render :layout => 'base_courses' } elsif @bid.reward_type == 1 format.html { @@ -533,7 +533,7 @@ class BidsController < ApplicationController if @bid.reward_type == 3 format.html { html_title(l(:label_homework_info)) - render :layout => 'base_homework' + render :layout => 'base_courses' } elsif @bid.reward_type == 1 format.html { @@ -565,7 +565,7 @@ class BidsController < ApplicationController respond_to do |format| if @bid.reward_type == 3 format.html { - render :layout => 'base_homework' + render :layout => 'base_courses' } elsif @bid.reward_type == 1 format.html { @@ -879,7 +879,7 @@ class BidsController < ApplicationController #render html to prepare create submit homework find_bid find_bid - render :layout => 'base_homework' + render :layout => 'base_courses' end def add_homework @@ -942,12 +942,12 @@ class BidsController < ApplicationController @homework_type = false end @user = @bid.author - render :layout => 'base_homework' + render :layout => 'base_courses' end def homework_respond @user = @bid.author - render :layout => 'base_homework' + render :layout => 'base_courses' end def more @@ -1070,6 +1070,7 @@ class BidsController < ApplicationController if params[:id] @bid = Bid.find(params[:id], :include => [{:homeworks => :user}]) @user = @bid.author + @course = @bid.courses.first end rescue render_404 diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index ba7e92467..e563d997d 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -1,5 +1,5 @@ class HomeworkAttachController < ApplicationController - layout "course_base" + layout "base_courses" include CoursesHelper include HomeworkAttachHelper helper :words diff --git a/app/views/bids/_new_homework_form.html.erb b/app/views/bids/_new_homework_form.html.erb index b9aaf7184..eeaaa602e 100644 --- a/app/views/bids/_new_homework_form.html.erb +++ b/app/views/bids/_new_homework_form.html.erb @@ -8,33 +8,33 @@