From dd4e67ebdb2ab95446d3269904eef026f82993a8 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Wed, 2 Sep 2015 18:09:52 +0800 Subject: [PATCH 01/39] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=8F=90=E4=BA=A4=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 7726ab3da..3628f1d9b 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -134,6 +134,7 @@ class StudentWorkController < ApplicationController end def new + redirect_to new_user_commit_homework_users_path(homework_id: @homework.id) if @homework.homework_type==2 @student_work = @homework.student_works.where("user_id = ?",User.current.id).first if @student_work.nil? @student_work = StudentWork.new From c2bfbfecee41181fe0693fd68793d1e060ef41ab Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 2 Sep 2015 19:11:34 +0800 Subject: [PATCH 02/39] =?UTF-8?q?=E7=BC=96=E8=BE=91=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/homework_common/index.html.erb | 1 - app/views/student_work/index.html.erb | 1 - 2 files changed, 2 deletions(-) diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index 44e1b43b6..bbf4aa343 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -28,7 +28,6 @@ <%= homework_anonymous_comment(homework)%> <%= link_to(l(:label_bid_respond_delete), homework_common_path(homework),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "fr mr10 work_edit") %> <%#= link_to(l(:button_edit),edit_homework_common_path(homework), :class => "fr mr10 work_edit") %> - <%= link_to(l(:button_edit),"javascript:void(0)", :class => "fr mr10 un_work_edit",:title => "编辑功能正在维护中") %> <% elsif @is_student%> <%= student_anonymous_comment homework %> <%= student_new_homework homework %> diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 82f412eb3..776af3b3e 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -124,7 +124,6 @@ <% if @is_teacher%> <%= homework_anonymous_comment(@homework)%> - <%= link_to(l(:button_edit),"javascript:void(0)", :class => "fr mr10 un_work_edit",:title => "编辑功能正在维护中") %> <% else%> <%= student_anonymous_comment @homework %> <%= student_new_homework @homework %> From 6a6fbea446d71b47b901bd6b355e78a10c123b7b Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 2 Sep 2015 19:41:45 +0800 Subject: [PATCH 03/39] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BD=9C=E5=93=81?= =?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/controllers/student_work_controller.rb | 4 + app/helpers/student_work_helper.rb | 2 + app/views/student_work/new.html.erb | 141 +++++++++++---------- public/stylesheets/new_user.css | 47 +++++++ 4 files changed, 124 insertions(+), 70 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 7726ab3da..30922230e 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -134,10 +134,14 @@ class StudentWorkController < ApplicationController end def new + @user = User.current @student_work = @homework.student_works.where("user_id = ?",User.current.id).first if @student_work.nil? @student_work = StudentWork.new end + respond_to do |format| + format.html{ render :layout => "new_base_user"} + end end def create diff --git a/app/helpers/student_work_helper.rb b/app/helpers/student_work_helper.rb index f24d5078f..bff997ba4 100644 --- a/app/helpers/student_work_helper.rb +++ b/app/helpers/student_work_helper.rb @@ -1,4 +1,6 @@ # encoding: utf-8 +include UserScoreHelper + module StudentWorkHelper def user_projects_option cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1" diff --git a/app/views/student_work/new.html.erb b/app/views/student_work/new.html.erb index 8d27f31aa..dbda0b863 100644 --- a/app/views/student_work/new.html.erb +++ b/app/views/student_work/new.html.erb @@ -17,75 +17,77 @@ }); <% end%> -
-

创建作品

-
-
-
-
- <%= form_for(@student_work, - :html => { :multipart => true }, - :url => {:controller => 'student_work', - :action => 'create', - :homework => @homework.id - }) do |f|%> -
- <% if @homework.homework_type == 1%> -
- 提示:匿评作业提交的作品,作品名称和描述中不能出现真实的姓名信息 -
+
+
+
提交作品
+
+
+
+
+ <%= form_for(@student_work, + :html => { :multipart => true }, + :url => {:controller => 'student_work', + :action => 'create', + :homework => @homework.id + }) do |f|%> +
+ <% if @homework.homework_type == 1%> +
+ 提示:匿评作业提交的作品,作品名称和描述中不能出现真实的姓名信息 +
+ <% end%> +

