修改帖子页面

This commit is contained in:
fanqiang 2014-05-27 16:25:43 +08:00
parent fdf8b5640a
commit 4c3e2376f0
4 changed files with 17 additions and 14 deletions

View File

@ -70,6 +70,11 @@ class RelativeMemo < ActiveRecord::Base
def cannot_reply_to_locked_topic
errors.add :base, l(:label_memo_locked) if root.locked? && self != root
end
def short_content(length = 25)
str = "^(.{,#{length}})[^\n\r]*.*$"
content.gsub(Regexp.new(str), '\1...').strip if content
end
# def update_memos_forum
# if forum_id_changed?

View File

@ -51,20 +51,18 @@
</table></td>
</tr>
<tr>
<td colspan="2" ><span class="font_description"> </span></td>
<td><span class="font_description"><%= topic.short_content(70) %> </span></td>
</tr>
<tr>
<td align="left" colspan="2" ><span class="font_lighter"><%= user_url_and_time topic.username, topic.userhomeurl, topic.created_at %>
<td align="left"><span class="font_lighter"><%= user_url_and_time topic.username, topic.userhomeurl, topic.created_at %>
<br />
</span></td>
</tr>
<tr>
<td align="left" colspan="2" >帖子来源:<span class="font_lighter" style="color: #068d9c"><%=link_to 'OSChina', topic.url %>
<td align="left">帖子来源:<span class="font_lighter" style="color: #068d9c"><%=link_to 'OSChina', topic.url %>
</span></td>
<td align="left"><%= no_use_link(topic, User.current) %> </td>
<td colspan="3" align="center"><%= no_use_link(topic, User.current) %> </td>
</tr>
</table></td>
</tr>

View File

@ -51,17 +51,17 @@
</table></td>
</tr>
<tr>
<td colspan="2" ><span class="font_description"> </span></td>
<td><span class="font_description"> </span></td>
</tr>
<tr>
<td align="left" colspan="2" ><span class="font_lighter"><%= user_url_and_time topic.username, topic.userhomeurl, topic.created_at %>
<td align="left"><span class="font_lighter"><%= user_url_and_time topic.username, topic.userhomeurl, topic.created_at %>
<br />
</span></td>
</tr>
<tr>
<td align="left" colspan="2" >帖子来源:<span class="font_lighter" style="color: #068d9c"><%=link_to 'OSChina', topic.url %>
<td align="left">帖子来源:<span class="font_lighter" style="color: #068d9c"><%=link_to 'OSChina', topic.url %>
</span></td>
<td align="left"><%= no_use_link(topic, User.current) %> </td>
<td colspan="3" align="center"><%= no_use_link(topic, User.current) %> </td>
</tr>

View File

@ -467,17 +467,17 @@
</table></td>
</tr>
<tr>
<td colspan="2" ><span class="font_description"> </span></td>
<td><span class="font_description"> </span></td>
</tr>
<tr>
<td align="left" colspan="2" ><span class="font_lighter"><%=user_url_and_time topic.username, topic.userhomeurl, topic.created_at %>
<td align="left"><span class="font_lighter"><%=user_url_and_time topic.username, topic.userhomeurl, topic.created_at %>
<br />
</span></td>
</tr>
<tr>
<td align="left" colspan="2" >帖子来源:<span class="font_lighter" style="color: #068d9c"><%=link_to 'OSChina', topic.url %>
<td align="left">帖子来源:<span class="font_lighter" style="color: #068d9c"><%=link_to 'OSChina', topic.url %>
</span></td>
<td align="left"><%= no_use_link(topic, User.current) %> </td>
<td colspan="3" align="center"><%= no_use_link(topic, User.current) %> </td>
</tr>
</table></td>
</tr>