From 0708279c5ec60b687711a5e8053603c3b128302a Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Thu, 14 May 2015 15:42:20 +0800 Subject: [PATCH] Signed-off-by: alan <547533434@qq.com> --- app/views/boards/_course_show.html.erb | 14 +++++++------- app/views/boards/_edit.html.erb | 4 ++-- public/javascripts/project.js | 4 +++- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 19d0e6bc9..617b9428a 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -40,12 +40,10 @@

  <%= 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 %>
- <%= topic.content %> + <%= topic.content.html_safe %>
diff --git a/app/views/boards/_edit.html.erb b/app/views/boards/_edit.html.erb index a9acbf85f..46131ca51 100644 --- a/app/views/boards/_edit.html.erb +++ b/app/views/boards/_edit.html.erb @@ -12,7 +12,7 @@ } do |f| %> <%= render :partial => 'form_project', :locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %> - <%= l(:button_submit)%> + <%= l(:button_submit)%> <%= l(:button_cancel) %> <%#= 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" %> @@ -31,7 +31,7 @@ } do |f| %> <%= render :partial => 'form_course', :locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %> - <%= l(:button_submit)%> + <%= 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 %> diff --git a/public/javascripts/project.js b/public/javascripts/project.js index c28a86f08..70888e5d0 100644 --- a/public/javascripts/project.js +++ b/public/javascripts/project.js @@ -145,6 +145,7 @@ $(function(){ /////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////项目讨论区 function regexSubject(id) { + var subjectid = "#message_subject" + id ; var content = $.trim($(subjectid).val()); var message = "#subject_span" + id; @@ -166,7 +167,7 @@ function regexContent(id) { var message = "#message_content_span"+ id; var content = $.trim($(contentid).val()); if (content.length == 0) { - + $(message).text("描述不能为空"); $(message).css('color', '#ff0000'); return false; @@ -183,6 +184,7 @@ function regexContent(id) { // 项目讨论区编辑和提交 function submitProjectsBoard(id) { var formid = "#message-form" + id; + if (regexSubject(id) && regexContent(id)) { $(formid).submit(); }