+ + <%= f.text_field "name", :required => true, :size => 60, :class => "bo fl", :maxlength => 200, :placeholder => "作品名称", :onkeyup => "regexStudentWorkName();" %> + <% if @homework.homework_type != 2%> + + 项目信息 + + + <% end%> +

+

+

+
+

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

+
+

+ + <% if @homework.homework_type == 2 && @homework.homework_detail_programing%> + <%= f.text_area "description", :class => "w620 hwork_txt h400", :placeholder => "作品描述不能为空", :onkeyup => "regexStudentWorkDescription();", :value => @homework.homework_detail_programing.language == "1" ? c_stantard_code_student : c_stantard_code_student_%> + <% else %> + <%= f.text_area "description", :class => "w620 hwork_txt", :placeholder => "作品描述不能为空", :onkeyup => "regexStudentWorkDescription();"%> + <% end%> +

+

+

+
+ <% if @homework.homework_type != 2%> +

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

+
+ <% end%> +

+ 提交作品 + <%= link_to "返  回".html_safe, student_work_index_path(:homework => @homework), :class => "blue_btn grey_btn fl c_white"%> +

+

+
<% end%> -

- - <%= f.text_field "name", :required => true, :size => 60, :class => "bo fl", :maxlength => 200, :placeholder => "作品名称", :onkeyup => "regexStudentWorkName();" %> - <% if @homework.homework_type != 2%> - - 项目信息 - - - <% end%> -

-

-

-
-

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

-
-

- - <% if @homework.homework_type == 2 && @homework.homework_detail_programing%> - <%= f.text_area "description", :class => "w620 hwork_txt h400", :placeholder => "作品描述不能为空", :onkeyup => "regexStudentWorkDescription();", :value => @homework.homework_detail_programing.language == "1" ? c_stantard_code_student : c_stantard_code_student_%> - <% else %> - <%= f.text_area "description", :class => "w620 hwork_txt", :placeholder => "作品描述不能为空", :onkeyup => "regexStudentWorkDescription();"%> - <% end%> -

-

-

-
- <% if @homework.homework_type != 2%> -

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

-
- <% end%> -

- 提交作品 - <%= link_to "返  回".html_safe, student_work_index_path(:homework => @homework), :class => "blue_btn grey_btn fl c_white"%> -

-

