From c579ee51feb4dc233247dda4a65340ae46f409fe Mon Sep 17 00:00:00 2001 From: huang Date: Sun, 6 Sep 2015 15:31:48 +0800 Subject: [PATCH 001/385] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/onclick_time.rb | 3 ++ .../20150906065702_create_onclick_times.rb | 10 +++++ db/schema.rb | 42 ++++++++++++------- spec/factories/onclick_times.rb | 7 ++++ spec/models/onclick_time_spec.rb | 5 +++ 5 files changed, 51 insertions(+), 16 deletions(-) create mode 100644 app/models/onclick_time.rb create mode 100644 db/migrate/20150906065702_create_onclick_times.rb create mode 100644 spec/factories/onclick_times.rb create mode 100644 spec/models/onclick_time_spec.rb diff --git a/app/models/onclick_time.rb b/app/models/onclick_time.rb new file mode 100644 index 000000000..16b17ea9a --- /dev/null +++ b/app/models/onclick_time.rb @@ -0,0 +1,3 @@ +class OnclickTime < ActiveRecord::Base + attr_accessible :onclick_time, :user_id +end diff --git a/db/migrate/20150906065702_create_onclick_times.rb b/db/migrate/20150906065702_create_onclick_times.rb new file mode 100644 index 000000000..3922b775e --- /dev/null +++ b/db/migrate/20150906065702_create_onclick_times.rb @@ -0,0 +1,10 @@ +class CreateOnclickTimes < ActiveRecord::Migration + def change + create_table :onclick_times do |t| + t.integer :user_id + t.datetime :onclick_time + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 5bf838c25..5867a62e5 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150906025009) do +ActiveRecord::Schema.define(:version => 20150906065702) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -497,23 +497,26 @@ ActiveRecord::Schema.define(:version => 20150906025009) do add_index "documents", ["created_on"], :name => "index_documents_on_created_on" add_index "documents", ["project_id"], :name => "documents_project_id" - create_table "dts", :force => true do |t| - t.string "IPLineCode" - t.string "Description" - t.string "Num" - t.string "Variable" - t.string "TraceInfo" - t.string "Method" + create_table "dts", :primary_key => "Num", :force => true do |t| + t.string "Defect", :limit => 50 + t.string "Category", :limit => 50 t.string "File" - t.string "IPLine" - t.string "Review" - t.string "Category" - t.string "Defect" - t.string "PreConditions" - t.string "StartLine" + t.string "Method" + t.string "Module", :limit => 20 + t.string "Variable", :limit => 50 + t.integer "StartLine" + t.integer "IPLine" + t.string "IPLineCode", :limit => 200 + t.string "Judge", :limit => 15 + t.integer "Review", :limit => 1 + t.string "Description" + t.text "PreConditions", :limit => 2147483647 + t.text "TraceInfo", :limit => 2147483647 + t.text "Code", :limit => 2147483647 t.integer "project_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.integer "id", :null => false end create_table "enabled_modules", :force => true do |t| @@ -936,6 +939,13 @@ ActiveRecord::Schema.define(:version => 20150906025009) do t.datetime "updated_at", :null => false end + create_table "onclick_times", :force => true do |t| + t.integer "user_id" + t.datetime "onclick_time" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "open_id_authentication_associations", :force => true do |t| t.integer "issued" t.integer "lifetime" diff --git a/spec/factories/onclick_times.rb b/spec/factories/onclick_times.rb new file mode 100644 index 000000000..fcdda983d --- /dev/null +++ b/spec/factories/onclick_times.rb @@ -0,0 +1,7 @@ +FactoryGirl.define do + factory :onclick_time do + user_id 1 +onclick_time "2015-09-06 14:57:02" + end + +end diff --git a/spec/models/onclick_time_spec.rb b/spec/models/onclick_time_spec.rb new file mode 100644 index 000000000..bc453f545 --- /dev/null +++ b/spec/models/onclick_time_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe OnclickTime, :type => :model do + pending "add some examples to (or delete) #{__FILE__}" +end From ed5f14c9ebb2c0a3b06c3cd1d772ddca29eff7a8 Mon Sep 17 00:00:00 2001 From: huang Date: Sun, 6 Sep 2015 17:42:10 +0800 Subject: [PATCH 002/385] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 859f19f19..7744f20a4 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -105,6 +105,16 @@ class UsersController < ApplicationController redirect_to signin_url return end + # 记录当前点击按钮的时间 + if OnclickTime.where("user_id =?", User.current).first.nil? + message_new_time = OnclickTime.new + message_new_time.user_id = User.current.id + message_new_time.onclick_time = Time.now + message_new_time.save + else + message_new_time = OnclickTime.where("user_id =?", User.current) + message_new_time.update_attributes(:onclick_time => Time.now) + end # 当前用户查看消息,则设置消息为已读 if params[:viewed] == "all" course_querys = @user.course_messages From ecd0056f0a8219e982b495a2978a4179b313e7eb Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 7 Sep 2015 11:13:15 +0800 Subject: [PATCH 003/385] =?UTF-8?q?1=E3=80=81=E5=AE=8C=E6=88=90=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E7=82=B9=E5=87=BB=E8=AE=B0=E5=90=8E=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=BA=A2=E7=82=B9=E7=9A=84=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E3=80=82=202=E3=80=81=E9=A6=96=E6=AC=A1=E7=99=BB?= =?UTF-8?q?=E9=99=86=E4=BB=A5=E2=80=9C=E6=9C=80=E5=90=8E=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E2=80=9D=E4=B8=BA=E5=87=86=EF=BC=8C=E5=90=8E?= =?UTF-8?q?=E9=9D=A2=E4=BB=A5=E7=82=B9=E5=87=BB=E6=97=B6=E9=97=B4=E4=B8=BA?= =?UTF-8?q?=E5=87=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 2 +- app/models/onclick_time.rb | 2 ++ app/models/user.rb | 21 ++++++++++++++++----- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 7744f20a4..4bbb9848a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -112,7 +112,7 @@ class UsersController < ApplicationController message_new_time.onclick_time = Time.now message_new_time.save else - message_new_time = OnclickTime.where("user_id =?", User.current) + message_new_time = OnclickTime.where("user_id =?", User.current).first message_new_time.update_attributes(:onclick_time => Time.now) end # 当前用户查看消息,则设置消息为已读 diff --git a/app/models/onclick_time.rb b/app/models/onclick_time.rb index 16b17ea9a..c62a9274c 100644 --- a/app/models/onclick_time.rb +++ b/app/models/onclick_time.rb @@ -1,3 +1,5 @@ class OnclickTime < ActiveRecord::Base attr_accessible :onclick_time, :user_id + + belongs_to :user end diff --git a/app/models/user.rb b/app/models/user.rb index b08b29981..e7f4a8c50 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -132,6 +132,7 @@ class User < Principal has_many :course_messages has_many :memo_messages has_many :user_feedback_messages + has_one :onclick_time # 虚拟转换 has_many :new_jours, :as => :jour, :class_name => 'JournalsForMessage', :conditions => "status=1" @@ -209,7 +210,7 @@ class User < Principal before_save :update_hashed_password before_destroy :remove_references_before_destroy # added by fq - after_create :act_as_activity + after_create :act_as_activity, :add_onclick_time # end scope :in_group, lambda {|group| @@ -257,10 +258,16 @@ class User < Principal # 新消息统计 def count_new_message - course_count = CourseMessage.where("user_id =? and viewed =?", User.current.id, 0).count - forge_count = ForgeMessage.where("user_id =? and viewed =?", User.current.id, 0).count - user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =?", User.current.id, 0).count - user_memo_count = MemoMessage.where("user_id =? and viewed =?", User.current.id, 0).count + if OnclickTime.where("user_id =?", User.current).first.nil? + message_new_time = OnclickTime.new + message_new_time.user_id = User.current.id + message_new_time.onclick_time = User.current.last_login_on.nil? ? Time.now : User.current.last_login_on + message_new_time.save + end + course_count = CourseMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count + forge_count = ForgeMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count + user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count + user_memo_count = MemoMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count messages_count = course_count + forge_count + user_feedback_count + user_memo_count end @@ -994,6 +1001,10 @@ class User < Principal self.acts << Activity.new(:user_id => self.id) end + def add_onclick_time + self.onclick_time << OnclickTime.new(:user_id => self.id, :onclick_time => self.created_on) + end + # Removes references that are not handled by associations # Things that are not deleted are reassociated with the anonymous user def remove_references_before_destroy From ef011ad473178f18ab122cb9fcb97cc14a66f839 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 7 Sep 2015 15:23:34 +0800 Subject: [PATCH 004/385] =?UTF-8?q?=E9=A1=B9=E7=9B=AE--=E9=82=80=E8=AF=B7-?= =?UTF-8?q?-=E5=8F=91=E9=80=81=E9=82=AE=E4=BB=B6=E9=82=80=E8=AF=B7?= =?UTF-8?q?=E7=94=A8=E6=88=B7,=E5=AF=B9=E8=BE=93=E5=85=A5=E7=9A=84?= =?UTF-8?q?=E9=82=AE=E7=AE=B1=E5=90=8D=E8=BF=9B=E8=A1=8C=E5=88=A4=E6=96=AD?= =?UTF-8?q?=EF=BC=8C=E5=90=8C=E6=97=B6=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../projects/invite_members_by_mail.html.erb | 18 +++++++++++++----- public/stylesheets/public.css | 2 ++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/views/projects/invite_members_by_mail.html.erb b/app/views/projects/invite_members_by_mail.html.erb index 4c6ee47d8..8c951a485 100644 --- a/app/views/projects/invite_members_by_mail.html.erb +++ b/app/views/projects/invite_members_by_mail.html.erb @@ -24,16 +24,24 @@ if(email == "") { $("#valid_email").text("<%= l(:label_input_email_blank)%>"); + return false; } - else if (filter.test(email)) { - $("#valid_email").html(""); - return true; + else if(!filter.test(email)) + { + $("#valid_email").text("<%= l(:label_email_format_error)%>"); + return false; + } + else if(email.split('@')[0].length >= 20) + { + $("#valid_email").text("邮箱名过长,最长为20个字符"); + return false; } else { - $("#valid_email").text("<%= l(:label_email_format_error)%>"); + $("#valid_email").text(""); + return true; } - return false; + } function senderEmail(obj) diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 4cc859721..2288c4994 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -418,6 +418,8 @@ div.flash.notice { background-color: #dfffdf; border-color: #9fcf9f; color: #005f00; + word-wrap: break-word; + word-break: break-all } div.flash.warning, .conflict { From 103d61056d7d7ea0c8799a77581c52ce0b724e13 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 7 Sep 2015 16:08:04 +0800 Subject: [PATCH 005/385] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=9A=201=E3=80=81=E6=B7=BB=E5=8A=A0=E2=80=9C=E6=96=B0?= =?UTF-8?q?=E7=9A=84=E6=B6=88=E6=81=AF=E2=80=9D=E5=88=86=E7=B1=BB=202?= =?UTF-8?q?=E3=80=81=E6=96=B0=E6=B3=A8=E5=86=8C=E7=94=A8=E6=88=B7=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E7=82=B9=E5=87=BB=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 12 +++++++++++- app/helpers/users_helper.rb | 9 +++++++++ app/models/user.rb | 5 ++++- app/views/users/user_messages.html.erb | 6 +++--- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 4bbb9848a..f05fa891a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -106,6 +106,7 @@ class UsersController < ApplicationController return end # 记录当前点击按钮的时间 + # 考虑到用户未退出刷新消息页面 if OnclickTime.where("user_id =?", User.current).first.nil? message_new_time = OnclickTime.new message_new_time.user_id = User.current.id @@ -132,10 +133,19 @@ class UsersController < ApplicationController case params[:type] when nil @message_alls = [] - messages = MessageAll.where("user_id =?",@user).order("created_at desc") + messages = MessageAll.where("user_id =?" ,@user).order("created_at desc") messages.each do |message_all| @message_alls << message_all.message end + when 'unviewed' + @message_alls = [] + messages = MessageAll.where("user_id =?", @user).order("created_at desc") + messages.each do |message_all| + # 在点击或者刷新消息列表后未读的消息存放在数组 + if message_all.message.viewed == 0 + @message_alls << message_all.message + end + end when 'homework' @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "HomeworkCommon", @user).order("created_at desc") when 'course_message' diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 269630ec3..c806f3493 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -52,6 +52,15 @@ module UsersHelper end end + # 统计未读消息数 + def unviewed_message(user) + course_count = CourseMessage.where("user_id =? and viewed =?", user, 0).count + forge_count = ForgeMessage.where("user_id =? and viewed =?", user, 0).count + user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =?", user, 0).count + user_memo_count = MemoMessage.where("user_id =? and viewed =?", user, 0).count + messages_count = course_count + forge_count + user_feedback_count + user_memo_count + end + def user_mail_notification_options(user) user.valid_notification_options.collect {|o| [l(o.last), o.first]} end diff --git a/app/models/user.rb b/app/models/user.rb index e7f4a8c50..2ccc41783 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1001,8 +1001,11 @@ class User < Principal self.acts << Activity.new(:user_id => self.id) end + # 注册用户的时候消息默认点击时间为用户创建时间 def add_onclick_time - self.onclick_time << OnclickTime.new(:user_id => self.id, :onclick_time => self.created_on) + if OnclickTime.where("user_id =?" , self.id).first.nil? + OnclickTime.create(:user_id => self.id, :onclick_time => self.created_on) + end end # Removes references that are not handled by associations diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index c3c1a447b..6a6597af9 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -4,6 +4,7 @@
    • <%= link_to "全部",user_message_path(User.current), :class => "resourcesGrey" %>
    • +
    • <%= link_to "未读消息", user_message_path(User.current, :type => 'unviewed'), :class => "resourcesGrey" %>
    • <%# 课程相关消息 %>
    • <%= link_to "作业消息", user_message_path(User.current, :type => 'homework'), :class => "resourcesGrey" %>
    • <%= link_to "课程讨论",user_message_path(User.current, :type => 'course_message'), :class => "resourcesGrey" %>
    • @@ -22,16 +23,15 @@
    • <%= link_to "贴吧帖子", user_message_path(User.current, :type => 'forum'), :class => "resourcesGrey" %>
    • <%# 系统贴吧 %>
    • <%= link_to "用户留言",user_message_path(User.current, :type => 'user_feedback'), :class => "resourcesGrey" %>
    • -
  • -<% if params[:type].nil? %> +<% if params[:type].nil? || params[:type] == "unviewed" %> <% end %> <% if @message_alls.count >0 %> From 0a45e0848816d8d8b8aec37949429c56ebd4eb8f Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 7 Sep 2015 16:14:34 +0800 Subject: [PATCH 006/385] =?UTF-8?q?1=E3=80=81=E6=B6=88=E6=81=AF=E4=B8=BA0?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E4=B8=8D=E6=98=BE=E7=A4=BA=20?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=95=B0=E5=92=8C=E2=80=9C=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=B7=B2=E8=AF=BB=E2=80=9D=E3=80=82=202?= =?UTF-8?q?=E3=80=81=E6=B6=88=E6=81=AF=E4=B8=8D=E4=B8=BA=E7=A9=BA=EF=BC=8C?= =?UTF-8?q?=E6=9C=AA=E8=AF=BB=E6=B6=88=E6=81=AF=E4=B8=BA=E7=A9=BA=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=E4=B8=8D=E6=98=BE=E7=A4=BA=E2=80=9C=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E8=AE=BE=E4=B8=BA=E5=B7=B2=E8=AF=BB=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_messages.html.erb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index 6a6597af9..cd64fb227 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -29,12 +29,15 @@
    -<% if params[:type].nil? || params[:type] == "unviewed" %> - -<% end %> <% if @message_alls.count >0 %> + <% if params[:type].nil? || params[:type] == "unviewed" %> +
    + 有 <%= unviewed_message(@user) %> 条未读 + <% unless unviewed_message(@user) == 0 %> + <%= link_to "全部设为已读", user_message_path(User.current, :viewed => 'all') %> + <% end %> +
    + <% end %> <%# 课程消息 %> <% unless @message_alls.nil? %> <% @message_alls.each do |ma| %> From fb6688265c9748d1dfc6fb7ce0b5292d99388748 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 7 Sep 2015 17:16:25 +0800 Subject: [PATCH 007/385] =?UTF-8?q?wiki=E5=88=A0=E9=99=A4=E5=90=8E?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wiki_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index f74fbb04d..da6d48b8d 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -264,7 +264,7 @@ class WikiController < ApplicationController end @page.destroy respond_to do |format| - format.html { redirect_to project_wiki_index_url(@project) } + format.html {redirect_to edit_project_wiki_page_url @project, @page.title} format.api { render_api_ok } end end From 8d72a9a5390fafcc0b6f593765f3750d26cddcee Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 8 Sep 2015 09:22:15 +0800 Subject: [PATCH 008/385] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E9=A1=B9=E7=9B=AEbas?= =?UTF-8?q?e=E5=86=97=E4=BD=99=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_projects.html.erb | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index 425b720d9..ddafdab52 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -49,16 +49,6 @@ <%= link_to l(:field_homepage), home_path %> > <%=l(:label_project_hosting_platform) %> ><%= link_to @project.name, project_path(@project.id) %>

    - - - - - - - - - -
    From 4c73e00eafde6ee333cf7e42e72e75ec943564a6 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 8 Sep 2015 09:43:41 +0800 Subject: [PATCH 009/385] =?UTF-8?q?=E4=BD=9C=E5=93=81=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 9f8d25c7e..9bc7b52ed 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -67,13 +67,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 From ae2aa2feddcfe8f1d1f0ea89c2a047d15198b936 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 8 Sep 2015 14:14:49 +0800 Subject: [PATCH 010/385] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=89=80=E6=9C=89=E9=80=BB=E8=BE=91=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 9bc7b52ed..3ed5eb914 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -69,12 +69,21 @@ class StudentWorkController < ApplicationController def index # 作业消息状态更新 @homework.course_messages.each do |homework_message| - if User.current.id == homework_message.user_id - homework_message.update_attributes(:viewed => true) + if User.current.id == homework_message.user_id && homework_message.viewed == 0 + homework_message.update_attributes(:viewed => true) if homework_message.viewed == 0 end end - # 作品消息状态更新 - + # 作品打分消息状态更新 + studentworks_scores = CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =?", User.current.id, @homework.course, "StudentWorksScore", 0) + studentworks_scores.each do |studentworks_score| + studentworks_score.update_attributes(:viewed => true) if studentworks_score.viewed == 0 + end + # 作品评论消息状态更新 + journals_for_teacher = CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =?", User.current.id, @homework.course, "JournalsForMessage", 0) + journals_for_teacher.each do |journal_for_teacher| + journal_for_teacher.update_attributes(:viewed => true) + end + # 作品留言 # 消息end #设置作业对应的forge_messages表的viewed字段 query_student_work = @homework.course_messages From d01a52904030dab8d9ddeb207b606fb27367308e Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 8 Sep 2015 15:27:58 +0800 Subject: [PATCH 011/385] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/news/_project_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/news/_project_form.html.erb b/app/views/news/_project_form.html.erb index dfe1fb937..269420bfe 100644 --- a/app/views/news/_project_form.html.erb +++ b/app/views/news/_project_form.html.erb @@ -1,7 +1,7 @@ <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
  • - +

  • From 966bd8f94cb8b18e91a99b2d6bc8c0d1c153dd14 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 8 Sep 2015 16:31:19 +0800 Subject: [PATCH 012/385] =?UTF-8?q?admin=E9=85=8D=E7=BD=AE=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E7=BC=96=E8=BE=91=E6=A1=86=E6=A0=B7=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/application.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 3e01d68ff..ed274a61e 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1833,7 +1833,7 @@ input#time_entry_comments { width: 90%;} .tabular.settings p{ padding-left: 300px; } .tabular.settings label{ margin-left: -300px; width: 295px; } -.tabular.settings textarea { width: 99%; } +.tabular.settings textarea { width: 96%; } .settings.enabled_scm table {width:100%} .settings.enabled_scm td.scm_name{ font-weight: bold; } From 0746408a9df9a92af52a0c8285e3987cf0db07f9 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 8 Sep 2015 16:55:36 +0800 Subject: [PATCH 013/385] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=8A=A0=E5=85=A5=E9=A1=B9=E7=9B=AE=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E6=8F=90=E9=86=92=E5=8A=9F=E8=83=BD=EF=BC=88=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=91=98=E6=94=B6=E5=88=B0=E6=B6=88=E6=81=AF=E6=8F=90?= =?UTF-8?q?=E9=86=92=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 2 ++ app/models/applied_project.rb | 18 +++++++++++++++--- app/views/users/user_messages.html.erb | 15 +++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index f05fa891a..c738ab89a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -146,6 +146,8 @@ class UsersController < ApplicationController @message_alls << message_all.message end end + when 'invite_info' + @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?" , "AppliedProject", @user).order("created_at desc") when 'homework' @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "HomeworkCommon", @user).order("created_at desc") when 'course_message' diff --git a/app/models/applied_project.rb b/app/models/applied_project.rb index accbc90e2..fb8bf90af 100644 --- a/app/models/applied_project.rb +++ b/app/models/applied_project.rb @@ -1,8 +1,21 @@ class AppliedProject < ActiveRecord::Base attr_accessible :project_id, :user_id - belongs_to :user - belongs_to :project + belongs_to :user + belongs_to :project + has_many :forge_messages, :class_name => 'ForgeMessage', :as => :forge_message, :dependent => :destroy + + after_create :send_appliled_message + + def send_appliled_message + # if MessageAll.where("message_type = '#{self.class.to_s}' and message_id = '#{self.id}'").first.nil? + self.project.members.each do |m| + if m.roles.first.to_s.include?("Manager") + self.forge_messages << ForgeMessage.new(:user_id => m.user_id, :project_id => self.project_id, :viewed => false) + end + end + # end + end #删除用户申请 def self.deleteappiled(userid, projectid) @@ -11,5 +24,4 @@ class AppliedProject < ActiveRecord::Base applied.destroy end end - end diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index cd64fb227..778805db6 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -134,6 +134,21 @@ <% end %> <% if ma.class == ForgeMessage %> + <% if ma.forge_message_type == "AppliedProject" %> + + <% end %> <% if ma.forge_message_type == "Issue" %>
    • From 51d964d37149bf1de5d447ca239a4dcae279d30c Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 8 Sep 2015 17:26:10 +0800 Subject: [PATCH 014/385] =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E5=AE=9A=E4=BD=8D=E5=88=B0=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E6=9F=90=E4=B8=80=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/projects/settings.html.erb | 12 +++++++----- app/views/users/user_messages.html.erb | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/views/projects/settings.html.erb b/app/views/projects/settings.html.erb index e70e20cef..3fc9a89d6 100644 --- a/app/views/projects/settings.html.erb +++ b/app/views/projects/settings.html.erb @@ -2,13 +2,15 @@ $(function(){ <%if @select_tab%> <%if @select_tab == "modules"%> - project_setting(2); + project_setting(2); + <% elsif @select_tab == "members"%> + project_setting(3); <% elsif @select_tab == "versions"%> - project_setting(4); - $("#pro_st_edit_ban").toggle(); + project_setting(4); + $("#pro_st_edit_ban").toggle(); <% elsif @select_tab == "repositories" %> - project_setting(6); - $("#pro_st_edit_ku").toggle(); + project_setting(6); + $("#pro_st_edit_ku").toggle(); <%else%> <% end%> <% end%> diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index 778805db6..e3f8c04d0 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -144,7 +144,7 @@ ">申请加入项目:
    • - <%= link_to ma.project, project_path(ma.project_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",:title => "#{ma.project}" %> + <%= link_to ma.project, settings_project_path(:id => ma.project, :tab => "members"), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",:title => "#{ma.project}" %>
    • <%= time_tag(ma.created_at).html_safe %>
    From a7f2f0a6d2a22af97a48034f533c9b684951f4d6 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 8 Sep 2015 17:31:16 +0800 Subject: [PATCH 015/385] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=BA=93=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=BAflash.now[:error]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 77933666f..0f44be36c 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -342,7 +342,7 @@ class ProjectsController < ApplicationController if params[:repository] == "pswd_is_null" html << l(:label_password_not_null) end - flash[:error] = html if !html.to_s.blank? + flash.now[:error] = html if !html.to_s.blank? end scm = params[:repository_scm] || (Redmine::Scm::Base.all & Setting.enabled_scm).first @repository = Repository.factory(scm) From 1a6f81f3020e585279a8164c760c5b6491f26091 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 9 Sep 2015 10:15:05 +0800 Subject: [PATCH 016/385] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=EF=BC=8C=E5=8C=BA=E5=88=86=E5=B7=B2=E8=AF=BB=E5=92=8C=E6=9C=AA?= =?UTF-8?q?=E8=AF=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 6 ++++++ app/controllers/users_controller.rb | 2 +- app/views/users/user_messages.html.erb | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 77933666f..04041bdf6 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -322,6 +322,12 @@ class ProjectsController < ApplicationController end def settings + # 修改查看消息状态 + applied_messages = ForgeMessage.where("user_id =? and project_id =? and forge_message_type =? and viewed =?", User.current.id, @project, "AppliedProject", 0) + applied_messages.each do |applied_message| + applied_message.update_attributes(:viewed => true) + end + # end @issue_custom_fields = IssueCustomField.sorted.all @issue_category ||= IssueCategory.new @member ||= @project.members.new diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index c738ab89a..5680a333e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -146,7 +146,7 @@ class UsersController < ApplicationController @message_alls << message_all.message end end - when 'invite_info' + when 'apply' @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?" , "AppliedProject", @user).order("created_at desc") when 'homework' @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "HomeworkCommon", @user).order("created_at desc") diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index e3f8c04d0..a37ce30ff 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -5,6 +5,7 @@
    • <%= link_to "全部",user_message_path(User.current), :class => "resourcesGrey" %>
    • <%= link_to "未读消息", user_message_path(User.current, :type => 'unviewed'), :class => "resourcesGrey" %>
    • +
    • <%= link_to "用户申请", user_message_path(User.current, :type => 'apply'), :class => "resourcesGrey" %>
    • <%# 课程相关消息 %>
    • <%= link_to "作业消息", user_message_path(User.current, :type => 'homework'), :class => "resourcesGrey" %>
    • <%= link_to "课程讨论",user_message_path(User.current, :type => 'course_message'), :class => "resourcesGrey" %>
    • From 20bef515dae1cea366f8f5a3a0ac8f5a718cd042 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 9 Sep 2015 11:42:06 +0800 Subject: [PATCH 017/385] =?UTF-8?q?issue=E5=91=A8=E6=8A=A5=E5=8F=91?= =?UTF-8?q?=E9=80=81=E6=B6=88=E6=81=AF=E7=BB=99=E6=89=80=E6=9C=89=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 6 ++++-- app/models/issue.rb | 9 ++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 6a0b351ba..47e425710 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -114,8 +114,10 @@ class IssuesController < ApplicationController def show # 当前用户查看指派给他的缺陷消息,则设置消息为已读 query = @issue.forge_messages - if User.current.id == @issue.assigned_to_id - query.update_all(:viewed => true) + query.each do |m| + if m.user_id == User.current.id + m.update_attribute(:viewed, true) + end end # 缺陷状态更新 query_journals = @issue.journals diff --git a/app/models/issue.rb b/app/models/issue.rb index fa8cee988..f7f596e17 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -147,6 +147,13 @@ class Issue < ActiveRecord::Base unless self.author_id == self.assigned_to_id self.forge_messages << ForgeMessage.new(:user_id => self.assigned_to_id, :project_id => self.project_id, :viewed => false) end + if self.tracker_id == 5 + self.project.members.each do |m| + if m.roles.first.to_s.include?("Manager") && m.user_id != self.author_id && m.user_id != self.assigned_to_id + self.forge_messages << ForgeMessage.new(:user_id => m.user_id, :project_id => self.project_id, :viewed => false) + end + end + end end # 更新缺陷 @@ -1009,7 +1016,7 @@ class Issue < ActiveRecord::Base if leaf.start_date # Only move subtask if it starts at the same date as the parent # or if it starts before the given date - if start_date == leaf.start_date || date > leaf.start_date + if start_date == leaf.start_date || date > leaf.start_date leaf.reschedule_on!(date) end else From 66251c8d30b70f2cff928a19ed2420271f531053 Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 9 Sep 2015 17:05:32 +0800 Subject: [PATCH 018/385] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=9A=E7=AE=A1=E7=90=86=E5=91=98=E7=95=8C=E9=9D=A2=E5=8F=91?= =?UTF-8?q?=E9=80=81=E7=B3=BB=E7=BB=9F=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../javascripts/system_messages.js.coffee | 3 + .../stylesheets/system_messages.css.scss | 3 + app/controllers/admin_controller.rb | 5 ++ app/controllers/system_messages_controller.rb | 83 +++++++++++++++++++ app/helpers/system_messages_helper.rb | 2 + app/models/system_message.rb | 4 + app/models/user.rb | 1 + app/views/admin/messages.html.erb | 14 ++++ app/views/system_messages/index.html.erb | 3 + config/locales/admins/en.yml | 2 + config/locales/admins/zh.yml | 2 + config/locales/zh.yml | 2 + config/routes.rb | 11 +++ .../20150909062619_create_system_messages.rb | 11 +++ db/schema.rb | 9 +- lib/redmine.rb | 1 + .../system_messages_controller_spec.rb | 5 ++ spec/factories/system_messages.rb | 8 ++ spec/models/system_message_spec.rb | 5 ++ 19 files changed, 173 insertions(+), 1 deletion(-) create mode 100644 app/assets/javascripts/system_messages.js.coffee create mode 100644 app/assets/stylesheets/system_messages.css.scss create mode 100644 app/controllers/system_messages_controller.rb create mode 100644 app/helpers/system_messages_helper.rb create mode 100644 app/models/system_message.rb create mode 100644 app/views/admin/messages.html.erb create mode 100644 app/views/system_messages/index.html.erb create mode 100644 db/migrate/20150909062619_create_system_messages.rb create mode 100644 spec/controllers/system_messages_controller_spec.rb create mode 100644 spec/factories/system_messages.rb create mode 100644 spec/models/system_message_spec.rb diff --git a/app/assets/javascripts/system_messages.js.coffee b/app/assets/javascripts/system_messages.js.coffee new file mode 100644 index 000000000..761567942 --- /dev/null +++ b/app/assets/javascripts/system_messages.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/stylesheets/system_messages.css.scss b/app/assets/stylesheets/system_messages.css.scss new file mode 100644 index 000000000..a9947d45a --- /dev/null +++ b/app/assets/stylesheets/system_messages.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the SystemMessages controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 1624008f2..5666934b6 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -79,6 +79,11 @@ class AdminController < ApplicationController end end + # 系统消息 + def messages + @admin_messages = SystemMessage.new + end + def plugins @plugins = Redmine::Plugin.all end diff --git a/app/controllers/system_messages_controller.rb b/app/controllers/system_messages_controller.rb new file mode 100644 index 000000000..21b9ae9b8 --- /dev/null +++ b/app/controllers/system_messages_controller.rb @@ -0,0 +1,83 @@ +class SystemMessagesController < ApplicationController + # before_filter :message_author, :only => [:show] + # + # def message_author + # if(!User.current.logged? && !token.nil?) + # + # User.current =try_to_autologin1 + # end + # if @system_messages + # render_403 :message => :notice_not_authorized_message + # else + # deny_access + # end + # end + + def index + @system_messages = SystemMessage.all + end + + # def show + # @system_messages = SystemMessage.find(params[:id]) + # end + + # GET /products/new + # def new + # @product = Product.new + # end + + # GET /products/1/edit + # def edit + # end + + # POST /products + # POST /products.json + def create + @system_messages = SystemMessage.new + @system_messages.content = params[:system_message][:content] + @system_messages.user_id = User.current.id + respond_to do |format| + if @system_messages.save + format.html {redirect_to system_messages_url(@project)} + flash[:notice] = l(:notice_successful_message) + end + end + end + + # PATCH/PUT /products/1 + # PATCH/PUT /products/1.json + # def update + # respond_to do |format| + # if @product.update(product_params) + # format.html { redirect_to @product, notice: 'Product was successfully updated.' } + # format.json { render :show, status: :ok, location: @product } + # else + # format.html { render :edit } + # format.json { render json: @product.errors, status: :unprocessable_entity } + # end + # end + # end + + # DELETE /products/1 + # DELETE /products/1.json + # def destroy + # @system_messages.destroy + # respond_to do |format| + # format.html { redirect_to products_url, notice: 'Product was successfully destroyed.' } + # format.json { head :no_content } + # end + # end + + # private + # # Use callbacks to share common setup or constraints between actions. + # def set_product + # @product = Product.find(params[:id]) + # end + # + # # Never trust parameters from the scary internet, only allow the white list through. + # def message_params + # params.require(:admin_system_messages).permit(:content) + # end + + +end diff --git a/app/helpers/system_messages_helper.rb b/app/helpers/system_messages_helper.rb new file mode 100644 index 000000000..fef238676 --- /dev/null +++ b/app/helpers/system_messages_helper.rb @@ -0,0 +1,2 @@ +module SystemMessagesHelper +end diff --git a/app/models/system_message.rb b/app/models/system_message.rb new file mode 100644 index 000000000..4802ba252 --- /dev/null +++ b/app/models/system_message.rb @@ -0,0 +1,4 @@ +class SystemMessage < ActiveRecord::Base + attr_accessible :content, :id, :user_id + belongs_to :user +end diff --git a/app/models/user.rb b/app/models/user.rb index 2ccc41783..8b5951687 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -133,6 +133,7 @@ class User < Principal has_many :memo_messages has_many :user_feedback_messages has_one :onclick_time + has_many :system_messages # 虚拟转换 has_many :new_jours, :as => :jour, :class_name => 'JournalsForMessage', :conditions => "status=1" diff --git a/app/views/admin/messages.html.erb b/app/views/admin/messages.html.erb new file mode 100644 index 000000000..9d312c7e7 --- /dev/null +++ b/app/views/admin/messages.html.erb @@ -0,0 +1,14 @@ +

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


      +
      + <%= form_for(@admin_messages) do |f| %> +
      + <%= f.text_area :content %> +
      +
      + <%= f.submit l(:label_submit),:class => "small" %> +
      + <% end %> +
      + diff --git a/app/views/system_messages/index.html.erb b/app/views/system_messages/index.html.erb new file mode 100644 index 000000000..4ed40757b --- /dev/null +++ b/app/views/system_messages/index.html.erb @@ -0,0 +1,3 @@ +<% @system_messages.each do |sm| %> +
      • <%= sm.content %>
      +<% end %> diff --git a/config/locales/admins/en.yml b/config/locales/admins/en.yml index 479d2f0f0..ed23107cb 100644 --- a/config/locales/admins/en.yml +++ b/config/locales/admins/en.yml @@ -11,3 +11,5 @@ en: label_registration_activation_by_email: account activation by email label_registration_manual_activation: manual account activation label_registration_automatic_activation: automatic account activation + + label_system_message: system messages diff --git a/config/locales/admins/zh.yml b/config/locales/admins/zh.yml index 936b3109f..49abcfc8d 100644 --- a/config/locales/admins/zh.yml +++ b/config/locales/admins/zh.yml @@ -14,3 +14,5 @@ zh: label_registration_manual_activation: 手动激活帐号 label_registration_automatic_activation: 自动激活帐号 + label_system_message: 系统消息 + diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 4a6ddce4e..d2fa502b9 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -36,6 +36,7 @@ zh: notice_create_failed: 创建失败,请先完善个人信息 notice_failed_create: 创建失败 notice_successful_update: 更新成功 + notice_successful_message: 消息创建成功! notice_successful_edit: 修改成功 notice_failed_edit: 修改失败 notice_successful_delete: 删除成功 @@ -49,6 +50,7 @@ zh: notice_not_contest_setting_authorized: 对不起,您无权配置此竞赛。 notice_not_contest_delete_authorized: 对不起,您无权删除此竞赛。 notice_not_authorized_archived_project: 要访问的项目已经归档。 + notice_not_authorized_message: 您访问的消息不存在! notice_email_sent: "邮件已发送至 %{value}" notice_email_error: "发送邮件时发生错误 (%{value})" notice_feeds_access_key_reseted: 您的RSS存取键已被重置。 diff --git a/config/routes.rb b/config/routes.rb index 8454a1c47..2a0e1a492 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -260,6 +260,16 @@ RedmineApp::Application.routes.draw do match '/users/search', :via => [:get, :post] #end + # 消息相关路由 + resources :system_messages do + collection do + post 'create', :as => 'system_messages' + get 'index', :as => 'index' + get 'show', :as => 'show' + end + end + # match 'system_messages/index', to: 'system_messages#index', :via => :get, :as => 'system_messages' + match 'account/heartbeat', to: 'account#heartbeat', :via => :get match 'login', :to => 'account#login', :as => 'signin', :via => [:get, :post] match 'logout', :to => 'account#logout', :as => 'signout', :via => [:get, :post] @@ -702,6 +712,7 @@ RedmineApp::Application.routes.draw do match 'admin/projects', :via => :get get 'admin/courses' match 'admin/users', :via => :get + match 'admin/messages', :via => :get match 'admin/first_page_made', as: :first_page_made match 'admin/course_page_made', as: :course_page_made match 'admin/contest_page_made', as: :contest_page_made diff --git a/db/migrate/20150909062619_create_system_messages.rb b/db/migrate/20150909062619_create_system_messages.rb new file mode 100644 index 000000000..a51715ead --- /dev/null +++ b/db/migrate/20150909062619_create_system_messages.rb @@ -0,0 +1,11 @@ +class CreateSystemMessages < ActiveRecord::Migration + def change + create_table :system_messages do |t| + t.integer :id + t.integer :user_id + t.string :content + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index e44bdd1d9..71d521453 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150906083453) do +ActiveRecord::Schema.define(:version => 20150909062619) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1357,6 +1357,13 @@ ActiveRecord::Schema.define(:version => 20150906083453) do add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id" add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id" + create_table "system_messages", :force => true do |t| + t.integer "user_id" + t.string "content" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "taggings", :force => true do |t| t.integer "tag_id" t.integer "taggable_id" diff --git a/lib/redmine.rb b/lib/redmine.rb index 99b7ea22f..8ebdacfa6 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -369,6 +369,7 @@ Redmine::MenuManager.map :admin_menu do |menu| menu.push :projects, {:controller => 'admin', :action => 'projects'}, :caption => :label_project_plural menu.push :courses, {:controller => 'admin', :action => 'courses'}, :caption => :label_course_all menu.push :users, {:controller => 'admin', :action => 'users'}, :caption => :label_user_plural + menu.push :messages, {:controller => 'admin', :action => 'messages'}, :caption => :label_system_message menu.push :schools, {:controller => 'admin', :action => 'schools'}, :caption => :label_school_plural menu.push :first_page_made, {:controller => 'admin',:action => 'first_page_made'},:caption => :label_first_page_made menu.push :mobile_version, {:controller => 'admin',:action => 'mobile_version'},:caption => :label_mobile_version diff --git a/spec/controllers/system_messages_controller_spec.rb b/spec/controllers/system_messages_controller_spec.rb new file mode 100644 index 000000000..c65f5b5e0 --- /dev/null +++ b/spec/controllers/system_messages_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe SystemMessagesController, :type => :controller do + +end diff --git a/spec/factories/system_messages.rb b/spec/factories/system_messages.rb new file mode 100644 index 000000000..7bcc27422 --- /dev/null +++ b/spec/factories/system_messages.rb @@ -0,0 +1,8 @@ +FactoryGirl.define do + factory :system_message do + id 1 +user_id 1 +content "MyString" + end + +end diff --git a/spec/models/system_message_spec.rb b/spec/models/system_message_spec.rb new file mode 100644 index 000000000..fd8df4e92 --- /dev/null +++ b/spec/models/system_message_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe SystemMessage, :type => :model do + pending "add some examples to (or delete) #{__FILE__}" +end From 1feb7022c7465b3abb3ad765d6f6bd997efde7f4 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 9 Sep 2015 17:42:38 +0800 Subject: [PATCH 019/385] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E4=B8=BAkindeditor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admin/messages.html.erb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/views/admin/messages.html.erb b/app/views/admin/messages.html.erb index 9d312c7e7..10f20e2a0 100644 --- a/app/views/admin/messages.html.erb +++ b/app/views/admin/messages.html.erb @@ -1,13 +1,18 @@ +<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>

      <%=l(:label_system_message)%>


      <%= form_for(@admin_messages) do |f| %>
      - <%= f.text_area :content %> + <%= f.kindeditor :content, :edit_id => 'system_message', + :width => '87%', + :resizeType => '0', + :no_label => true + %>
      - <%= f.submit l(:label_submit),:class => "small" %> + <%= f.submit l(:label_submit),:class => "small", :onclick => "system_message.sync;" %>
      <% end %>
      From 0aa8c5b5ccbbb0d7338b1bd761e07f1222aba5fb Mon Sep 17 00:00:00 2001 From: huang Date: Wed, 9 Sep 2015 17:43:33 +0800 Subject: [PATCH 020/385] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/system_messages_controller.rb | 4 ++++ app/controllers/users_controller.rb | 2 ++ app/views/users/user_messages.html.erb | 12 ++++++++++++ 3 files changed, 18 insertions(+) diff --git a/app/controllers/system_messages_controller.rb b/app/controllers/system_messages_controller.rb index 21b9ae9b8..588e13c5e 100644 --- a/app/controllers/system_messages_controller.rb +++ b/app/controllers/system_messages_controller.rb @@ -33,6 +33,10 @@ class SystemMessagesController < ApplicationController # POST /products # POST /products.json def create + unless User.current.admin? + render_403 + return + end @system_messages = SystemMessage.new @system_messages.content = params[:system_message][:content] @system_messages.user_id = User.current.id diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 5680a333e..23106c954 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -114,8 +114,10 @@ class UsersController < ApplicationController message_new_time.save else message_new_time = OnclickTime.where("user_id =?", User.current).first + message_last_time = message_new_time.onclick_time message_new_time.update_attributes(:onclick_time => Time.now) end + @user_system_messages = SystemMessage.where("created_at >?", message_last_time) # 当前用户查看消息,则设置消息为已读 if params[:viewed] == "all" course_querys = @user.course_messages diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index a37ce30ff..e36fd4f32 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -39,6 +39,18 @@ <% end %>
  • <% end %> + <%# 系统消息 %> + <% @user_system_messages.each do |usm| %> +
      +
    • ddddddddddddddd
    • +
    • Trustiep平台发布新消息:
    • +
    • + <%= link_to usm.content, {:controller => 'system_messages', :action => 'index'}, + :class =>"newsGrey", + :title => "#{usm.content.html_safe}" %>
    • +
    • <%= time_tag(usm.created_at).html_safe %>
    • +
    + <% end %> <%# 课程消息 %> <% unless @message_alls.nil? %> <% @message_alls.each do |ma| %> From 6b0432c04c581dbe96b7e4142dc3f83093e0d14e Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 10 Sep 2015 09:06:00 +0800 Subject: [PATCH 021/385] =?UTF-8?q?=E6=B7=BB=E5=8A=A0job=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/email.rake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/tasks/email.rake b/lib/tasks/email.rake index 5126d7a69..f805d1382 100644 --- a/lib/tasks/email.rake +++ b/lib/tasks/email.rake @@ -202,5 +202,13 @@ END_DESC Mailer.run.send_for_user_activities(user, Date.today, 1) end end + + desc "send a message for Job deadline" + task :message => :environment do + users = User.where(mail_notification: 'day') + users.each do |user| + Mailer.run.send_for_user_activities(user, Date.today, 1) + end + end end end From 596c512d0afc6800226c9343e2b326d73d1ac91c Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 10 Sep 2015 11:39:53 +0800 Subject: [PATCH 022/385] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 2 ++ app/views/users/user_messages.html.erb | 29 ++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 23106c954..220781ed9 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -148,6 +148,8 @@ class UsersController < ApplicationController @message_alls << message_all.message end end + when 'system_message' + @message_alls = SystemMessage.order("created_at desc").all when 'apply' @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?" , "AppliedProject", @user).order("created_at desc") when 'homework' diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index e36fd4f32..b5473edee 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -6,6 +6,8 @@
  • <%= link_to "全部",user_message_path(User.current), :class => "resourcesGrey" %>
  • <%= link_to "未读消息", user_message_path(User.current, :type => 'unviewed'), :class => "resourcesGrey" %>
  • <%= link_to "用户申请", user_message_path(User.current, :type => 'apply'), :class => "resourcesGrey" %>
  • + <%# 系统消息 %> +
  • <%= link_to "系统消息", user_message_path(User.current, :type => 'system_message'), :class => "resourcesGrey" %>
  • <%# 课程相关消息 %>
  • <%= link_to "作业消息", user_message_path(User.current, :type => 'homework'), :class => "resourcesGrey" %>
  • <%= link_to "课程讨论",user_message_path(User.current, :type => 'course_message'), :class => "resourcesGrey" %>
  • @@ -42,8 +44,14 @@ <%# 系统消息 %> <% @user_system_messages.each do |usm| %> <% end %> <% end %> + <% if ma.class == SystemMessage %> + + <% end %> <% end %>
      <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%> From fb155c84583d943a810a32e35656aa427973b8f2 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 10 Sep 2015 11:42:53 +0800 Subject: [PATCH 023/385] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/user_messages.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index b5473edee..36392c7ac 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -311,6 +311,7 @@
    <% end %> <% end %> + <%# 系统消息 %> <% if ma.class == SystemMessage %>
    • From fce5405c419d717a200c72e7e381350164876fc7 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 10 Sep 2015 14:44:25 +0800 Subject: [PATCH 024/385] =?UTF-8?q?=E5=8F=91=E5=B8=83=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_homework_form.html.erb | 4 ++-- public/stylesheets/new_user.css | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb index 4af5742a9..949fb7f83 100644 --- a/app/views/users/_user_homework_form.html.erb +++ b/app/views/users/_user_homework_form.html.erb @@ -5,7 +5,7 @@
      - +

      @@ -34,7 +34,7 @@
      - <%= select_tag :course_id, options_for_select(get_as_teacher_courses(User.current), homework.course_id), {:class => "InputBox w720",:value => "请选择发布作业的课程"} %> + <%= select_tag :course_id, options_for_select(get_as_teacher_courses(User.current), homework.course_id), {:class => "InputBox w709",:value => "请选择发布作业的课程"} %>

      diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index b6e1919f2..a37123d76 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -856,6 +856,8 @@ a:hover.BlueCirBtn{ background:#269ac9; color:#fff;} .w708{width: 708px;} .w712{width:712px;max-width:712px;min-width: 712px;} .w720{width:721px;} +.w709{width: 709px;} +.w701{width: 701px;} a.AnnexBtn{ background: url(../images/homepage_icon2.png) 0px -343px no-repeat; width:70px; height:20px; display:block; padding-left:20px; color:#888888;} a:hover.AnnexBtn{background: url(../images/homepage_icon2.png) -90px -343px no-repeat; color:#269ac9;} a.FilesBtn{ background: url(../images/homepage_icon2.png) 0px -373px no-repeat; width:70px; height:20px; display:block; padding-left:20px; color:#888888;} From 5f0aac9265e63597602f5b6a9edb26d4bcc825d8 Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 10 Sep 2015 15:01:59 +0800 Subject: [PATCH 025/385] =?UTF-8?q?=E7=82=B9=E5=87=BB=E6=89=93=E5=BC=80?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E8=B5=84=E6=96=99=EF=BC=8C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E7=9A=84=E6=80=A7=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/my/account.html.erb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb index 688d7e2ac..0e36d5fd9 100644 --- a/app/views/my/account.html.erb +++ b/app/views/my/account.html.erb @@ -213,6 +213,7 @@ <% occupation1 = User.current.user_extensions.occupation %> <% occupation = User.current.user_extensions.occupation %> <% title = User.current.user_extensions.technical_title %> + <% gender = User.current.user_extensions.gender %> <% language = User.current.language %> <% else %> <% province = "湖南省" %> @@ -510,6 +511,13 @@ } } } + function init_gender(pField, gender) { + for (var i=0; i" init_identity_and_title(document.getElementById('userIdentity'), identity, document.getElementById('userTechnical_title'), title, language); + //sex + var gender = "<%= "#{gender}" %>" + init_gender(document.getElementById('gender'), gender); + $("#userIdentity").change(); <% if( !@act.nil? && @act == 'password') %> $("#users_tb_2").click(); From e6d5d1785963bb8db69c0de0dcf8125f4559fb8a Mon Sep 17 00:00:00 2001 From: cxt Date: Thu, 10 Sep 2015 15:08:10 +0800 Subject: [PATCH 026/385] =?UTF-8?q?=E8=BD=BB=E6=8A=9A=E5=B1=95=E5=BC=80?= =?UTF-8?q?=E6=9B=B4=E5=A4=9A->=E5=B1=95=E5=BC=80=E6=9B=B4=E5=A4=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_activities.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb index 5ab315fab..6955f5f69 100644 --- a/app/views/users/_user_activities.html.erb +++ b/app/views/users/_user_activities.html.erb @@ -62,7 +62,7 @@ <% end %> <% if user_activities.count == 10%> -
      轻抚展开更多<%=link_to "", user_activities_path(@user.id,:type => type,:page => page),:id => "more_activities_link",:remote => "true",:class => "none" %>
      +
      展开更多<%=link_to "", user_activities_path(@user.id,:type => type,:page => page),:id => "more_activities_link",:remote => "true",:class => "none" %>
      <%#= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%> <% end%> From 756aae0cf2f58b567d1d9f093ed20b4f61b5ae85 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Thu, 10 Sep 2015 15:45:08 +0800 Subject: [PATCH 027/385] =?UTF-8?q?=E5=8F=91=E5=B8=83issue=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=99=A8=E5=8F=AF=E4=BB=A5=E4=B8=8A=E4=BC=A0=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=B9=B6=E9=AB=98=E4=BA=AE=E6=98=BE=E7=A4=BA=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/edit.html.erb | 3 +- app/views/layouts/base_projects.html.erb | 6 +- .../lib/rails_kindeditor/helper.rb | 6 +- public/assets/kindeditor/kindeditor.js | 8 +- public/assets/kindeditor/plugins/code/code.js | 5 +- .../kindeditor/plugins/code/previewcode.css | 76 + public/javascripts/prettify.js | 1655 +++++++++++++++++ public/stylesheets/prettify.css | 77 + 8 files changed, 1824 insertions(+), 12 deletions(-) create mode 100644 public/assets/kindeditor/plugins/code/previewcode.css create mode 100644 public/javascripts/prettify.js create mode 100644 public/stylesheets/prettify.css diff --git a/app/views/bids/edit.html.erb b/app/views/bids/edit.html.erb index da3d19267..554702d97 100644 --- a/app/views/bids/edit.html.erb +++ b/app/views/bids/edit.html.erb @@ -1,4 +1,5 @@ -<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %> +<%= javascript_include_tag "/assets/kindeditor/kindeditor",'prettify','/assets/kindeditor/pasteimg' %> +<%= stylesheet_link_tag 'prettify'%> <%= labelled_form_for @bid,:html => { :multipart => true } do |f| %> <%= render :partial => 'new_homework_form', :locals => { :bid => @bid, :bid_id => "edit_bid_#{@bid.id}",:f=>f,:edit_mode => true} %> <% end %> diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index 425b720d9..ca1b324a4 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -12,8 +12,8 @@ <%= favicon %> <%= javascript_heads %> <%= heads_for_theme %> - <%= stylesheet_link_tag 'public', 'pleft', 'project','jquery/jquery-ui-1.9.2','header' %> - <%= javascript_include_tag 'cookie','project', 'header','select_list_move' %> + <%= stylesheet_link_tag 'public', 'pleft', 'project','prettify','jquery/jquery-ui-1.9.2','header' %> + <%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move' %> <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> @@ -21,7 +21,7 @@ - +