From 72ef4e1db4bf56e8c0aeca354425ef72b97f5eb9 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Thu, 14 May 2015 15:11:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A8=E8=AE=BA=E5=8C=BA?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=98=AF=E4=B8=BB=E9=A2=98=EF=BC=8C=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E4=B8=BA=E7=A9=BA=E6=97=B6=E6=8A=A5=E9=94=99=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E5=8A=A8=E6=80=81=E9=A1=B5=E9=9D=A2=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20Signed-off-by:=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/boards/_course_new.html.erb | 2 +- app/views/boards/_course_show.html.erb | 2 +- app/views/boards/_edit.html.erb | 2 +- app/views/boards/_form_course.html.erb | 12 +++--- app/views/boards/_form_project.html.erb | 16 +++---- app/views/boards/_project_show.html.erb | 19 +-------- app/views/boards/show.html.erb | 30 +++++++++++--- app/views/courses/show.html.erb | 2 +- app/views/projects/show.html.erb | 4 +- public/javascripts/course.js | 55 +++++++++++++------------ public/javascripts/project.js | 39 +++++++++++------- public/stylesheets/project.css | 2 +- 12 files changed, 98 insertions(+), 87 deletions(-) diff --git a/app/views/boards/_course_new.html.erb b/app/views/boards/_course_new.html.erb index fba80127b..a380ad67f 100644 --- a/app/views/boards/_course_new.html.erb +++ b/app/views/boards/_course_new.html.erb @@ -3,7 +3,7 @@ <%= render :partial => 'form_course', :locals => {:f => f, :topic => @message} %>
讨论区共有<%= @topic_count %>个帖子
<% if @topics.any? %> <% @topics.each do |topic| %> -<%= e.event_description.html_safe %>
diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb
index abc63601e..6aab0a4a9 100644
--- a/app/views/projects/show.html.erb
+++ b/app/views/projects/show.html.erb
@@ -66,9 +66,7 @@
<%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %> <%= l(:label_new_activity) %> :
<%= link_to format_activity_title("#{act.board.name}: #{act.subject}"),
- {:controller => 'messages',
- :action => 'show',
- :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}),
+ project_boards_path(@project,:topic_id => act.id),
:class => "problem_tit fl fb " %>
<%= textAreailizable act,:content %>
diff --git a/public/javascripts/course.js b/public/javascripts/course.js
index f0b1338da..227048ef6 100644
--- a/public/javascripts/course.js
+++ b/public/javascripts/course.js
@@ -151,45 +151,48 @@ function submit_edit_course(id)
///////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////课程讨论区
-function regexSubject()
-{
- var content = $.trim($("#message_subject").val());
- if(content.length ==0)
- {
- $("#subject_span").text("主题不能为空");
- $("#subject_span").css('color','#ff0000');
+function regexSubject(id) {
+ var subjectid = "#message_subject" + id ;
+ var content = $.trim($(subjectid).val());
+ var message = "#subject_span" + id;
+ if (content.length == 0) {
+ $(message).text("主题不能为空");
+ $(message).css('color', '#ff0000');
return false;
}
- else
- {
- $("#subject_span").text("填写正确");
- $("#subject_span").css('color','#008000');
+ else {
+ $(message).text("填写正确");
+ $(message).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');
+function regexContent(id) {
+ var contentid = "#message_content" + id;
+ var message = "#message_content_span"+ id;
+ var content = $.trim($(contentid).val());
+ if (content.length == 0) {
+ $(message).text("描述不能为空");
+ $(message).css('color', '#ff0000');
return false;
}
- else
- {
- $("#message_content_span").text("填写正确");
- $("#message_content_span").css('color','#008000');
+ else {
+ $(message).text("填写正确");
+ $(message).css('color', '#008000');
return true;
}
return false;
}
-function submitCoursesBoard()
-{
- message_content_editor.sync();
- if(regexSubject()&®exContent()){$("#message-form").submit();}
+
+// 项目讨论区编辑和提交
+function submitProjectsBoard(id) {
+ var formid = "#message-form" + id;
+ if (regexSubject(id) && regexContent(id)) {
+ $(formid).submit();
+ }
}
+
+
///////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////// 课程通知
function regexTitle()
diff --git a/public/javascripts/project.js b/public/javascripts/project.js
index 0bc094b1d..c892f964b 100644
--- a/public/javascripts/project.js
+++ b/public/javascripts/project.js
@@ -144,42 +144,49 @@ $(function(){
///////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////项目讨论区
-function regexSubject() {
- var content = $.trim($("#message_subject").val());
+function regexSubject(id) {
+ var subjectid = "#message_subject" + id ;
+ var content = $.trim($(subjectid).val());
+ var message = "#subject_span" + id;
if (content.length == 0) {
- $("#subject_span").text("主题不能为空");
- $("#subject_span").css('color', '#ff0000');
+ $(message).text("主题不能为空");
+ $(message).css('color', '#ff0000');
return false;
}
else {
- $("#subject_span").text("填写正确");
- $("#subject_span").css('color', '#008000');
+ $(message).text("填写正确");
+ $(message).css('color', '#008000');
return true;
}
return false;
}
-function regexContent() {
- var content = $.trim($("#message_content").val());
+function regexContent(id) {
+
+ var contentid = "#message_content" + id;
+ var message = "#message_content_span"+ id;
+ var content = $.trim($(contentid).val());
if (content.length == 0) {
- $("#message_content_span").text("描述不能为空");
- $("#message_content_span").css('color', '#ff0000');
+ alert(message);
+ $(message).text("描述不能为空");
+ $(message).css('color', '#ff0000');
return false;
}
else {
- $("#message_content_span").text("填写正确");
- $("#message_content_span").css('color', '#008000');
+
+ $(message).text("填写正确");
+ $(message).css('color', '#008000');
return true;
}
return false;
}
// 项目讨论区编辑和提交
-function submitProjectsBoard() {
- if (regexSubject() && regexContent()) {
- $("#message-form").submit();
+function submitProjectsBoard(id) {
+ var formid = "#message-form" + id;
+ if (regexSubject(id) && regexContent(id)) {
+ $(formid).submit();
}
}
-
// 提交新闻
function regexTitle() {
var name = $("#news_title").val();
diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css
index 14a7a9a34..3b04e23bf 100644
--- a/public/stylesheets/project.css
+++ b/public/stylesheets/project.css
@@ -738,6 +738,6 @@ a:hover.Reply_pic{border:1px solid #64bdd9;}
.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;}