From fcb9978a05cc470952e119f5c8ccc23f710acef3 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 2 Sep 2015 16:21:47 +0800 Subject: [PATCH 01/14] =?UTF-8?q?=E6=B6=88=E6=81=AF=E9=BC=A0=E6=A0=87?= =?UTF-8?q?=E7=BB=8F=E8=BF=87=E6=97=B6=E6=98=BE=E7=A4=BAhtml=E5=86=85?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_messages.html.erb | 30 ++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index d965c92e7..33c51760c 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -52,7 +52,11 @@
  • <%= link_to ma.course_message.comments.html_safe, {:controller => 'news', :action => 'show', :id => ma.course_message.commented.id }, :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", - :title => "#{ma.course_message.comments.html_safe}" %>
  • + :onmouseover =>"message_titile_show($(this),event)", + :onmouseout => "message_titile_hide($(this))" %> +
    + <%= ma.course_message.comments.html_safe %> +
  • <%= time_tag(ma.created_at).html_safe %>
  • <% end %> @@ -180,7 +184,9 @@ ">评论了新闻:
  • <%= link_to "#{ma.forge_message.comments.html_safe}", - {:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ma.forge_message.comments.html_safe}"%>
  • + {:controller => 'news', :action => 'show', :id => ma.forge_message.commented.id },:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", + :title => "#{ma.forge_message.comments.html_safe}" %> +
  • <%= time_tag(ma.created_at).html_safe %>
  • <% end %> @@ -197,7 +203,7 @@ " ><%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %>
  • - <%= link_to ma.memo.parent_id.nil? ? ma.memo.subject : ma.memo.content, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ma.memo.parent_id.nil? ? ma.memo.subject : ma.memo.content}" %> + <%= link_to ma.memo.parent_id.nil? ? ma.memo.subject : ma.memo.content.html_safe, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ma.memo.parent_id.nil? ? ma.memo.subject : ma.memo.content}" %>
  • <%= time_tag(ma.memo.created_at).html_safe %>
  • @@ -215,8 +221,13 @@ "><%= ma.journals_for_message.reply_id == 0 ? "给你留言了:" : "回复了你的留言:" %>
  • - <%= link_to ma.journals_for_message.notes.html_safe, feedback_path(ma.journals_for_message.jour_id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ma.journals_for_message.notes}" %> + <%= link_to ma.journals_for_message.notes.html_safe, feedback_path(ma.journals_for_message.jour_id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", + :onmouseover =>"message_titile_show($(this),event)", + :onmouseout => "message_titile_hide($(this))" %>
  • +
    + <%= ma.journals_for_message.notes.html_safe %> +
  • <%= time_tag(ma.journals_for_message.created_on).html_safe %>
  • @@ -236,6 +247,17 @@ + From 273e1ea6b1c05b22500e9c904e0d0715a1a53fe4 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 2 Sep 2015 17:08:20 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E5=8C=BA=E5=BC=95=E7=94=A8=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/project.css | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index a22831b2c..a4eaa7f0a 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -391,16 +391,17 @@ blockquote { border-right: 1px solid #e0e0e0; border-top: 1px solid #e0e0e0; border-bottom: 1px solid #e0e0e0; - padding-left: .6em; - padding-top: .6em; - padding-right: .6em; - padding-bottom: .6em; + padding-left: 0.6em; + padding-top: 0.6em; + padding-right: 0.6em; + padding-bottom: 0.6em; margin-left: 1.4em; - margin-right: .4em; + margin-right: 0.4em; border-radius: 4px; font-family: "Microsoft YaHei"; - background: url(http://test.forge.trustie.net/images/requirements/xreference.jpg.pagespeed.ic.h4inUJNyH0.jpg); + /*background: url('../images/requirements/reference.jpg');*/ background-size: 100% 100%; + margin-top:5px; } /*上传项目图片*/ .upload_file{margin-left: -60px;margin-top: 40px;width: 50px;position: absolute;height: 24px;opacity: 0;cursor: pointer} From 4c76292e5e9876c1f179d2f0b416957ace91adf3 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 2 Sep 2015 18:00:36 +0800 Subject: [PATCH 03/14] message--viewed --- app/controllers/student_work_controller.rb | 8 ++++++++ app/controllers/users_controller.rb | 20 ++++++++++---------- public/stylesheets/new_user.css | 2 +- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 7726ab3da..ea4dd404a 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -43,6 +43,14 @@ class StudentWorkController < ApplicationController end def index + # 消息状态更新 + @homework.course_messages.each do |homework_message| + if User.current.id == homework_message.user_id + homework_message.update_attributes(:viewed => true) + end + end + + # 消息end #设置作业对应的forge_messages表的viewed字段 query_student_work = @homework.course_messages query_student_work.each do |query| diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 281924f55..1fac6737b 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -106,16 +106,16 @@ class UsersController < ApplicationController return end # 当前用户查看消息,则设置消息为已读 - course_querys = @user.course_messages - forge_querys = @user.forge_messages - user_querys = @user.user_feedback_messages - forum_querys = @user.memo_messages - if User.current.id == @user.id - course_querys.update_all(:viewed => true) - forge_querys.update_all(:viewed => true) - user_querys.update_all(:viewed => true) - forum_querys.update_all(:viewed => true) - end + # course_querys = @user.course_messages + # forge_querys = @user.forge_messages + # user_querys = @user.user_feedback_messages + # forum_querys = @user.memo_messages + # if User.current.id == @user.id + # course_querys.update_all(:viewed => true) + # forge_querys.update_all(:viewed => true) + # user_querys.update_all(:viewed => true) + # forum_querys.update_all(:viewed => true) + # end # @new_message_count = forge_querys.count + forum_querys.count + course_querys.count + user_querys.count case params[:type] when nil diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 0a6ed8d79..3167d96ca 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -525,7 +525,7 @@ a.replyGrey1 {color:#888888;} a.replyGrey1:hover {color:#4b4b4b;} a.newsBlue {color:#269ac9;} a.newsBlue:hover {color:#297fb8;} -a.newsBlack {color:#000000; font-size:13px; font-weight:bold} +a.newsBlack {color:#4b4b4b; font-size:13px; font-weight:bold} a.menuGrey {color:#808080;} a.menuGrey:hover {color:#fe7d68;} .navSearchTypeBox {width:368px; height:35px; position:absolute; border:1px solid #e1e1e1; background-color:#ffffff; padding-left:10px; display:none; color:#3e3e3e; font-size:14px;} From 0e68bbc5bd1b19afaa42d26ffa8df5aa24b8eadf Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 2 Sep 2015 18:32:29 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E6=A1=86=E9=AB=98=E5=BA=A6?= 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 f9ebece36..31f0efe81 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:"40px", + resizeType : 0,minWidth:"1px",width:"100%",minHeight:"28px", items:['emoticons'], afterChange:function(){//按键事件 nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea}); From 8b9eabd0275f71e86a7d3a1e19e191e53684317b Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 2 Sep 2015 18:35:12 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=AD=E6=B7=BB=E5=8A=A0=E6=89=93=E5=8D=B0=E6=94=B6=E6=8D=AE?= =?UTF-8?q?=20=E6=B7=BB=E5=8A=A0=E6=9C=AA=E8=AF=BB=E6=B6=88=E6=81=AF?= =?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/users_controller.rb | 22 ++++++++++--------- app/views/users/user_messages.html.erb | 5 +++++ db/migrate/20150829024549_course_messages.rb | 1 + .../20150829081822_update_message_time.rb | 1 + ...0150829130302_update_forge_message_time.rb | 1 + ...20150901004812_update_memo_message_time.rb | 1 + 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 1fac6737b..5bd124fb9 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -106,16 +106,18 @@ class UsersController < ApplicationController return end # 当前用户查看消息,则设置消息为已读 - # course_querys = @user.course_messages - # forge_querys = @user.forge_messages - # user_querys = @user.user_feedback_messages - # forum_querys = @user.memo_messages - # if User.current.id == @user.id - # course_querys.update_all(:viewed => true) - # forge_querys.update_all(:viewed => true) - # user_querys.update_all(:viewed => true) - # forum_querys.update_all(:viewed => true) - # end + if params[:viewed] == "all" + course_querys = @user.course_messages + forge_querys = @user.forge_messages + user_querys = @user.user_feedback_messages + forum_querys = @user.memo_messages + if User.current.id == @user.id + course_querys.update_all(:viewed => true) + forge_querys.update_all(:viewed => true) + user_querys.update_all(:viewed => true) + forum_querys.update_all(:viewed => true) + end + end # @new_message_count = forge_querys.count + forum_querys.count + course_querys.count + user_querys.count case params[:type] when nil diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index 33c51760c..31fd7a6bd 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -29,6 +29,11 @@
    +<% if params[:type].nil? %> +
    + 有 <%= User.current.count_new_message %> 封未读<%= link_to "全部设为已读", user_message_path(User.current, :viewed => 'all') %> +
    +<% end %> <% if @message_alls.count >0 %> <%# 课程消息 %> <% unless @message_alls.nil? %> diff --git a/db/migrate/20150829024549_course_messages.rb b/db/migrate/20150829024549_course_messages.rb index 666ccdaeb..34f4e9ef2 100644 --- a/db/migrate/20150829024549_course_messages.rb +++ b/db/migrate/20150829024549_course_messages.rb @@ -3,6 +3,7 @@ class CourseMessages < ActiveRecord::Migration def up Course.all.each do |course| transaction do + put course.id course.course_messages << CourseMessage.new(:user_id => course.tea_id,:course_id => course.id) # 作业 course.homework_commons.each do |homework_common| diff --git a/db/migrate/20150829081822_update_message_time.rb b/db/migrate/20150829081822_update_message_time.rb index fe670e9b8..09e42b6d1 100644 --- a/db/migrate/20150829081822_update_message_time.rb +++ b/db/migrate/20150829081822_update_message_time.rb @@ -11,6 +11,7 @@ class UpdateMessageTime < ActiveRecord::Migration cmessage.created_at = cmessage.course_message.created_on end cmessage.save + puts cmessage.id course_all_message = MessageAll.where("message_type = '#{cmessage.class.to_s}' and message_id = '#{cmessage.id}'").first course_all_message.created_at = cmessage.created_at diff --git a/db/migrate/20150829130302_update_forge_message_time.rb b/db/migrate/20150829130302_update_forge_message_time.rb index 70811c307..295cafea6 100644 --- a/db/migrate/20150829130302_update_forge_message_time.rb +++ b/db/migrate/20150829130302_update_forge_message_time.rb @@ -11,6 +11,7 @@ class UpdateForgeMessageTime < ActiveRecord::Migration fmessage.created_at = fmessage.forge_message.created_on end fmessage.save + puts fmessage.id forge_all_message = MessageAll.where("message_type = '#{fmessage.class.to_s}' and message_id = '#{fmessage.id}'").first forge_all_message.created_at = fmessage.created_at diff --git a/db/migrate/20150901004812_update_memo_message_time.rb b/db/migrate/20150901004812_update_memo_message_time.rb index e512282a0..80ae557fc 100644 --- a/db/migrate/20150901004812_update_memo_message_time.rb +++ b/db/migrate/20150901004812_update_memo_message_time.rb @@ -11,6 +11,7 @@ class UpdateMemoMessageTime < ActiveRecord::Migration memo_message.created_at = memo_message.memo.created_on end memo_message.save + puts memo_message.id memo_messages = MessageAll.where("message_type = '#{memo_message.class.to_s}' and message_id = '#{memo_message.id}'").first memo_messages.created_at = memo_message.created_at 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 06/14] =?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 b4ae6117180331d42b44eee92de8d4ac9779f153 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Wed, 2 Sep 2015 19:14:13 +0800 Subject: [PATCH 07/14] =?UTF-8?q?=E8=B4=B4=E5=90=A7=E4=BA=A4=E6=B5=81url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/_footer.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb index d6368b4a0..812873045 100644 --- a/app/views/layouts/_footer.html.erb +++ b/app/views/layouts/_footer.html.erb @@ -5,7 +5,7 @@
  • 服务协议|
  • <%= l(:label_surpport_group)%>|
  • -
  • <%= l(:label_forums)%>
  • +
  • <%= l(:label_forums)%>
  • From 7d6d349c4d16f5b166df29a6b196410c9c311b24 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 2 Sep 2015 19:35:51 +0800 Subject: [PATCH 08/14] =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E5=8C=BA=E9=BC=A0?= =?UTF-8?q?=E6=A0=87=E7=BB=8F=E8=BF=87=E6=98=BE=E7=A4=BAhtml=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_messages.html.erb | 60 ++++++++++++++++++++------ 1 file changed, 47 insertions(+), 13 deletions(-) diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index 33c51760c..3fbd76ee0 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -84,11 +84,21 @@ @@ -154,11 +164,23 @@
  • <%=link_to image_tag(url_to_avatar(ma.forge_message.author), :width => "30", :height => "30"), user_path(ma.forge_message.author) %>
  • <%=link_to ma.forge_message.author, user_path(ma.forge_message.author), :class => "newsBlue homepageNewsPublisher" %> "><%= ma.forge_message.parent_id.nil? ? "发布了项目帖子:" : "评论了项目帖子:" %>
  • -
  • - <%=link_to ma.forge_message.parent_id.nil? ? ma.forge_message.subject.html_safe : ma.forge_message.content.html_safe, project_boards_path(ma.forge_message.project, - :parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id, - :topic_id => ma.forge_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}", - :title => "#{ma.forge_message.subject.html_safe}" %>
  • + <% if ma.forge_message.parent_id.nil? %> +
  • + <%=link_to ma.forge_message.subject, project_boards_path(ma.forge_message.project, + :parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id, + :topic_id => ma.forge_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}", + :title => "#{ma.forge_message.subject.html_safe}" %>
  • + <% else %> +
  • + <%=link_to ma.forge_message.content.html_safe, project_boards_path(ma.forge_message.project, + :parent_id => ma.forge_message.parent_id ? ma.forge_message.parent_id : ma.forge_message.id, + :topic_id => ma.forge_message.id),:class=>"#{ma.viewed==0?"newsBlack":"newsGrey"}", + :onmouseover =>"message_titile_show($(this),event)", + :onmouseout => "message_titile_hide($(this))" %>
  • +
    + <%= ma.forge_message.content.html_safe %> +
    + <% end %>
  • <%= time_tag(ma.created_at).html_safe %>
  • <% end %> @@ -202,9 +224,21 @@ <%=link_to ma.memo.author, user_path(ma.memo.author), :class => "newsBlue homepageNewsPublisher" %> " ><%= ma.memo.parent_id.nil? ? "在贴吧发布帖子:" : "回复了贴吧帖子:" %> -
  • - <%= link_to ma.memo.parent_id.nil? ? ma.memo.subject : ma.memo.content.html_safe, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ma.memo.parent_id.nil? ? ma.memo.subject : ma.memo.content}" %> -
  • + <% if ma.memo.parent_id.nil? %> +
  • + <%= link_to ma.memo.subject, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", + :title => "#{ma.memo.subject}" %> +
  • + <% else %> +
  • + <%= link_to ma.memo.content.html_safe, forum_memo_path(ma.memo.forum_id, ma.memo.parent_id ? ma.memo.parent_id: ma.memo.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", + :onmouseover =>"message_titile_show($(this),event)", + :onmouseout => "message_titile_hide($(this))" %> +
  • +
    + <%= ma.memo.content.html_safe %> +
    + <% end %>
  • <%= time_tag(ma.memo.created_at).html_safe %>
  • <% end %> 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 09/14] =?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 10/14] =?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 11/14] =?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 12/14] =?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 13/14] =?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" %>