-
- <% end%> +
+
+
+
-
-
-
<% else %> @@ -125,8 +127,8 @@ -
-
+ +
提交作品
@@ -201,6 +203,5 @@ <% end %> <% end %>
-
<% end %> diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index e05be1c6a..aae06215b 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -953,3 +953,50 @@ blockquote { background-color: #e8e8e8; } +/* 创建作品 work */ +.Newwork{ width:668px; height:418px;} +.N_top{ float:right; margin-left:390px; } +.N_con{ color:#484747; font-weight:bold; width:660px; margin-top:10px; } +.N_con p{ } +.w430{ width:470px;} +.w557{ width:557px;} +.w350{ width:350px;} +.h400{height: 400px !important;} +.w620{ width:480px; height:160px; border:1px solid #CCC;} +.bo{height:26px; border:1px solid #CCC; padding-left:5px; background:#fff;width:470px; } +.bo02{height:26px; border:1px solid #CCC; padding-left:5px; background:#fff;width:480px; margin-left:2px; color: #999; } +.hwork_txt{ width:560px; padding-left:5px; background:#fff;} +a.tijiao{ height:28px; display:block; width:80px; color:#fff; background:#15bccf; text-align:center; padding-top:4px; float:left; margin-right:10px;} +a:hover.tijiao{ background:#0f99a9;} +.members_left{ float:left; width:410px; margin-right:20px; text-align:center;} +.members_left{} +.members_left ul li{ height:30px; border-bottom:1px solid #E4E4E4; width:410px; padding-top:10px; } +.members_left ul li a{ float:left; text-align:center;} +.members_left ul li span{ float:left; text-align:center; color:#484747;} +.w150{ text-align:center; width:150px;min-height: 10px;} +.f_b{ font-weight: bold;} +.members_right label{ margin-left:15px;} +.N_search{ height:20px; border:1px solid #999;} +/* 创建作品 homework */ +.hwork_new{ color:#4c4c4c;} +.c_red{ color:#F00;} +.hwork_input{ border:1px solid #64bdd9; height:22px; width:88%; background:#fff; margin-bottom:10px; padding:5px;} +.hwork_input02{ border:1px solid #64bdd9; height:15px; width:140px; background:#fff; margin-bottom:10px; padding:5px;} +.hwork_text{ border:1px solid #64bdd9; height:100px;width:555px; background:#fff; margin-left:5px; padding:5px; margin-bottom:10px;} +.hwork_new ul li{ } +.ml21{ margin-left:21px;} +.ml9{ margin-left:9px;} +.hwork_ttl{height:24px;} +.hwork_ctt{height:auto; padding-left:10px;clear:both;} +.hwork_tb_{ border-bottom:3px solid #e4e4e4; text-align:center;} +.hwork_tb_ ul{height:24px;} +.hwork_tb_ li{float:left;height: 24px;width: auto; padding:0 10px;cursor:pointer;} +.hwork_normaltab { color:#15bccf ; border-bottom:3px solid #e4e4e4; } +.hwork_hovertab { color:#656767; font-weight:bold; border-bottom:3px solid #15bccf; } + +.hwork_dis{display:block; } +.hwork_undis{display:none;} +.project_none{ display:none;} +.about_project{ overflow:hidden;display:none;} +.project_r_h{ width:670px; height:40px; background:#eaeaea; margin-bottom:10px;} +.project_r_h02{ width:920px; height:40px; background:#eaeaea; margin-bottom:10px;} From 893ae35039c579a96b189e86583a411bf0f64e6e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 2 Sep 2015 19:52:44 +0800 Subject: [PATCH 04/39] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E3=80=81=E7=BC=96=E8=BE=91=E4=BD=9C=E5=93=81=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 3 +- app/views/attachments/_new_form.html.erb | 1 + app/views/student_work/edit.html.erb | 92 +++++++++++----------- app/views/student_work/new.html.erb | 4 +- public/javascripts/new_user.js | 46 +++++++++++ public/stylesheets/new_user.css | 2 +- 6 files changed, 99 insertions(+), 49 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 30922230e..61105bc45 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -182,11 +182,12 @@ class StudentWorkController < ApplicationController end def edit + @user = User.current if !User.current.admin? && @homework.homework_type == 2 #编程作业不能修改作业 render_403 else respond_to do |format| - format.html + format.html{ render :layout => "new_base_user"} end end end diff --git a/app/views/attachments/_new_form.html.erb b/app/views/attachments/_new_form.html.erb index 38b471897..47f6fd202 100644 --- a/app/views/attachments/_new_form.html.erb +++ b/app/views/attachments/_new_form.html.erb @@ -23,6 +23,7 @@ <% end %> <% end %> +
<% project = project %> <%= button_tag l(:button_browse), :type=>"button", :onclick=>"_file.click()",:onmouseover => 'this.focus()',:class => 'sub_btn', :style => ie8? ? 'display:none' : '' %> diff --git a/app/views/student_work/edit.html.erb b/app/views/student_work/edit.html.erb index 6e36447d2..5bb362b46 100644 --- a/app/views/student_work/edit.html.erb +++ b/app/views/student_work/edit.html.erb @@ -1,52 +1,54 @@ -
-

编辑作品

-
-
-
-
- <%= labelled_form_for @work,:html => { :multipart => true } do |f|%> -
-

- - - 项目信息 - - -

-

-

-
+
+
+
编辑作品
+
+
+
+
+ <%= labelled_form_for @work,:html => { :multipart => true } do |f|%> +
+

+ + + 项目信息 + + +

+

+

+
-

- - <%= f.select :project,options_for_select(user_projects_option,@work.project_id), {},{:class => "bo02 mb10"} %> -

-
+

+ + <%= f.select :project,options_for_select(user_projects_option,@work.project_id), {},{:class => "bo02 mb10"} %> +

+
-

- - -

-

-
-

- - <%= render :partial => 'attachments/new_form',:locals => {:container => @work} %> -

-
-

- 提交作品 - <%= link_to "返  回".html_safe, student_work_index_path(:homework => @homework), :class => "blue_btn grey_btn fl c_white"%> -

-

-
- <% end%> +

+ + +

+

+
+

+ + <%= render :partial => 'attachments/new_form',:locals => {:container => @work} %> +

+
+

+ 提交作品 + <%= link_to "返  回".html_safe, student_work_index_path(:homework => @homework), :class => "blue_btn grey_btn fl c_white mt10 ml10"%> +

+

+
+ <% end%> +
-
+
diff --git a/app/views/student_work/new.html.erb b/app/views/student_work/new.html.erb index dbda0b863..f0f4d8e7c 100644 --- a/app/views/student_work/new.html.erb +++ b/app/views/student_work/new.html.erb @@ -77,8 +77,8 @@
<% end%>

- 提交作品 - <%= link_to "返  回".html_safe, student_work_index_path(:homework => @homework), :class => "blue_btn grey_btn fl c_white"%> + 提交作品 + <%= link_to "返  回".html_safe, student_work_index_path(:homework => @homework), :class => "blue_btn grey_btn fl c_white mt10 ml10"%>

diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index 3607c3f09..fdf739bd0 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -131,4 +131,50 @@ function search_homework_by_name(url){ function (data) { } ); +} + +//提交新建作品 +function new_student_work() +{ + if(regexStudentWorkName()&®exStudentWorkDescription()) + {$("#new_student_work").submit();} +} + +function edit_student_work(id) +{ + if(regexStudentWorkName()&®exStudentWorkDescription()) + {$("#edit_student_work_" + id).submit();} +} + +//验证作品名称 +function regexStudentWorkName() +{ + var name = $.trim($("#student_work_name").val()); + + if(name=="") + { + $("#student_work_name_span").text("作品名称不能为空"); + return false; + } + else + { + $("#student_work_name_span").text(""); + return true; + } +} + +function regexStudentWorkDescription() +{ + var name = $.trim($("#student_work_description").val()); + + if(name=="") + { + $("#student_work_description_textarea").text("作品描述不能为空"); + return false; + } + else + { + $("#student_work_description_textarea").text(""); + return true; + } } \ No newline at end of file diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index aae06215b..e15509580 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -187,7 +187,7 @@ a:hover.grey_n_btn{ background:#717171; color:#fff;} .green_btn{ background:#28be6c; color:#fff; font-weight:normal;padding:2px 10px; text-align:center;} a.green_btn{background:#28be6c;color:#fff; font-weight:normal; padding:2px 10px; text-align:center;} a:hover.green_btn{ background:#14ad5a;} -.blue_btn{ background:#64bdd9; color:#fff; font-weight:normal;padding:2px 10px; text-align:center;} +.blue_btn{ background:#64bdd9; color:#fff; font-size:14px; font-weight:normal;padding:2px 8px; text-align:center;} a.blue_btn{background:#64bdd9;color:#fff; font-weight:normal; padding:2px 10px; text-align:center;} a:hover.blue_btn{ background:#329cbd;} a.orange_btn{ background:#ff5722;color:#fff; font-weight:normal; padding:2px 10px; text-align:center; } From c7f15d3a3e2ac82d3685d5f01341948225c66138 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 2 Sep 2015 20:06:47 +0800 Subject: [PATCH 05/39] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=95=99=E8=A8=80html?= =?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/users/user_messages.html.erb | 12 ++++++------ public/stylesheets/new_user.css | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index 29020560d..5a17d5912 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -59,7 +59,7 @@ :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :onmouseover =>"message_titile_show($(this),event)", :onmouseout => "message_titile_hide($(this))" %> -
+
  • <%= time_tag(ma.created_at).html_safe %>
  • @@ -100,7 +100,7 @@ :class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :onmouseover =>"message_titile_show($(this),event)", :onmouseout => "message_titile_hide($(this))" %> -
    + <% end %> @@ -182,7 +182,7 @@ :topic_id => ma.forge_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}", :onmouseover =>"message_titile_show($(this),event)", :onmouseout => "message_titile_hide($(this))" %> -
    + <% end %> @@ -240,7 +240,7 @@ :onmouseover =>"message_titile_show($(this),event)", :onmouseout => "message_titile_hide($(this))" %> -
    + <% end %> @@ -264,7 +264,7 @@ :onmouseover =>"message_titile_show($(this),event)", :onmouseout => "message_titile_hide($(this))" %> -
    +
  • <%= time_tag(ma.journals_for_message.created_on).html_safe %>
  • @@ -290,7 +290,7 @@ function message_titile_show(obj,e) { obj.parent().next("div").show(); - obj.parent().next("div").css("top",e.pageY).css("left",e.pageX).css("position","fixed"); + obj.parent().next("div").css("top",e.pageY).css("left",e.pageX).css("position","absolute"); } function message_titile_hide(obj) { diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index e65afbe1e..7efea68a3 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -925,6 +925,7 @@ img.ui-datepicker-trigger { text-overflow: ellipsis; margin-bottom: 3px; } +.message_title{border: 1px solid #D4D4D4;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #E8E8E8;} .description{display: none !important;} .ispublic-label{display: none !important;} .is_public_checkbox{display: none !important;} From ee60905eda5d9a02fdb9d942b87cda3a5747175f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 2 Sep 2015 21:00:08 +0800 Subject: [PATCH 06/39] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E4=B9=8B=E5=90=8E?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E6=A1=86=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/init_KindEditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/javascripts/init_KindEditor.js b/public/javascripts/init_KindEditor.js index 31f0efe81..fc02146bb 100644 --- a/public/javascripts/init_KindEditor.js +++ b/public/javascripts/init_KindEditor.js @@ -1,6 +1,6 @@ function init_editor(params){ var editor = params.kindutil.create(params.textarea, { - resizeType : 0,minWidth:"1px",width:"100%",minHeight:"28px", + resizeType : 1,minWidth:"1px",width:"100%",height:"80px", items:['emoticons'], afterChange:function(){//按键事件 nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea}); From 7424c82eae766fc6d45641fc1f96b80295256105 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 2 Sep 2015 21:30:31 +0800 Subject: [PATCH 07/39] =?UTF-8?q?=E7=95=99=E8=A8=80=E6=A1=86=E9=AB=98?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_courses_jours.html.erb | 1 + app/views/users/user_newfeedback.html.erb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb index c90dbf724..5ce51ff7b 100644 --- a/app/views/courses/_courses_jours.html.erb +++ b/app/views/courses/_courses_jours.html.erb @@ -10,6 +10,7 @@ div.respond-form .reply_btn{margin-left:565px;margin-top:5px;} div.recall_con{width:570px;} div.recall_con .reply_btn{margin-left:525px;margin-top:5px;} + .ke-container{height: 80px !important;} <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_KindEditor" %>