增加附件功能以及修改路由跳转

Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
alan 2015-05-11 16:23:15 +08:00
parent c21f2c3927
commit 25bcc676b9
8 changed files with 18 additions and 10 deletions

View File

@ -27,7 +27,7 @@ class BoardsController < ApplicationController
include SortHelper
helper :watchers
helper :project_score
helper :attachments
def index
#modify by nwb
@flag = params[:flag] || false

View File

@ -1,6 +1,6 @@
<%= form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'form_course', :locals => {:f => f} %>
<%= render :partial => 'form_course', :locals => {:f => f, :topic => @message} %>
<li>
<%= link_to l(:button_cancel), course_boards_path(@course), :class => 'grey_btn fr ml10' %>
<a href="#" onclick="$('#message-form').submit();" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a>

View File

@ -57,6 +57,7 @@
<br/>
<% if topic.content.size > 300 %>
<p>
<div id="contentmessage<%=topic.id %>" class="project_board_content">
<%= topic.content %>
@ -66,6 +67,8 @@
<img id="arrow<%=topic.id%>" src="/images/jiantou.jpg" width="12" height="6" />
</span>
</p>
<% end %>
<%= link_to_attachments_course topic, :author => false %>
<%= l(:label_activity_time)%>&nbsp;&nbsp;<%= format_time topic.created_on %>
</div>
<%= toggle_link l(:button_reply), "reply" + topic.id.to_s, :focus => 'message_content',:class => ' c_dblue fr' %>

View File

@ -11,9 +11,10 @@
:method => :post}
} do |f| %>
<%= render :partial => 'form_project',
:locals => {:f => f, :replying => !topic.parent.nil?} %>
:locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %>
<a href="#" onclick="$('#message-form<%= topic.id%>').submit();"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" %>
<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>
</div>
<% end %>
@ -29,7 +30,7 @@
:method => :post}
} do |f| %>
<%= render :partial => 'form_course',
:locals => {:f => f, :replying => !topic.parent.nil?} %>
: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>
<%= 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" %>

View File

@ -51,7 +51,7 @@
<li>
<% unless replying %>
<div class="fl ml3" style="padding-left: 52px;">
<%= render :partial => 'attachments/form_project', :locals => {:container => @message,:isReply => @isReply} %>
<%= render :partial => 'attachments/form_project', :locals => {:container => topic,:isReply => true} %>
</div>
<% end %>
</li>

View File

@ -1,6 +1,6 @@
<%= form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'form_project', :locals => {:f => f} %>
<%= render :partial => 'form_project', :locals => {:f => f, :topic => @message} %>
<li>
<%= link_to l(:button_cancel), project_boards_path(@project), :class => 'grey_btn fr ml10' %>
<a href="#" onclick="$('#message-form').submit();" class="blue_btn fr " style="margin-left: 55px"><%= l(:button_submit)%></a>

View File

@ -61,6 +61,7 @@
<p id="contentmessage<%=topic.id %>" class="project_board_content break_word">
<%= topic.content %>
</p>
<% if topic.content.size > 300 %>
<p>
<label id="expend_more_information<%= topic.id%>" onclick="show_more_reply('#contentmessage<%=topic.id %>','#expend_more_information<%= topic.id%>','#arrow<%=topic.id%>');" value="show_more">[展开]</label>
<span class="g-arr-down">
@ -68,14 +69,17 @@
</span>
</p>
<% end %>
<%= link_to_attachments_course topic, :author => false %>
<%= l(:label_activity_time)%>&nbsp;&nbsp;<%= format_time topic.created_on %>
</div>
<%= toggle_link l(:button_reply), "reply" + topic.id.to_s, :focus => 'message_content',:class => ' c_dblue fr' %>
<div class="cl"></div>
</div><!--讨论主类容 end-->
<div class="talk_new ml15 mb10" id="about_newtalk<%=topic.id%>" style="display:<%= !@flag.nil? && @flag=='true' ? 'block' : 'none' %>;">

View File

@ -49,7 +49,7 @@ a:hover.subnav_green{ background:#14ad5a;}
/*简介*/
.project_intro{ width:220px; padding:10px; background:#fff; margin-top:10px; padding-top:5px; color:#6d6d6d; line-height:1.9;}
.course_description{max-height: 112px;overflow:hidden; word-break: break-all;word-wrap: break-word;}
.project_board_content{overflow: hidden;max-height: 50px;word-break: break-all;word-wrap: break-word;}
.project_board_content{overflow: hidden;max-height: 55px;word-break: break-all;word-wrap: break-word;}
.course_description_none{max-height: none;}
.lg-foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:220px; height:23px; cursor:pointer;display: none;}
.lg-foot:hover{ color:#787b7e; border:1px solid #d4d4d4;}