From 87e4bfdd3fca664d8074d3e4dc27433fa321f3ee Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 29 Sep 2015 18:02:11 +0800
Subject: [PATCH 5/8] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=86=85=E5=AF=BC?=
=?UTF-8?q?=E5=85=A5=E4=BD=9C=E4=B8=9A=E5=8D=B4=E5=B0=86=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E5=8F=91=E5=B8=83=E5=88=B0=E8=A2=AB=E5=AF=BC=E5=85=A5=E7=9A=84?=
=?UTF-8?q?=E8=AF=BE=E7=A8=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/users_controller.rb | 2 ++
app/views/users/_show_user_homeworks.html.erb | 1 +
app/views/users/_user_homework_form.html.erb | 2 +-
app/views/users/user_select_homework.js.erb | 4 +++-
4 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 4f3df3bd4..73a26b52c 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -358,6 +358,7 @@ class UsersController < ApplicationController
#导入作业
def user_import_homeworks
+ @select_course = params[:select_course] ? 1 : 0
@user_homeworks = HomeworkCommon.where(:user_id => @user.id).order("created_at desc")
respond_to do |format|
format.js
@@ -377,6 +378,7 @@ class UsersController < ApplicationController
homework = HomeworkCommon.find_by_id params[:checkMenu]
homework_detail_programing = homework.homework_detail_programing
@homework = HomeworkCommon.new
+ @select_course = params[:select_course] || 0
if homework
@homework.name = homework.name
@homework.description = homework.description
diff --git a/app/views/users/_show_user_homeworks.html.erb b/app/views/users/_show_user_homeworks.html.erb
index c14278de3..935cc4513 100644
--- a/app/views/users/_show_user_homeworks.html.erb
+++ b/app/views/users/_show_user_homeworks.html.erb
@@ -10,6 +10,7 @@
<% end%>
<%= form_tag(user_select_homework_users_path, :multipart => true,:remote => true,:name=>"select_homework_form",:id=>'select_homework_form') do %>
+
<%= render :partial => 'users/show_user_homework_form', :locals => {:user_homeworks => @user_homeworks}%>
diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb
index fe320992a..6167e4e10 100644
--- a/app/views/users/_user_homework_form.html.erb
+++ b/app/views/users/_user_homework_form.html.erb
@@ -16,7 +16,7 @@
- <%= link_to("导入作业", user_import_homeworks_user_path(User.current.id),:class => "BlueCirBtn fl mr10",:remote => true) unless edit_mode%>
+ <%= link_to("导入作业", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fl mr10",:remote => true) unless edit_mode%>
<%= calendar_for('homework_end_time')%>
diff --git a/app/views/users/user_select_homework.js.erb b/app/views/users/user_select_homework.js.erb
index 308f74938..1d9cc8d70 100644
--- a/app/views/users/user_select_homework.js.erb
+++ b/app/views/users/user_select_homework.js.erb
@@ -2,7 +2,9 @@
hideModal('#coursesChoosePopup');
$("#homework_name").val("<%= @homework.name%>");
$("#homework_end_time").val("<%= @homework.end_time%>");
-$("#course_id").val("<%= @homework.course_id%>");
+<% if @select_course == "0"%>
+ $("#course_id").val("<%= @homework.course_id%>");
+<% end%>
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => @homework,:has_program => true })%>");
homework_description_editor.html("<%= escape_javascript(@homework.description.html_safe)%>");
$("#BluePopupBox").html("<%=escape_javascript( render :partial => 'users/user_programing_attr', :locals => {:edit_mode => true, :homework => @homework})%>");
From 452766badeba09858562298014bfec11596b98c3 Mon Sep 17 00:00:00 2001
From: cxt
Date: Wed, 30 Sep 2015 09:58:29 +0800
Subject: [PATCH 6/8] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E9=80=9A=E7=9F=A5?=
=?UTF-8?q?=E7=9A=84=E5=8A=A8=E6=80=81=E6=8E=92=E5=BA=8F=E6=97=B6=E9=97=B4?=
=?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...150930011457_alter_user_activities_news.rb | 18 ++++++++
db/schema.rb | 43 ++++++++-----------
2 files changed, 35 insertions(+), 26 deletions(-)
create mode 100644 db/migrate/20150930011457_alter_user_activities_news.rb
diff --git a/db/migrate/20150930011457_alter_user_activities_news.rb b/db/migrate/20150930011457_alter_user_activities_news.rb
new file mode 100644
index 000000000..169ac6795
--- /dev/null
+++ b/db/migrate/20150930011457_alter_user_activities_news.rb
@@ -0,0 +1,18 @@
+class AlterUserActivitiesNews < ActiveRecord::Migration
+ def up
+ UserActivity.all.each do |activity|
+ if activity.act_type = 'News'
+ if activity.act
+ activity.created_at = activity.act.created_on
+ activity.updated_at = activity.act.updated_on ? activity.act.updated_on : activity.act.created_on
+ activity.save
+ else
+ activity.destroy
+ end
+ end
+ end
+ end
+
+ def down
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 205f3140c..9da8cdd66 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 => 20150928090128) do
+ActiveRecord::Schema.define(:version => 20150930011457) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -476,13 +476,6 @@ ActiveRecord::Schema.define(:version => 20150928090128) do
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
- create_table "discuss_demos", :force => true do |t|
- t.string "title"
- t.text "body"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
create_table "documents", :force => true do |t|
t.integer "project_id", :default => 0, :null => false
t.integer "category_id", :default => 0, :null => false
@@ -497,26 +490,23 @@ ActiveRecord::Schema.define(:version => 20150928090128) do
add_index "documents", ["created_on"], :name => "index_documents_on_created_on"
add_index "documents", ["project_id"], :name => "documents_project_id"
- 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 "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
+ create_table "dts", :force => true do |t|
+ t.string "IPLineCode"
t.string "Description"
- t.text "PreConditions", :limit => 2147483647
- t.text "TraceInfo", :limit => 2147483647
- t.text "Code", :limit => 2147483647
+ t.string "Num"
+ t.string "Variable"
+ t.string "TraceInfo"
+ t.string "Method"
+ t.string "File"
+ t.string "IPLine"
+ t.string "Review"
+ t.string "Category"
+ t.string "Defect"
+ t.string "PreConditions"
+ t.string "StartLine"
t.integer "project_id"
- t.datetime "created_at"
- t.datetime "updated_at"
- t.integer "id", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
end
create_table "enabled_modules", :force => true do |t|
@@ -921,6 +911,7 @@ ActiveRecord::Schema.define(:version => 20150928090128) do
t.datetime "created_on"
t.integer "comments_count", :default => 0, :null => false
t.integer "course_id"
+ t.datetime "updated_on"
end
add_index "news", ["author_id"], :name => "index_news_on_author_id"
From acdb63974fb9e57dc1675d13a6bd3d4f84e3159b Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Wed, 30 Sep 2015 10:21:11 +0800
Subject: [PATCH 7/8] =?UTF-8?q?=E5=85=B7=E4=BD=93=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E5=8F=91=E5=B8=83=E4=BD=9C=E4=B8=9A=E7=9A=84=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/stylesheets/prettify.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/stylesheets/prettify.css b/public/stylesheets/prettify.css
index 7979d061a..489f1959b 100644
--- a/public/stylesheets/prettify.css
+++ b/public/stylesheets/prettify.css
@@ -46,7 +46,7 @@ pre li,ul,ol {
ol.linenums { margin-top: 0; margin-bottom: 0;line-height: 15px;margin-left: 0px !important; } /* IE indents via margin-left */
.list_style ol li {
list-style-type: decimal;
- margin-left: 10px;
+ margin-left: 10px !important;
}
li.L0,
li.L1,
From edf6f8e1f0330c3d9f8733425655c7ef14d26596 Mon Sep 17 00:00:00 2001
From: huang
Date: Wed, 30 Sep 2015 10:31:47 +0800
Subject: [PATCH 8/8] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=8F=90=E7=A4=BA?=
=?UTF-8?q?=EF=BC=8C=E6=98=BE=E7=A4=BA=E6=96=B0=E6=B6=88=E6=81=AF=E6=95=B0?=
=?UTF-8?q?=E7=9B=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/_logined_header.html.erb | 4 +++-
public/stylesheets/header.css | 2 +-
public/stylesheets/new_user.css | 2 +-
public/stylesheets/public.css | 2 +-
4 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb
index 941f8b8e3..d0cbc1f6b 100644
--- a/app/views/layouts/_logined_header.html.erb
+++ b/app/views/layouts/_logined_header.html.erb
@@ -94,11 +94,13 @@
+
<%= link_to "", user_message_path(User.current), :class => "homepageNewsIcon" %>
<% if User.current.count_new_message >0 %>
-
<%= link_to "" , user_message_path(User.current), :class => "newsActive" %>
+
<%= link_to User.current.count_new_message , user_message_path(User.current), :class => "newsActive" %>
<% end %>
+ <%#= link_to User.current.count_new_message, user_message_path(User.current), :class => "homepageNewsIcon" %>
diff --git a/public/stylesheets/header.css b/public/stylesheets/header.css
index 25c2ae211..45f057155 100644
--- a/public/stylesheets/header.css
+++ b/public/stylesheets/header.css
@@ -14,7 +14,7 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no-
#navSearchAlert {display:none;}
.navHomepageNews {width:30px; display:block; float:right; margin-top:8px; position:relative;}
.homepageNewsIcon {background:url(../images/nav_icon.png) -5px -85px no-repeat; width:30px; height:35px; display:block;}
-.newsActive {width:10px; height:10px; border-radius:50%; border:2px solid #ffffff; background-color:#ff0000; position:absolute; left:17px; top:5px;}
+.newsActive {width:16px; height:16px; border-radius:50%; background-color:#ff0000; position:absolute; left:17px; top:5px; text-align:center;font-size:12px; color:#ffffff !important;padding-bottom: 3px;padding-left: 1px;padding-right: 1px;}
.navHomepageProfile {width:65px; display:block; float:right; margin-left:33px;}
.homepageProfileMenuIcon {background:url(../images/nav_icon.png) 30px -155px no-repeat; width:65px; height:54px; position:relative; display:inline-block; line-height:0;}
.homepageProfileMenuIconhover {background:url(../images/nav_icon.png) 30px -122px no-repeat;}
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index 5949d44aa..156d0f79c 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -528,7 +528,7 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no-
#navSearchAlert {display:none;}
.navHomepageNews {width:30px; display:block; float:right; margin-top:8px; position:relative;}
.homepageNewsIcon {background:url(../images/nav_icon.png) -5px -85px no-repeat; width:30px; height:35px; display:block;}
-.newsActive {width:10px; height:10px; border-radius:50%; border:2px solid #ffffff; background-color:#ff0000; position:absolute; left:17px; top:5px;}
+.newsActive {width:16px; height:16px; border-radius:50%; background-color:#ff0000; position:absolute; left:17px; top:5px; text-align:center;font-size:12px; color:#ffffff !important;padding-bottom: 3px;padding-left: 1px;padding-right: 1px;}
.navHomepageProfile {width:65px; display:block; float:right; margin-left:33px;}
.portraitRadius {border-radius: 3px;}
.homepageProfileMenuIcon {background:url(../images/nav_icon.png) 30px -155px no-repeat; width:65px; height:54px; position:relative; display:inline-block; line-height:0;}
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css
index 144b8526c..fe8acc564 100644
--- a/public/stylesheets/public.css
+++ b/public/stylesheets/public.css
@@ -448,7 +448,7 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no-
#navSearchAlert {display:none;}
.navHomepageNews {width:30px; display:block; float:right; margin-top:8px; position:relative;}
.homepageNewsIcon {background:url(../images/nav_icon.png) -5px -85px no-repeat; width:30px; height:35px; display:block;}
-.newsActive {width:8px; height:8px; border-radius:50%; border:2px solid #ffffff; background-color:#ff0000; position:absolute; left:17px; top:5px;}
+.newsActive {width:16px; height:16px; border-radius:50%; background-color:#ff0000; position:absolute; left:17px; top:5px; text-align:center;font-size:12px; color:#ffffff !important;padding-bottom: 3px;padding-left: 1px;padding-right: 1px;}
.navHomepageProfile {width:65px; display:block; float:right; margin-left:33px;}
.homepageProfileMenuIcon {background:url(../images/nav_icon.png) 30px -155px no-repeat; width:65px; height:54px; position:relative; display:inline-block;}
.homepageProfileMenuIcon:hover {background:url(../images/nav_icon.png) 30px -122px no-repeat;}