Improved quotes
This commit is contained in:
@@ -54,4 +54,25 @@ blockquote {
|
|||||||
font-style: italic;
|
font-style: italic;
|
||||||
margin: 10px 0px 0px 25px;
|
margin: 10px 0px 0px 25px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
blockquote span.a, blockquote span.b {
|
||||||
|
font-family: helvetica, arial; font-size: 50px; color: #8ac;
|
||||||
|
}
|
||||||
|
|
||||||
|
blockquote span.a {
|
||||||
|
position: relative;
|
||||||
|
top:0.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
blockquote span.b {
|
||||||
|
position:relative;
|
||||||
|
top:0.8em;
|
||||||
|
}
|
||||||
|
|
||||||
|
blockquote cite {
|
||||||
|
display: block;
|
||||||
|
text-align: left;
|
||||||
|
font-style: normal;
|
||||||
|
font-weight:bold;
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ class PostsController < ApplicationController
|
|||||||
if params[:quote]
|
if params[:quote]
|
||||||
quote_post = Post.find(params[:quote])
|
quote_post = Post.find(params[:quote])
|
||||||
if quote_post
|
if quote_post
|
||||||
@post.body = "[quote]#{quote_post.body}[/quote]"
|
@post.body = "[quote=#{quote_post.user.username}]#{quote_post.body}[/quote]"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -42,4 +42,4 @@ class PostsController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,6 +4,16 @@ class TopicsController < ApplicationController
|
|||||||
|
|
||||||
def show
|
def show
|
||||||
@topic.hit! if @topic
|
@topic.hit! if @topic
|
||||||
|
|
||||||
|
@my_blockquote = {
|
||||||
|
'Quote' => [
|
||||||
|
/\[quote(:.*)?=(.*?)\](.*?)\[\/quote\1?\]/mi,
|
||||||
|
'<blockquote><cite>\2</cite><span class="a">“</span>\3<span class="b">”</span></blockquote>',
|
||||||
|
'Quote with citation',
|
||||||
|
'[quote=mike]please quote me[/quote]',
|
||||||
|
:quote
|
||||||
|
],
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|||||||
@@ -1,11 +1,3 @@
|
|||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
@my_blockquote = {
|
|
||||||
'Quote' => [
|
|
||||||
/\[quote\](.*?)\[\/quote\1?\]/mi,
|
|
||||||
'<blockquote>\3</blockquote>',
|
|
||||||
'Quote with citation',
|
|
||||||
'[quote=mike]please quote me[/quote]',
|
|
||||||
:quote
|
|
||||||
],
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="post_body">
|
<td class="post_body">
|
||||||
<%= post.body.bbcode_to_html().html_safe %>
|
<%= post.body.bbcode_to_html(@my_blockquote).html_safe %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<%end%>
|
<%end%>
|
||||||
|
|||||||
Reference in New Issue
Block a user