From b5719aca8ec83f6b5baf3d326e85bb9b0f88028c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 14 May 2015 14:38:22 +0800 Subject: [PATCH 01/17] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E6=88=91=E8=A6=81=E6=8F=90=E9=97=AE=E5=90=8E=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E5=B8=96=E5=AD=90=E6=98=BE=E7=A4=BA=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/memos/_topic_form.html.erb | 12 +++++------ app/views/memos/new.html.erb | 32 ++++++++++++++-------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/app/views/memos/_topic_form.html.erb b/app/views/memos/_topic_form.html.erb index 3ce8cdf9a..6ce63bef6 100644 --- a/app/views/memos/_topic_form.html.erb +++ b/app/views/memos/_topic_form.html.erb @@ -2,15 +2,15 @@
<%= f.text_field :subject, :required => true, :size => 95 %>
+<%= f.text_field :subject, :required => true, :size => 95, :style => 'width:98%' %>
<%= f.kindeditor :content,:width=>'99%', :required => true %>
-
- <%= l(:label_attachment_plural) %>
- <%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
-
<%= l(:label_projects_community)%> | -<%= l(:label_user_location) %> : | -
-
-
- |
-
<%= link_to request.host()+"/forums", forums_path %> | -<%=link_to l(:label_home),home_path %> > <%=link_to l(:label_forum), :controller => 'forums', :action => 'index' %> > <%=link_to @forum.name %> |
-
<%= l(:label_projects_community)%> | +<%= l(:label_user_location) %> : | +
+
+
+ |
+
<%= link_to request.host()+"/forums", forums_path %> | +<%=link_to l(:label_home),home_path %> > <%=link_to l(:label_forum), :controller => 'forums', :action => 'index' %> > <%=link_to @forum.name %> |
+
讨论区共有<%= @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;}
From 8d44ed2189456f5aa79030a309398c60d56a134b Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Thu, 14 May 2015 15:17:30 +0800
Subject: [PATCH 04/17] =?UTF-8?q?=E8=AF=BE=E7=A8=8B--=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E9=80=9A=E7=9F=A5=EF=BC=9A=E5=8F=96=E6=B6=88=E7=BC=96=E8=BE=91?=
=?UTF-8?q?=E9=80=9A=E7=9F=A5=EF=BC=8C=E5=BA=94=E8=AF=A5=E8=BF=94=E5=9B=9E?=
=?UTF-8?q?=E9=80=9A=E7=9F=A5=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=EF=BC=8C?=
=?UTF-8?q?=E8=80=8C=E9=9D=9E=E4=B8=80=E4=B8=AA=E7=A9=BA=E7=99=BD=E9=A1=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/news/_course_form.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/news/_course_form.html.erb b/app/views/news/_course_form.html.erb
index a76d84701..32c8e368e 100644
--- a/app/views/news/_course_form.html.erb
+++ b/app/views/news/_course_form.html.erb
@@ -29,7 +29,7 @@
<%= link_to l(:button_cancel), course_news_index_path(@course), :onclick => '$("#add-news").hide()', :class => 'blue_btn grey_btn fl c_white' %>
<% else %>
<%= link_to l(:button_save), "javascript:void(0)", :onclick => "submitNews();",:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white' %>
- <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => '$("#edit-news").hide(); return false;',:class => 'blue_btn grey_btn fl c_white' %>
+ <%= link_to l(:button_cancel), news_path(@news), :class => 'blue_btn grey_btn fl c_white' %>
<% end %>
<%= h(topic.subject) %>
<% if topic.course_editable_by?(User.current) %> - <%= l(:button_edit) %> - <% end %> - <% if topic.sticky? %> - <%= l(:label_board_sticky)%> + <%= l(:button_edit) %> <% end %> + <%= link_to( l(:button_delete), {:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'}, @@ -55,7 +53,9 @@ :style => ' margin-right: 10px;' ) if topic.destroyable_by?(User.current) %> - + <% if topic.sticky? %> + <%= l(:label_board_sticky)%> + <% end %><%= e.event_description.html_safe %>
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index fe36b2cd1..6083b547c 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -323,10 +323,9 @@
<%= 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}"}) %>
-
+ act.board.project ? project_boards_path(act.board.project,:topic_id => act.id) : course_boards_path(act.board.course,:topic_id => act.id),
+ :class => "problem_tit fl fb " %>
+
<% else %>
<%= content_tag('span', h(e.project), :class => 'project') %> <%= l(:label_new_activity) %> <%= link_to format_activity_title(e.event_title), e.event_url %> | +<%= content_tag('span', h(e.project), :class => 'project') %> <%= l(:label_new_activity) %> + <% if e.event_type.eql?("message") || e.event_type.eql?("reply") %> + <%= link_to format_activity_title(e.event_title), e.board.project ? project_boards_path(e.board.project,:topic_id => e.id):course_boards_path(e.board.course,:topic_id => e.id) %> + <%else %> + <%= link_to format_activity_title(e.event_title), e.event_url %> + <%end%> + | ||
<%= format_activity_description(e.event_description) %> |
From 0db90f98d5cec223d00e34600e754192d384b1f7 Mon Sep 17 00:00:00 2001
From: alan <547533434@qq.com>
Date: Thu, 14 May 2015 17:09:38 +0800
Subject: [PATCH 15/17] =?UTF-8?q?wiki=E7=9A=84attachment=E4=B8=8E=E8=AE=A8?=
=?UTF-8?q?=E8=AE=BA=E5=8C=BA=E5=86=B2=E7=AA=81=20Signed-off-by:=20alan=20?=
=?UTF-8?q?<547533434@qq.com>?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/attachments/_form_project.html.erb | 74 ++++++++++++++++++--
1 file changed, 69 insertions(+), 5 deletions(-)
diff --git a/app/views/attachments/_form_project.html.erb b/app/views/attachments/_form_project.html.erb
index 9778d3242..f5353ce2a 100644
--- a/app/views/attachments/_form_project.html.erb
+++ b/app/views/attachments/_form_project.html.erb
@@ -1,4 +1,5 @@
-
+<% if defined?(container) %>
+