From f638dd6810eca5b95c541a3d042b78d42eb5c83f Mon Sep 17 00:00:00 2001 From: alanlong9278 <547533434@qq.com> Date: Fri, 8 May 2015 09:55:19 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=E5=8C=BA=20Signed-off-by:=20alanlong9278=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/course.js | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/public/javascripts/course.js b/public/javascripts/course.js index c0c761bfa..cc57279f0 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -527,3 +527,44 @@ function search_tag_attachment(url,tag_name,q,course_id,sort) } ); } + +// 课程讨论区 +function showhelpAndScrollToMessage(id, id1, count) { + $('#' + 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("收起回复(" + count + ")" ); + information.attr("value", "hide_help"); + } + else + { + $(id1).text("展开回复(" + count + ")"); + information.attr("value", "show_help"); + } +} +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") + } +} \ No newline at end of file From 65c2c43dcba98556c5b858dfc115de21df4ee39d Mon Sep 17 00:00:00 2001 From: alanlong9278 <547533434@qq.com> Date: Fri, 8 May 2015 10:09:01 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E5=B1=95=E5=BC=80=E6=94=B6=E8=B5=B7?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=20Signed-off-by:=20alanlong9278=20<547533434?= =?UTF-8?q?@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/boards/_course_show.html.erb | 5 +++-- app/views/boards/_project_show.html.erb | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 045ff90f3..3b14ee767 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -141,8 +141,9 @@ <% end %> -
- + <%if replies_all.first %> + + <% end %> <% end %> <% end %> diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb index b4fb47976..aff39b0f3 100644 --- a/app/views/boards/_project_show.html.erb +++ b/app/views/boards/_project_show.html.erb @@ -144,8 +144,9 @@ <% end %> + <%if replies_all.first %> - + <% end %> <% end %> <% end %> From 39fe748da7c6bf0ddd560b4ef2142f6444c10bc0 Mon Sep 17 00:00:00 2001 From: huang<%= h(topic.subject) %>
+<%= h(topic.subject) %>
<% if topic.sticky? %> <%= l(:label_board_sticky)%> <% end %> -+
<%= topic.content %>
@@ -95,7 +95,7 @@
<%= textAreailizable message,:content,:attachments => message.attachments %>
+<%= textAreailizable message,:content,:attachments => message.attachments %>
<%= textAreailizable message,:content,:attachments => message.attachments %>
+<%= textAreailizable message,:content,:attachments => message.attachments %>
<%= h(topic.subject) %>
<% if topic.sticky? %> <%= l(:label_board_sticky)%> From 5167cf374c2d6253513d6a6466c32349fe82422e Mon Sep 17 00:00:00 2001 From: huang<%= topic.content %> -
+
+
讨论区共有<%= @topic_count %>个帖子 <%= h(topic.subject) %> 讨论区共有<%= @topic_count %>个帖子 <%= h(topic.subject) %> <%= h(topic.subject) %> <%= h(topic.subject) %> <%= h(topic.subject) %> <%= h(topic.subject) %>
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb
index 2a26ff59f..8361c3874 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -133,7 +133,7 @@
+ <%= render :partial => 'edit',locals: {:topic => topic} %>
+
+
+ <%= form_for topic, { :as => :message,
+ :url => {:controller => 'messages',:action => 'edit', :is_board => 'true',:id => topic.id, :board_id => topic.board_id},
+ :html => {:multipart => true,
+ :id => 'message-form' + topic.id.to_s,
+ :method => :post}
+ } do |f| %>
+ <%= render :partial => 'form_project',
+ :locals => {:f => f, :replying => !topic.parent.nil?} %>
+ <%= l(:button_submit)%>
+ <%= link_to l(:button_cancel), board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "blue_btn grey_btn fl c_white" %>
+
+
+ <%= form_for topic, {
+ :as => :message,
+ :url => {:controller => 'messages',:action => 'edit', :is_board => 'true',:id => topic.id, :board_id => topic.board_id},
+ :html => {:multipart => true,
+ :id => 'message-form' + topic.id.to_s,
+ :method => :post}
+ } do |f| %>
+ <%= render :partial => 'form_course',
+ :locals => {:f => f, :replying => !topic.parent.nil?} %>
+ <%= l(:button_submit)%>
+ <%= link_to l(:button_cancel), board_message_url(topic.board,topic.root, :r => (topic.parent_id &&topic.id)), :class => "blue_btn grey_btn fl c_white" %>
+
+ <% end %>
+
+
+ <%= render :partial => 'edit',locals: {:topic => topic} %>
+
+
diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb
index 124472f5c..a9698f546 100644
--- a/app/views/boards/_project_show.html.erb
+++ b/app/views/boards/_project_show.html.erb
@@ -37,21 +37,24 @@