修改帖子页面
This commit is contained in:
parent
fdf8b5640a
commit
4c3e2376f0
|
@ -70,6 +70,11 @@ class RelativeMemo < ActiveRecord::Base
|
||||||
def cannot_reply_to_locked_topic
|
def cannot_reply_to_locked_topic
|
||||||
errors.add :base, l(:label_memo_locked) if root.locked? && self != root
|
errors.add :base, l(:label_memo_locked) if root.locked? && self != root
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def short_content(length = 25)
|
||||||
|
str = "^(.{,#{length}})[^\n\r]*.*$"
|
||||||
|
content.gsub(Regexp.new(str), '\1...').strip if content
|
||||||
|
end
|
||||||
|
|
||||||
# def update_memos_forum
|
# def update_memos_forum
|
||||||
# if forum_id_changed?
|
# if forum_id_changed?
|
||||||
|
|
|
@ -51,20 +51,18 @@
|
||||||
</table></td>
|
</table></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" ><span class="font_description"> </span></td>
|
<td><span class="font_description"><%= topic.short_content(70) %> </span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<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 />
|
<br />
|
||||||
</span></td>
|
</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<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>
|
</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>
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
</table></td>
|
</table></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
|
@ -51,17 +51,17 @@
|
||||||
</table></td>
|
</table></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" ><span class="font_description"> </span></td>
|
<td><span class="font_description"> </span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<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 />
|
<br />
|
||||||
</span></td>
|
</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<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>
|
</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>
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -467,17 +467,17 @@
|
||||||
</table></td>
|
</table></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" ><span class="font_description"> </span></td>
|
<td><span class="font_description"> </span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<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 />
|
<br />
|
||||||
</span></td>
|
</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
<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>
|
</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>
|
</tr>
|
||||||
</table></td>
|
</table></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Reference in New Issue