、
+
+
<% if @topics.any? %>
<% @topics.each do |topic| %>
-
- <%= link_to image_tag(url_to_avatar(topic.author), :width=>"32",:height=>"32"), user_path(topic.author),:class => 'problem_pic talk_pic fl' %>
-
- <%= link_to h(topic.subject), board_message_path(@board, topic), title:topic.subject.to_s, :class =>"problem_tit fl" %>
+
+ <%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %>
+
+ <% author = topic.author.to_s + ":" %>
+ <%= link_to author, user_path(topic.author), :class =>"talkmain_name fl " %>
+
<%= h(topic.subject) %>
<% if topic.sticky? %>
<%= l(:label_board_sticky)%>
<% end %>
-
- <%= link_to topic.author, user_path(topic.author), :class =>"problem_name" %>
- <%= format_time topic.created_on %>
+
-
- <%= topic.content %>
+
+ <%= topic.content %> [展开]
+
+
+ <%= l(:label_activity_time)%>: <%= format_time topic.created_on %>na
<%= link_to (l(:label_short_reply) + " "+topic.replies_count.to_s), board_message_path(@board, topic), :class => "talk_btn fr c_white" %>
diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb
index c9a8645de..f293fd350 100644
--- a/app/views/boards/show.html.erb
+++ b/app/views/boards/show.html.erb
@@ -1,4 +1,53 @@
+
+
+
<% if @project %>
<%= render :partial => 'project_show', locals: {project: @project} %>
<% elsif @course %>
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index d93bc8519..d2bd4c4c0 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -530,6 +530,40 @@ a.wzan_visited{background:url(../images/new_project/public_icon.png) 0px -503px
a.files_tag_icon{ background:#e2f3f9; color:#54aeca; border:1px solid #bbe2ef; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px; }
a.files_tag_select{ background:#64bdd9; color:#fff; border:1px solid #64bdd9; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px;}
+/* 20150505讨论区*/
+.w664{ width:664px;}
+.w140{ width:140px;}
+.talklist_box{ }
+.talkmain_box{ width:670px; border-bottom:1px dashed #d9d9d9; padding-bottom:20px; margin-bottom:20px;}
+.talkmain_pic{}
+a.talkmain_pic{ display:block; width:42px; height:42px; padding:2px; border:1px solid #e3e3e3;}
+a:hover.talkmain_pic{border:1px solid #64bdd9;}
+.talkmain_txt{ width:610px; margin-left:10px; color:#333;}
+a.talkmain_name{ color:#ff5722;}
+a:hover.talkmain_name{ color:#d33503;}
+.talkmain_tit{ color:#0781b4; width:450px; display:block; }
+.talklist_main{ }
+.talkWrapArrow{ display:block; float:right; margin-right:10px;background:url(../images/arrow.png) 0 0 no-repeat; height:7px; width:13px;}
+.talkConIpt{ background:#f2f2f2; }
+.talkWrapBox{ width:610px; margin-left:60px; }
+.inputFeint{ border:1px solid #d9d9d9; background:#fff; width:583px; height:50px; margin:10px; margin-bottom:5px;color:#666;}
+.inputFeint02{ border:1px solid #d9d9d9; background:#fff; width:535px; height:30px; margin:5px 0 5px 50px; color:#666;}
+.inputFeint03{ border:1px solid #d9d9d9; background:#fff; width:490px; height:30px; margin:5px 0 5px 0px; color:#666;}
+.talkWrapMsg{ background:#f2f2f2; padding:10px;}
+a.Msg_pic{ display:block; width:34px; height:34px; padding:2px; border:1px solid #e3e3e3; float:left;}
+a:hover.Msg_pic{border:1px solid #64bdd9;}
+a.Reply_pic{ display:block; width:30px; height:30px; padding:2px; border:1px solid #e3e3e3; float:left;}
+a:hover.Reply_pic{border:1px solid #64bdd9;}
+.Msg_txt{ float:left; width:540px; margin-left:10px;}
+.Msg_txt p{ }
+.talkWrapMsg ul li{border-bottom:1px dashed #d9d9d9; padding-bottom:10px; margin-bottom:10px;}
+.talkReply{ width:540px; margin-left:50px; border-top:1px dashed #d9d9d9; padding-top:10px; }
+.Replybox{ float:left; width:495px; margin-left:5px;}
+.talk_nextpage{ border:none; width:410px; margin:0 auto;}
+.newtalk { margin-top:8px; margin-right:8px;}
+.talk_new{ border-bottom:1px dashed #d9d9d9; padding-bottom:10px;}
+#about_newtalk{ display:none;}
+
diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css
index 019ffa57a..a33071f65 100644
--- a/public/stylesheets/project.css
+++ b/public/stylesheets/project.css
@@ -691,3 +691,37 @@ tr.open span.expander {background-image: url(../images/bullet_toggle_minus.png);
.icon-file.application-pdf { background-image: url(../images/files/pdf.png); }
.icon-file.application-zip { background-image: url(../images/files/zip.png); }
.icon-file.application-x-gzip { background-image: url(../images/files/zip.png); }
+
+/* 20150505讨论区*/
+.w664{ width:664px;}
+.w140{ width:140px;}
+.talklist_box{ }
+.talkmain_box{ width:670px; border-bottom:1px dashed #d9d9d9; padding-bottom:20px; margin-bottom:20px;}
+.talkmain_pic{}
+a.talkmain_pic{ display:block; width:42px; height:42px; padding:2px; border:1px solid #e3e3e3;}
+a:hover.talkmain_pic{border:1px solid #64bdd9;}
+.talkmain_txt{ width:610px; margin-left:10px; color:#333;}
+a.talkmain_name{ color:#ff5722;}
+a:hover.talkmain_name{ color:#d33503;}
+.talkmain_tit{ color:#0781b4; width:450px; display:block; }
+.talklist_main{ }
+.talkWrapArrow{ display:block; float:right; margin-right:10px;background:url(../images/arrow.png) 0 0 no-repeat; height:7px; width:13px;}
+.talkConIpt{ background:#f2f2f2; }
+.talkWrapBox{ width:610px; margin-left:60px; }
+.inputFeint{ border:1px solid #d9d9d9; background:#fff; width:583px; height:50px; margin:10px; margin-bottom:5px;color:#666;}
+.inputFeint02{ border:1px solid #d9d9d9; background:#fff; width:535px; height:30px; margin:5px 0 5px 50px; color:#666;}
+.inputFeint03{ border:1px solid #d9d9d9; background:#fff; width:490px; height:30px; margin:5px 0 5px 0px; color:#666;}
+.talkWrapMsg{ background:#f2f2f2; padding:10px;}
+a.Msg_pic{ display:block; width:34px; height:34px; padding:2px; border:1px solid #e3e3e3; float:left;}
+a:hover.Msg_pic{border:1px solid #64bdd9;}
+a.Reply_pic{ display:block; width:30px; height:30px; padding:2px; border:1px solid #e3e3e3; float:left;}
+a:hover.Reply_pic{border:1px solid #64bdd9;}
+.Msg_txt{ float:left; width:540px; margin-left:10px;}
+.Msg_txt p{ }
+.talkWrapMsg ul li{border-bottom:1px dashed #d9d9d9; padding-bottom:10px; margin-bottom:10px;}
+.talkReply{ width:540px; margin-left:50px; border-top:1px dashed #d9d9d9; padding-top:10px; }
+.Replybox{ float:left; width:495px; margin-left:5px;}
+.talk_nextpage{ border:none; width:410px; margin:0 auto;}
+.newtalk { margin-top:8px; margin-right:8px;}
+.talk_new{ border-bottom:1px dashed #d9d9d9; padding-bottom:10px;}
+#about_newtalk{ display:none;}
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css
index 4f65a17c1..5006a11e4 100644
--- a/public/stylesheets/public.css
+++ b/public/stylesheets/public.css
@@ -56,7 +56,6 @@ h4{ font-size:14px; color:#3b3b3b;}
.ml10{ margin-left:10px;}
.ml15{ margin-left:15px;}
.ml20{ margin-left:20px;}
-.ml25{ margin-left:25px;}
.ml40{ margin-left:40px;}
.ml45{ margin-left:45px;}
.ml55{ margin-left:55px;}
@@ -64,6 +63,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.ml60{ margin-left:60px;}
.ml80{ margin-left:80px;}
.ml90{ margin-left:90px;}
+.ml100{ margin-left:100px;}
.ml110{ margin-left:110px;}
.mr5{ margin-right:5px;}
.mr10{ margin-right:10px;}
@@ -74,13 +74,13 @@ h4{ font-size:14px; color:#3b3b3b;}
.mt5{ margin-top:5px;}
.mt8{ margin-top:8px;}
.mt10{ margin-top:10px;}
-.mt13{ margin-top:13px;}
-.mt43{ margin-top:43px;}
-.mt40{ margin-top:40px;}
.mb5{ margin-bottom:5px;}
.mb10{ margin-bottom:10px;}
-.mb13{ margin-bottom:13px;}
+.mb20{ margin-bottom:20px;}
.pl15{ padding-left:15px;}
+.w20{ width:20px;}
+.w60{ width:60px;}
+.w70{ width:70px;}
.w90{ width:90px;}
.w210{ width:210px;}
.w150{ width:150px;}
@@ -93,8 +93,10 @@ h4{ font-size:14px; color:#3b3b3b;}
.w350{ width:350px;}
.w610{ width:610px;}
.w600{ width:600px;}
+.h22{ height:22px;}
.h26{ height:26px;}
.h50{ height:50px;}
+.h70{ height:70px;}
.h150{ height:150px;}
/* Font & background Color */
From 628ffc67dd392cf50d667ac540ece8199561de21 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 7 May 2015 10:43:23 +0800
Subject: [PATCH 04/11] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E4=BD=9C=E5=93=81?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E7=95=8C=E9=9D=A2=E5=A2=9E=E5=8A=A0=E8=BF=94?=
=?UTF-8?q?=E5=9B=9E=E9=A1=B6=E9=83=A8=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../homework_attach/_homeworks_list.html.erb | 4 ++++
db/schema.rb | 10 +++++++++-
public/images/course/to_top.png | Bin 0 -> 2873 bytes
public/stylesheets/css.css | 1 +
4 files changed, 14 insertions(+), 1 deletion(-)
create mode 100644 public/images/course/to_top.png
diff --git a/app/views/homework_attach/_homeworks_list.html.erb b/app/views/homework_attach/_homeworks_list.html.erb
index 24ea2190c..689eaa08b 100644
--- a/app/views/homework_attach/_homeworks_list.html.erb
+++ b/app/views/homework_attach/_homeworks_list.html.erb
@@ -34,7 +34,11 @@
<% end %>
+
+
+ 返 回 顶 部
+
<% unless homeworks.nil? %>
diff --git a/db/schema.rb b/db/schema.rb
index dcbe017fb..8b5ea1461 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 => 20150428021035) do
+ActiveRecord::Schema.define(:version => 20150505025537) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -541,6 +541,8 @@ ActiveRecord::Schema.define(:version => 20150428021035) do
t.integer "is_teacher_score", :default => 0
end
+ add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id"
+
create_table "homework_evaluations", :force => true do |t|
t.string "user_id"
t.string "homework_attach_id"
@@ -553,6 +555,9 @@ ActiveRecord::Schema.define(:version => 20150428021035) do
t.integer "bid_id"
end
+ add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id"
+ add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id"
+
create_table "homework_users", :force => true do |t|
t.string "homework_attach_id"
t.string "user_id"
@@ -1159,6 +1164,9 @@ ActiveRecord::Schema.define(:version => 20150428021035) do
t.datetime "updated_at", :null => false
end
+ 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 "taggings", :force => true do |t|
t.integer "tag_id"
t.integer "taggable_id"
diff --git a/public/images/course/to_top.png b/public/images/course/to_top.png
new file mode 100644
index 0000000000000000000000000000000000000000..1621b35108f2ccae90c680fa6fa2306eb5d33120
GIT binary patch
literal 2873
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
Date: Thu, 7 May 2015 11:43:11 +0800
Subject: [PATCH 05/11] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E9=A1=B6=E9=83=A8?=
=?UTF-8?q?=E5=8A=A8=E6=80=81=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/bids/_homework.html.erb | 11 +++++++++++
app/views/homework_attach/_homeworks_list.html.erb | 2 +-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/app/views/bids/_homework.html.erb b/app/views/bids/_homework.html.erb
index 0cb1ff7cc..0272f2c63 100644
--- a/app/views/bids/_homework.html.erb
+++ b/app/views/bids/_homework.html.erb
@@ -59,6 +59,17 @@
}
);
}
+
+ $(window).scroll(function(){
+ //获取窗口的滚动条的垂直位置
+ var s = $(window).scrollTop();
+ //当窗口的滚动条的垂直位置大于页面的最小高度时,让返回顶部元素渐现,否则渐隐
+ if( s > 600){
+ $("#gotoTop").fadeIn(100);
+ }else{
+ $("#gotoTop").fadeOut(200);
+ };
+ });
diff --git a/app/views/homework_attach/_homeworks_list.html.erb b/app/views/homework_attach/_homeworks_list.html.erb
index 689eaa08b..08ea9434d 100644
--- a/app/views/homework_attach/_homeworks_list.html.erb
+++ b/app/views/homework_attach/_homeworks_list.html.erb
@@ -36,7 +36,7 @@
<% end %>
-
+
返 回 顶 部
From 0ec08f936113c5ad6baf8eac3c2cc65be4347939 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 7 May 2015 11:47:34 +0800
Subject: [PATCH 06/11] =?UTF-8?q?=E6=89=93=E9=9B=B6=E5=88=86=E4=BD=9C?=
=?UTF-8?q?=E5=93=81=E4=BB=8D=E5=9C=A8=E6=9C=AA=E6=89=B9=E4=BD=9C=E5=93=81?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/bids_controller.rb | 2 +-
app/controllers/homework_attach_controller.rb | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb
index b1cca68ed..c98df27d3 100644
--- a/app/controllers/bids_controller.rb
+++ b/app/controllers/bids_controller.rb
@@ -490,7 +490,7 @@ class BidsController < ApplicationController
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score
FROM homework_attaches WHERE bid_id = #{@bid.id} ORDER BY s_score DESC,created_at ASC) AS table1
- WHERE table1.t_score IS NULL OR table1.t_score = 0")
+ WHERE table1.t_score IS NULL")
@not_batch_homework = true
@cur_type = 1
else
diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb
index 523e430fb..f6b044c63 100644
--- a/app/controllers/homework_attach_controller.rb
+++ b/app/controllers/homework_attach_controller.rb
@@ -51,7 +51,7 @@ class HomeworkAttachController < ApplicationController
order_by = "created_at #{direction}"
end
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT * FROM (SELECT homework_attaches.*,
- (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL AND stars > 0 ORDER BY updated_at DESC limit 0,1) AS t_score,
+ (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score
FROM homework_attaches WHERE bid_id = #{@bid.id}
ORDER BY #{order_by}) AS table1
@@ -503,7 +503,7 @@ class HomeworkAttachController < ApplicationController
get_not_batch_homework_list params[:cur_sort] || "s_socre",params[:cur_direction] || "desc",@homework.bid_id
elsif @cur_type == "2" #老师已批列表
@result_homework = HomeworkAttach.find_by_sql("SELECT homework_attaches.*,
- (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL AND stars > 0 ORDER BY updated_at DESC limit 0,1) AS t_score,
+ (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score
FROM homework_attaches WHERE id = #{@homework.id}").first
elsif @cur_type == "3" #全部作业列表
@@ -630,7 +630,7 @@ class HomeworkAttachController < ApplicationController
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score
FROM homework_attaches WHERE bid_id = #{bid_id}
ORDER BY #{order_by}) AS table1
- WHERE table1.t_score IS NULL OR table1.t_score = 0 ")
+ WHERE table1.t_score IS NULL ")
@all_homework_list = search_homework_member(@all_homework_list,@search_name.to_s.downcase) if @search_name
# @homework_list = paginateHelper @all_homework_list,10
@homework_list = @all_homework_list
From 5f6f937fcb5b810507db5e5d440cb37ff623b309 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 7 May 2015 14:38:02 +0800
Subject: [PATCH 07/11] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E9=A1=B6=E9=83=A8?=
=?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=99=A8=E4=B8=8D=E5=85=BC=E5=AE=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/bids/_homework.html.erb | 57 +++++++++++++++----
.../homework_attach/_homeworks_list.html.erb | 2 +-
2 files changed, 48 insertions(+), 11 deletions(-)
diff --git a/app/views/bids/_homework.html.erb b/app/views/bids/_homework.html.erb
index 0272f2c63..02a68a961 100644
--- a/app/views/bids/_homework.html.erb
+++ b/app/views/bids/_homework.html.erb
@@ -60,16 +60,53 @@
);
}
- $(window).scroll(function(){
- //获取窗口的滚动条的垂直位置
- var s = $(window).scrollTop();
- //当窗口的滚动条的垂直位置大于页面的最小高度时,让返回顶部元素渐现,否则渐隐
- if( s > 600){
- $("#gotoTop").fadeIn(100);
- }else{
- $("#gotoTop").fadeOut(200);
- };
- });
+// $(window).scroll(function(){
+// //获取窗口的滚动条的垂直位置
+// var s = $(window).scrollTop();
+// //当窗口的滚动条的垂直位置大于页面的最小高度时,让返回顶部元素渐现,否则渐隐
+// if( s > 600){
+// $("#gotoTop").fadeIn(100);
+// }else{
+// $("#gotoTop").fadeOut(200);
+// };
+// });
+
+ var Sys = {};
+ var ua = navigator.userAgent.toLowerCase();
+ var s;
+ (s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
+ (s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
+ (s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
+ (s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
+ (s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
+
+ function goTopEx() {
+ var obj = document.getElementById("goTopBtn");
+ var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
+ function getScrollTop() {
+ var xsun = document.documentElement.scrollTop;
+ if (Sys.chrome) {
+ xsun=document.body.scrollTop;
+ }
+ return xsun;
+ }
+ function setScrollTop(value) {
+ if (Sys.chrome) {
+ document.body.scrollTop = value;
+ }
+ else {
+ document.documentElement.scrollTop = value;
+ }
+ }
+ window.onscroll = function () { getScrollTop() > 0 ? obj.style.display = "" : obj.style.display = "none"; };
+ obj.onclick = function () {
+ var goTop = setInterval(scrollMove, 10);
+ function scrollMove() {
+ setScrollTop(getScrollTop() / 1.1);
+ if (getScrollTop() < 1) clearInterval(goTop);
+ }
+ }
+ }
diff --git a/app/views/homework_attach/_homeworks_list.html.erb b/app/views/homework_attach/_homeworks_list.html.erb
index 08ea9434d..a2466d482 100644
--- a/app/views/homework_attach/_homeworks_list.html.erb
+++ b/app/views/homework_attach/_homeworks_list.html.erb
@@ -36,7 +36,7 @@
<% end %>
-
+
返 回 顶 部
From 5ea295f8b55aee0b9a4cb5ea8343778d41293e2e Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 7 May 2015 15:58:41 +0800
Subject: [PATCH 08/11] =?UTF-8?q?1=E3=80=81=E7=AC=AC=E4=B8=80=E6=AC=A1?=
=?UTF-8?q?=E8=BF=9B=E5=85=A5=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8=E7=95=8C?=
=?UTF-8?q?=E9=9D=A2=20=E8=BF=94=E5=9B=9E=E9=A1=B6=E9=83=A8=E6=8C=89?=
=?UTF-8?q?=E9=92=AE=E4=B8=8D=E6=98=BE=E7=A4=BA=202=E3=80=81=E7=AC=AC?=
=?UTF-8?q?=E4=B8=80=E6=AC=A1=E7=82=B9=E5=87=BB=E8=BF=94=E5=9B=9E=E9=A1=B6?=
=?UTF-8?q?=E9=83=A8=E6=8C=89=E9=92=AE=E6=97=A0=E7=94=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/bids/_homework.html.erb | 1 +
app/views/homework_attach/_homeworks_list.html.erb | 2 +-
public/stylesheets/css.css | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/views/bids/_homework.html.erb b/app/views/bids/_homework.html.erb
index 02a68a961..c3a6cc9d0 100644
--- a/app/views/bids/_homework.html.erb
+++ b/app/views/bids/_homework.html.erb
@@ -70,6 +70,7 @@
// $("#gotoTop").fadeOut(200);
// };
// });
+ $(function(){goTopEx();});
var Sys = {};
var ua = navigator.userAgent.toLowerCase();
diff --git a/app/views/homework_attach/_homeworks_list.html.erb b/app/views/homework_attach/_homeworks_list.html.erb
index a2466d482..c82a729de 100644
--- a/app/views/homework_attach/_homeworks_list.html.erb
+++ b/app/views/homework_attach/_homeworks_list.html.erb
@@ -36,7 +36,7 @@
<% end %>
-
+
返 回 顶 部
diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css
index 043faca46..ea42f7887 100644
--- a/public/stylesheets/css.css
+++ b/public/stylesheets/css.css
@@ -175,7 +175,7 @@ a.member_search {width: 43px;height: 22px;background: #15bccf;color: #fff;text-a
/*上传图片处理*/
.upload_img img{max-width: 100%;}
-.to_top{width: 19px;height: 74px;position: fixed;top: 50px;right: 1px;color: white;background: #15bccf; line-height: 1.2; padding-top: 10px;padding-left: 5px;font-size: 14px;cursor: pointer}
+.to_top{width: 19px;height: 74px;position: fixed;top: 50px;right: 1px;color: white;background: #15bccf; line-height: 1.2; padding-top: 10px;padding-left: 5px;font-size: 14px;cursor: pointer;}
From 08f1c390334fb0fb8344197fa5fd856ff300e18c Mon Sep 17 00:00:00 2001
From: alan <547533434@qq.com>
Date: Thu, 7 May 2015 16:10:07 +0800
Subject: [PATCH 09/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E8=AE=A8=E8=AE=BA=E5=8C=BA=E7=95=8C=E9=9D=A2=20Signed-off-by:?=
=?UTF-8?q?=20alan=20<547533434@qq.com>?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/messages_controller.rb | 28 ++-
app/views/boards/_course_new.html.erb | 9 +
app/views/boards/_course_show.html.erb | 183 ++++++++++++++-----
app/views/boards/_form_course.html.erb | 60 ++++++
app/views/boards/_form_project.html.erb | 60 ++++++
app/views/boards/_project_new_topic.html.erb | 4 +-
app/views/boards/_project_show.html.erb | 136 +++++++++-----
app/views/boards/show.html.erb | 71 ++++++-
db/schema.rb | 17 +-
public/javascripts/project.js | 41 ++++-
10 files changed, 490 insertions(+), 119 deletions(-)
create mode 100644 app/views/boards/_course_new.html.erb
create mode 100644 app/views/boards/_form_course.html.erb
create mode 100644 app/views/boards/_form_project.html.erb
diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb
index cba3a98e0..bab5dfb4c 100644
--- a/app/controllers/messages_controller.rb
+++ b/app/controllers/messages_controller.rb
@@ -94,7 +94,11 @@ class MessagesController < ApplicationController
call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
render_attachment_warning_if_needed(@message)
if params[:is_board]
- redirect_to project_boards_path(@project)
+ if @project
+ redirect_to project_boards_path(@project)
+ elsif @course
+ redirect_to course_boards_path(@course)
+ end
else
redirect_to board_message_url(@board, @message)
end
@@ -137,7 +141,11 @@ class MessagesController < ApplicationController
#render file: 'messages#show', layout: 'base_courses'
end
if params[:is_board]
- redirect_to project_boards_url(@project)
+ if @project
+ redirect_to project_boards_path(@project)
+ elsif @course
+ redirect_to course_boards_path(@course)
+ end
else
redirect_to board_message_url(@board, @topic, :r => @reply)
end
@@ -179,16 +187,20 @@ class MessagesController < ApplicationController
@message.destroy
# modify by nwb
if @project
- if @message.parent
- redirect_to board_message_url(@board, @message.parent, :r => r)
- else
+ if params[:is_board]
redirect_to project_boards_url(@project)
+ else
+ redirect_to board_message_url(@board, @topic, :r => @reply)
end
elsif @course
- if @message.parent
- redirect_to board_message_url(@board, @message.parent, :r => r)
+ if params[:is_board]
+ redirect_to course_boards_url(@course)
else
- redirect_to course_board_url(@course, @board)
+ if @message.parent
+ redirect_to board_message_url(@board, @message.parent, :r => r)
+ else
+ redirect_to course_board_url(@course, @board)
+ end
end
end
end
diff --git a/app/views/boards/_course_new.html.erb b/app/views/boards/_course_new.html.erb
new file mode 100644
index 000000000..94ba51529
--- /dev/null
+++ b/app/views/boards/_course_new.html.erb
@@ -0,0 +1,9 @@
+<%= form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
+
+ <%= render :partial => 'form_course', :locals => {:f => f} %>
+
+ <%= link_to l(:button_cancel), course_boards_path(@course), :class => 'grey_btn fr ml10' %>
+ <%= l(:button_submit)%>
+
+
+<% end %>
diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb
index ed2c20448..357071214 100644
--- a/app/views/boards/_course_show.html.erb
+++ b/app/views/boards/_course_show.html.erb
@@ -1,28 +1,26 @@
-
- <% if User.current.logged? %>
-
- <%= link_to h(@board.name), course_board_path(@course, @board) %>
- <%= l(:label_message_new) %>
-
-
- <%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => false, :id => 'message-form'} do |f| %>
- <%= render :partial => 'messages/form_course', :locals => {:f => f} %>
-
- <%= l(:button_submit)%>
- <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => '$("#add-message").hide(); return false;' ,:class => 'ButtonColor m3p10' %>
-
- <% end %>
-
- <% end %>
-
+
-
<%= l(:label_board_plural) %>
-
+
+ <% if User.current.language == "zh"%>
+ <%= h @board.name %>
+ <% else %>
+ <%= l(:project_module_boards) %>
+ <% end %>
+
+
<%= l(:label_message_new) %>
+
+
+
+
+
+
+
+ <%= render :partial => 'course_new' %>
+
+
<% if !User.current.logged?%>
@@ -31,38 +29,127 @@
<% end %>
-
-
- <%= l(:label_totle) %>
- <%= @topic_count %>
- <%= l(:label_course_momes_count) %>
-
- <%= link_to l(:label_message_new),
- new_board_message_path(@board),
- :class => 'problem_new_btn fl c_dorange' if User.current.logged? %>
-
-
+
<% if @topics.any? %>
<% @topics.each do |topic| %>
-
- <%= link_to image_tag(url_to_avatar(topic.author), :width=>"32",:height=>"32"), user_path(topic.author),:class => 'problem_pic talk_pic fl' %>
-
- <%= link_to h(topic.subject.truncate(40,ommision:'...')), board_message_path(@board, topic),title: topic.subject.to_s,:class => "problem_tit fl fb c_dblue" %>
- <% if topic.sticky? %>
-
置顶
- <% end %>
-
-
由<%= link_to topic.author,user_path(topic.author),:class => "problem_name" %>添加于<%= format_time(topic.created_on) %>
-
- <%=link_to (l(:label_reply) + topic.replies_count.to_s), board_message_path(@board, topic),:class => "talk_btn fr c_white" %>
+
+ <%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %>
+
+ <% author = topic.author.to_s + ":" %>
+ <%= link_to author, user_path(topic.author), :class =>"talkmain_name fl " %>
+
<%= h(topic.subject) %>
+ <% if topic.sticky? %>
+
<%= l(:label_board_sticky)%>
+ <% end %>
-
-
+
+
+
+
+ <%= topic.content %>
+
+
+
+ <%= l(:label_activity_time)%>: <%= format_time topic.created_on %>
+
+ <%= toggle_link l(:button_reply), "reply" + topic.id.to_s, :focus => 'message_content',:class => ' c_dblue fr' %>
+
+
+
+
+ <% reply = Message.new(:subject => "RE: #{@message.subject}")%>
+ <% if !topic.locked? && authorize_for('messages', 'reply') %>
+
+
+
+ <%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message_form' + topic.id.to_s} do |f| %>
+
+ <%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
+
<%= l(:label_memo_create)%>
+ <% end %>
+
+
+ <% end %>
+ <% replies_all = topic.children.
+ includes(:author, :attachments, {:board => :project}).
+ reorder("#{Message.table_name}.created_on DESC").offset(2).
+ all %>
+ <% replies_show = topic.children.
+ includes(:author, :attachments, {:board => :project}).
+ reorder("#{Message.table_name}.created_on DESC").limit(2).
+ all %>
+ <% unless replies_show.empty? %>
+ <% reply_count = 0 %>
+
+
+ <% replies_show.each do |message| %>
+
+
+ <%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class =>'Msg_pic' %>
+
+ <%= link_to_user_header message.author,false,:class => 'fl c_orange ' %>
+
+
<%= textAreailizable message,:content,:attachments => message.attachments %>
+
+
+
<%= format_time(message.created_on) %>
+ <%= link_to(
+
+ l(:button_delete),
+ {:controller => 'messages', :action => 'destroy', :id => message.id, :board_id => message.board_id, :is_board => 'true'},
+ :method => :post,
+ :data => {:confirm => l(:text_are_you_sure)},
+ :title => l(:button_delete),
+ :class => ' c_dblue fr'
+ ) if message.course_destroyable_by?(User.current) %>
+
+
+
+
+ <% end %>
+
+
+
+
+ <% replies_all.each do |message| %>
+
+
+ <%= link_to image_tag(url_to_avatar(message.author), :width => '34',:height => '34'), user_path(message.author), :class =>'Msg_pic' %>
+
+ <%= link_to_user_header message.author,false,:class => 'fl c_orange ' %>
+
+
<%= textAreailizable message,:content,:attachments => message.attachments %>
+
+
+
<%= format_time(message.created_on) %>
+ <%= link_to(
+
+ l(:button_delete),
+ {:controller => 'messages', :action => 'destroy', :id => message.id, :board_id => message.board_id, :is_board => 'true'},
+ :method => :post,
+ :data => {:confirm => l(:text_are_you_sure)},
+ :title => l(:button_delete),
+ :class => ' c_dblue fr'
+ ) if message.course_destroyable_by?(User.current) %>
+
+
+
+
+ <% end %>
+
+
+
+
+ <% end %>
+
<% end %>
<% else %>
-
- <%= l(:label_no_data) %>
-
+
<%= l(:label_no_data) %>
<% end %>
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
diff --git a/app/views/boards/_form_course.html.erb b/app/views/boards/_form_course.html.erb
new file mode 100644
index 000000000..5cd2d8a2f
--- /dev/null
+++ b/app/views/boards/_form_course.html.erb
@@ -0,0 +1,60 @@
+<%= error_messages_for 'message' %>
+<% replying ||= false %>
+<% extra_option = replying ? { readonly: true} : { maxlength: 200 } %>
+<% if replying %>
+
+ * <%= l(:field_subject) %> :
+
+ <%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585" }.merge(extra_option) %>
+
+
+
+
+<% else %>
+
+ * <%= l(:field_subject) %> :
+
+
+ <%= f.text_field :subject, { size: 60, id: "message_subject", onkeyup: "regexSubject();",:class=>"talk_input w585" }.merge(extra_option) %>
+
+
+
+<% end %>
+
+ <% unless replying %>
+ <% if @message.safe_attribute? 'sticky' %>
+ <%= f.check_box :sticky %>
+ <%= label_tag 'message_sticky', l(:label_board_sticky) %>
+ <% end %>
+ <% if @message.safe_attribute? 'locked' %>
+ <%= f.check_box :locked %>
+ <%= label_tag 'message_locked', l(:label_board_locked) %>
+ <% end %>
+ <% end %>
+
+
+
+
+ <% unless replying %>
+ * <%= l(:field_description) %> :
+ <% end %>
+ <%= text_area :quote,:quote,:style => 'display:none' %>
+ <% if replying%>
+ <%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)", :style=>"width: 575px;" %>
+ <% else %>
+ <%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %>
+ <% end %>
+
+
+
+
+
+ <% unless replying %>
+
+ <%= render :partial => 'attachments/form_course', :locals => {:container => @message,:isReply => @isReply} %>
+
+ <% end %>
+
+
+
+
\ No newline at end of file
diff --git a/app/views/boards/_form_project.html.erb b/app/views/boards/_form_project.html.erb
new file mode 100644
index 000000000..b42cabbeb
--- /dev/null
+++ b/app/views/boards/_form_project.html.erb
@@ -0,0 +1,60 @@
+<%= error_messages_for 'message' %>
+<% replying ||= false %>
+<% extra_option = replying ? { readonly: true} : { maxlength: 200 } %>
+<% if replying %>
+
+ * <%= l(:field_subject) %> :
+
+ <%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585" }.merge(extra_option) %>
+
+
+
+
+<% else %>
+
+ * <%= l(:field_subject) %> :
+
+
+ <%= f.text_field :subject, { size: 60, id: "message_subject", onkeyup: "regexSubject();",:class=>"talk_input w585" }.merge(extra_option) %>
+
+
+
+<% end %>
+
+ <% unless replying %>
+ <% if @message.safe_attribute? 'sticky' %>
+ <%= f.check_box :sticky %>
+ <%= label_tag 'message_sticky', l(:label_board_sticky) %>
+ <% end %>
+ <% if @message.safe_attribute? 'locked' %>
+ <%= f.check_box :locked %>
+ <%= label_tag 'message_locked', l(:label_board_locked) %>
+ <% end %>
+ <% end %>
+
+
+
+
+ <% unless replying %>
+ * <%= l(:field_description) %> :
+ <% end %>
+ <%= text_area :quote,:quote,:style => 'display:none' %>
+ <% if replying%>
+ <%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)", :style=>"width: 575px;" %>
+ <% else %>
+ <%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %>
+ <% end %>
+
+
+
+
+
+<% unless replying %>
+
+ <%= render :partial => 'attachments/form_project', :locals => {:container => @message,:isReply => @isReply} %>
+
+ <% end %>
+
+
+
+
\ No newline at end of file
diff --git a/app/views/boards/_project_new_topic.html.erb b/app/views/boards/_project_new_topic.html.erb
index b5526e5de..371007a72 100644
--- a/app/views/boards/_project_new_topic.html.erb
+++ b/app/views/boards/_project_new_topic.html.erb
@@ -1,6 +1,6 @@
<%= form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
- <%= l(:project_module_boards_post) %>
- <%= render :partial => 'messages/form_project', :locals => {:f => f} %>
+
+ <%= render :partial => 'form_project', :locals => {:f => f} %>
<%= link_to l(:button_cancel), project_boards_path(@project), :class => 'grey_btn fr ml10' %>
<%= l(:button_submit)%>
diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb
index 5ee353c68..490c1a584 100644
--- a/app/views/boards/_project_show.html.erb
+++ b/app/views/boards/_project_show.html.erb
@@ -27,7 +27,7 @@
<%= render :partial => 'project_new_topic' %>
- 、
+
@@ -46,72 +46,108 @@
-
- <%= topic.content %> [展开]
-
+
+ <%= topic.content %>
+
- <%= l(:label_activity_time)%>: <%= format_time topic.created_on %>na
+
+ <%= l(:label_activity_time)%>: <%= format_time topic.created_on %>
- <%= link_to (l(:label_short_reply) + " "+topic.replies_count.to_s), board_message_path(@board, topic), :class => "talk_btn fr c_white" %>
+ <%= toggle_link l(:button_reply), "reply" + topic.id.to_s, :focus => 'message_content',:class => ' c_dblue fr' %>
- <% replies = topic.children.
+
+ <% reply = Message.new(:subject => "RE: #{@message.subject}")%>
+ <% if !topic.locked? && authorize_for('messages', 'reply') %>
+
+
+
+ <%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message_form' + topic.id.to_s} do |f| %>
+
+ <%= render :partial => 'form_project', :locals => {:f => f, :replying => true} %>
+
<%= l(:label_memo_create)%>
+ <% end %>
+
+
+ <% end %>
+ <% replies_all = topic.children.
includes(:author, :attachments, {:board => :project}).
- reorder("#{Message.table_name}.created_on DESC").
- limit(2).
+ reorder("#{Message.table_name}.created_on DESC").offset(2).
all %>
- <% unless replies.empty? %>
+ <% replies_show = topic.children.
+ includes(:author, :attachments, {:board => :project}).
+ reorder("#{Message.table_name}.created_on DESC").limit(2).
+ all %>
+ <% unless replies_show.empty? %>
<% reply_count = 0 %>
- <% replies.each do |message| %>
-
">
-
<%= link_to image_tag(url_to_avatar(message.author), :width => '46',:height => '46'), user_path(message.author) %>
-
-
- <%= link_to_user_header message.author,false,:class => 'c_blue fb fl mb10 ' %>
-
<%= format_time(message.created_on) %>
-
-
<%= textAreailizable message,:content,:attachments => message.attachments %>
-
-
+
+
<% end %>
+
+
+
+
<% end %>
- <% reply = Message.new(:subject => "RE: #{@message.subject}")%>
- <% if !topic.locked? && authorize_for('messages', 'reply') %>
-
- <%= form_for reply, :as => :reply, :url => {:controller=>'messages',:action => 'reply', :id => topic.id, :board_id => topic.board_id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
-
<%= l(:label_message_reply) %>
- <%= render :partial => 'messages/form_project', :locals => {:f => f, :replying => true} %>
-
<%= l(:button_submit)%>
- <% end %>
-
-
- <% end %>
+
<% end %>
<% else %>
<%= l(:label_no_data) %>
diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb
index f293fd350..50d33be39 100644
--- a/app/views/boards/show.html.erb
+++ b/app/views/boards/show.html.erb
@@ -46,7 +46,76 @@ function show_newtalk()
{
$("#about_newtalk").toggle();
}
-
+function show_newreply()
+{
+ $("#replyContent").toggle();
+}
+function show_more() {
+ $("#contentmessage").toggleClass("course_description_none");
+ var information = $("#expend_more_information2");
+ var arrow = $("#arrow2");
+ var val = information.attr("value");
+ if (val == "show_more") {
+ $("#expend_more_information2").text("收起");
+ information.attr("value", "hide_more");
+ arrow.attr("src", "/images/jiantouup.jpg")
+ }
+ else {
+ $("#expend_more_information2").text("展开");
+ information.attr("value", "show_more");
+ arrow.attr("src", "/images/jiantou.jpg")
+ }
+}
+function regexContent()
+{
+ var content = $.trim($("#message_content").val());
+ if(content.length ==0)
+ {
+ $("#message_content_span").text("<%= l(:label_reply_empty) %>");
+ $("#message_content_span").css('color','#ff0000');
+ flag = false;
+ }
+ else
+ {
+ $("#message_content_span").text("<%= l(:label_field_correct) %>");
+ $("#message_content_span").css('color','#008000');
+ flag = true;
+ }
+}
+function regexSubject()
+{
+ var content = $.trim($("#message_subject").val());
+ if(content.length ==0)
+ {
+ $("#subject_span").text("主题不能为空");
+ $("#subject_span").css('color','#ff0000');
+ return false;
+ }
+ else
+ {
+ $("#subject_span").text("填写正确");
+ $("#subject_span").css('color','#008000');
+ return true;
+ }
+ return false;
+}
+function regexContent()
+{
+ var content = message_content_editor.html();
+ if(content.length ==0)
+ {
+ $("#message_content_span").text("描述不能为空");
+ $("#message_content_span").css('color','#ff0000');
+ return false;
+ }
+ else
+ {
+ $("#message_content_span").text("填写正确");
+ $("#message_content_span").css('color','#008000');
+ return true;
+ }
+ return false;
+}
<% if @project %>
<%= render :partial => 'project_show', locals: {project: @project} %>
diff --git a/db/schema.rb b/db/schema.rb
index dcbe017fb..fa82de59a 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 => 20150428021035) do
+ActiveRecord::Schema.define(:version => 20150505025537) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -438,13 +438,6 @@ ActiveRecord::Schema.define(:version => 20150428021035) 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
@@ -541,6 +534,8 @@ ActiveRecord::Schema.define(:version => 20150428021035) do
t.integer "is_teacher_score", :default => 0
end
+ add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id"
+
create_table "homework_evaluations", :force => true do |t|
t.string "user_id"
t.string "homework_attach_id"
@@ -553,6 +548,9 @@ ActiveRecord::Schema.define(:version => 20150428021035) do
t.integer "bid_id"
end
+ add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id"
+ add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id"
+
create_table "homework_users", :force => true do |t|
t.string "homework_attach_id"
t.string "user_id"
@@ -1159,6 +1157,9 @@ ActiveRecord::Schema.define(:version => 20150428021035) do
t.datetime "updated_at", :null => false
end
+ 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 "taggings", :force => true do |t|
t.integer "tag_id"
t.integer "taggable_id"
diff --git a/public/javascripts/project.js b/public/javascripts/project.js
index 6dbb0ff6b..6dbc90271 100644
--- a/public/javascripts/project.js
+++ b/public/javascripts/project.js
@@ -58,7 +58,22 @@ function show_more_msg() {
arrow.attr("src", "/images/jiantou.jpg")
}
}
-
+function show_more_reply(contentid, id2, id3) {
+ $(contentid).toggleClass("course_description_none");
+ var information = $(id2);
+ var arrow = $(id3);
+ var val = information.attr("value");
+ if (val == "show_more") {
+ $(id2).text("收起");
+ information.attr("value", "hide_more");
+ arrow.attr("src", "/images/jiantouup.jpg")
+ }
+ else {
+ $(id2).text("展开更多信息");
+ information.attr("value", "show_more");
+ arrow.attr("src", "/images/jiantou.jpg")
+ }
+}
//项目版本库git帮助文档显示
function showhelpAndScrollTo(id) {
@@ -84,7 +99,29 @@ function showhelpAndScrollTo(id) {
information.attr("value", "show_help");
}
}
-
+function showhelpAndScrollToMessage(id, id1) {
+ $('#' + id).toggle();
+ if(cookieget("repositories_visiable") == "true")
+ {
+ cookiesave("repositories_visiable", false,'','','');
+ }
+ else
+ {
+ cookiesave("repositories_visiable", true,'','','');
+ }
+ var information = $(id1);
+ var val = information.attr("value");
+ if(val=="show_help")
+ {
+ $(id1).text("收起回复");
+ information.attr("value", "hide_help");
+ }
+ else
+ {
+ $(id1).text("展开回复");
+ information.attr("value", "show_help");
+ }
+}
$(function(){
From e884f58956b3aae418a96da83c1426908b5761f8 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 7 May 2015 16:12:56 +0800
Subject: [PATCH 10/11] =?UTF-8?q?=E5=8C=BF=E8=AF=84=E5=8F=AF=E4=BB=A5?=
=?UTF-8?q?=E6=89=930=E5=88=86=E5=B9=B6=E7=BB=99=E5=87=BA=E6=8F=90?=
=?UTF-8?q?=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/homework_attach/_addjour.html.erb | 11 ++++++++++-
app/views/homework_attach/_review.html.erb | 2 +-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/app/views/homework_attach/_addjour.html.erb b/app/views/homework_attach/_addjour.html.erb
index 824ddd8ce..e3aaa9591 100644
--- a/app/views/homework_attach/_addjour.html.erb
+++ b/app/views/homework_attach/_addjour.html.erb
@@ -21,7 +21,16 @@
function submit_jours(is_teacher)
{
- if(!is_teacher&&$("#stars_value").val() == "0"){alert("您还没有打分");return;}
+ if(!is_teacher&&$("#stars_value").val() == "0"){
+ if(confirm('是否确定评分为0分?'))
+ {
+
+ }
+ else
+ {
+ return;
+ }
+ }
if(!is_teacher&&$("#new_form_user_message").val() == ""){alert("您还没有填写评语");return;}
$('#new_form_user_message').parent().submit();
}
diff --git a/app/views/homework_attach/_review.html.erb b/app/views/homework_attach/_review.html.erb
index 15203e8fc..61642c2c6 100644
--- a/app/views/homework_attach/_review.html.erb
+++ b/app/views/homework_attach/_review.html.erb
@@ -22,7 +22,7 @@
<% end %>
-
+
<%= format_time(review.created_at) %>
From 3b58810528a1bc07ed65990437e2faf7d8b5d149 Mon Sep 17 00:00:00 2001
From: alan <547533434@qq.com>
Date: Thu, 7 May 2015 17:38:08 +0800
Subject: [PATCH 11/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E8=AE=A8=E8=AE=BA=E5=8C=BA=E7=9A=84js=20Signed-off-by:=20alan?=
=?UTF-8?q?=20<547533434@qq.com>?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/boards/_course_show.html.erb | 18 ++++++-------
app/views/boards/_project_show.html.erb | 25 ++++++++++---------
app/views/boards/show.html.erb | 17 +------------
.../layouts/_base_development_group.html.erb | 4 +--
app/views/layouts/base_projects.html.erb | 4 +--
.../projects/settings/_new_members.html.erb | 7 +++++-
public/javascripts/project.js | 11 ++++----
public/stylesheets/courses.css | 3 ++-
public/stylesheets/pleft.css | 1 +
public/stylesheets/project.css | 3 ++-
10 files changed, 43 insertions(+), 50 deletions(-)
diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb
index 357071214..8f2cddc48 100644
--- a/app/views/boards/_course_show.html.erb
+++ b/app/views/boards/_course_show.html.erb
@@ -44,17 +44,15 @@
-
-
- <%= topic.content %>
-
<%= toggle_link l(:button_reply), "reply" + topic.id.to_s, :focus => 'message_content',:class => ' c_dblue fr' %>
diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb
index 490c1a584..ef2591b30 100644
--- a/app/views/boards/_project_show.html.erb
+++ b/app/views/boards/_project_show.html.erb
@@ -1,5 +1,4 @@
-
-
+
<% if User.current.language == "zh"%>
<%= h @board.name %>
@@ -36,24 +35,25 @@
<%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %>
- <% author = topic.author.to_s + ":" %>
+ <% author = topic.author.to_s + ":" %>
<%= link_to author, user_path(topic.author), :class =>"talkmain_name fl " %>
<%= h(topic.subject) %>
<% if topic.sticky? %>
<%= l(:label_board_sticky)%>
<% end %>
+
-
+
+ <%= topic.content %>
+
+ [展开]
+
+
+
+
+
-
- <%= topic.content %>
-
<%= l(:label_activity_time)%>: <%= format_time topic.created_on %>
@@ -166,6 +166,7 @@
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@project}: #{@board}") %>
<% end %>
+