Signed-off-by: alan <547533434@qq.com>

This commit is contained in:
alan 2015-05-14 15:42:20 +08:00
parent 8a52225f4d
commit 0708279c5e
3 changed files with 12 additions and 10 deletions

View File

@ -40,12 +40,10 @@
<p class="talkmain_tit fl fb break_word">&nbsp;&nbsp;<%= h(topic.subject) %></p>
<% if topic.course_editable_by?(User.current) %>
<a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" style="color: #426e9a;float: left;
margin-left: 20px;"><%= l(:button_edit) %></a>
<% end %>
<% if topic.sticky? %>
<a href="javascript:void(0)" class="talk_up fr c_red" style="margin-right: 10px;"><%= l(:label_board_sticky)%></a>
<a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" style="color: #426e9a;float: right;
margin-right: 10px;"><%= l(:button_edit) %></a>
<% 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? %>
<a href="javascript:void(0)" class="talk_up fr c_red" style="margin-right: 10px;"><%= l(:label_board_sticky)%></a>
<% end %>
<div class="cl"></div>
<script>
@ -63,7 +63,7 @@
</script>
<div class="project_board_content break_word" id="content_<%=topic.id%>">
<div id="contentmessage<%=topic.id %>" class="upload_img">
<%= topic.content %>
<%= topic.content.html_safe %>
</div>
</div>

View File

@ -12,7 +12,7 @@
} do |f| %>
<%= render :partial => 'form_project',
:locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %>
<a href="#" onclick="submitProjectsBoard('#message-form<%= topic.id%>');" class="blue_btn fl c_white" ><%= l(:button_submit)%></a>
<a href="javascript:void(0)" onclick="submitProjectsBoard('<%= topic.id%>');" class="blue_btn fl c_white" ><%= l(:button_submit)%></a>
<a href="javascript:void(0)" onclick="show_newtalk1('#about_newtalk<%= topic.id%>');" class="blue_btn grey_btn fl c_white"><%= l(:button_cancel) %></a>
<%#= 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" %>
</ul>
@ -31,7 +31,7 @@
} do |f| %>
<%= render :partial => 'form_course',
:locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %>
<a href="javascript:void(0)" onclick="$('#message-form<%= topic.id%>').submit();"class="blue_btn fl c_white"><%= l(:button_submit)%></a>
<a href="javascript:void(0)" onclick="submitProjectsBoard('<%= topic.id%>');"class="blue_btn fl c_white"><%= l(:button_submit)%></a>
<%= 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 %>

View File

@ -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();
}