Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
AE
Sith
Commits
67642248
Commit
67642248
authored
Feb 24, 2017
by
Skia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix quote answer and unread messages display
parent
254126fd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
12 deletions
+16
-12
core/static/core/style.css
core/static/core/style.css
+5
-1
core/templatetags/renderer.py
core/templatetags/renderer.py
+1
-1
forum/templates/forum/topic.jinja
forum/templates/forum/topic.jinja
+9
-9
forum/views.py
forum/views.py
+1
-1
No files found.
core/static/core/style.css
View file @
67642248
...
...
@@ -203,7 +203,11 @@ ul, ol {
code
{
font-family
:
monospace
;
}
blockquote
{
margin
:
10px
;
padding
:
5px
;
border
:
solid
1px
black
;
}
.edit-bar
{
display
:
block
;
margin
:
4px
;
...
...
core/templatetags/renderer.py
View file @
67642248
...
...
@@ -10,7 +10,7 @@ register = template.Library()
@
register
.
filter
(
is_safe
=
False
)
@
stringfilter
def
markdown
(
text
):
return
mark_safe
(
md
(
escape
(
text
))
)
return
mark_safe
(
md
(
text
))
@
register
.
filter
()
@
stringfilter
...
...
forum/templates/forum/topic.jinja
View file @
67642248
...
...
@@ -36,18 +36,18 @@
<h3>
{{
topic.title
}}
</h3>
<p>
{{
topic.description
}}
</p>
<p><a
href=
"
{{
url
(
'forum:new_message'
,
topic_id
=
topic.id
)
}}
"
>
Reply
</a></p>
{%
set
unread
=
False
%}
{%
set
vars
=
{
'unread'
:
False
}
%}
{# ugly hack to counter Jinja scopes #}
{%
for
m
in
topic.messages.all
()
%}
{%
if
m.id
==
first_unread_message_id
%}
<div
class=
"message unread"
id=
"first_unread"
>
{%
set
unread
=
True
%}
{%
elif
unread
%}
<div
class=
"message unread"
>
{%
if
m.id
==
first_unread_message_id
and
vars.update
(
{
'unread'
:
True
}
)
%}
{# idem #}
<div
class=
"message unread"
id=
"first_unread"
>
{%
elif
vars.unread
%}
<div
class=
"message unread"
>
{%
else
%}
<div
class=
"message"
>
<div
class=
"message"
>
{%
endif
%}
<div
class=
"msg_author"
>
{%
if
m.author.profile_pict
%}
<div
class=
"msg_author"
>
{%
if
m.author.profile_pict
%}
<img
src=
"
{{
m.author.profile_pict.get_download_url
()
}}
"
alt=
"
{%
trans
%}
Profile
{%
endtrans
%}
"
id=
"picture"
/>
{%
else
%}
<img
src=
"
{{
static
(
'core/img/unknown.jpg'
)
}}
"
alt=
"
{%
trans
%}
Profile
{%
endtrans
%}
"
id=
"picture"
/>
...
...
forum/views.py
View file @
67642248
...
...
@@ -148,7 +148,7 @@ class ForumMessageCreateView(CanCreateMixin, CreateView):
init
=
super
(
ForumMessageCreateView
,
self
).
get_initial
()
try
:
init
[
'message'
]
=
"
\n
"
.
join
([
"
> "
+
line
for
line
in
ForumMessage
.
objects
.
filter
(
id
=
self
.
request
.
GET
[
'quote_id'
]).
first
().
message
.
split
(
'
\n
'
)
"> "
+
line
for
line
in
ForumMessage
.
objects
.
filter
(
id
=
self
.
request
.
GET
[
'quote_id'
]).
first
().
message
.
split
(
'
\n
'
)
])
except
:
pass
return
init
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment