Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
AE
Sith
Commits
f3c1ab4a
Commit
f3c1ab4a
authored
May 31, 2017
by
Skia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
forum: use short names
Signed-off-by:
Skia
<
skia@libskia.so
>
parent
11d20f43
Pipeline
#1008
passed with stage
in 4 minutes and 33 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
core/templates/core/macros.jinja
core/templates/core/macros.jinja
+4
-0
forum/templates/forum/macros.jinja
forum/templates/forum/macros.jinja
+5
-5
No files found.
core/templates/core/macros.jinja
View file @
f3c1ab4a
...
...
@@ -2,6 +2,10 @@
<a
href=
"
{{
url
(
"core:user_profile"
,
user_id
=
user.id
)
}}
"
>
{{
user.get_display_name
()
}}
</a>
{%
-
endmacro
%}
{%
macro
user_profile_link_short_name
(
user
)
-
%}
<a
href=
"
{{
url
(
"core:user_profile"
,
user_id
=
user.id
)
}}
"
>
{{
user.get_short_name
()
}}
</a>
{%
-
endmacro
%}
{%
macro
user_link_with_pict
(
user
)
-
%}
<a
href=
"
{{
url
(
"core:user_profile"
,
user_id
=
user.id
)
}}
"
class=
"mini_profile_link"
>
{{
user.get_mini_item
()
|
safe
}}
...
...
forum/templates/forum/macros.jinja
View file @
f3c1ab4a
{%
from
'core/macros.jinja'
import
user_profile_link
%}
{%
from
'core/macros.jinja'
import
user_profile_link
_short_name
%}
{%
macro
display_forum
(
forum
,
user
,
is_root
=
False
)
%}
<div
class=
"forum
{%
if
is_root
%}
category
{%
endif
%}
"
>
...
...
@@ -29,7 +29,7 @@
</p>
<div
class=
"ib w_medium last_message"
style=
"font-size: x-small; text-align: center"
>
{%
if
forum.last_message
%}
{{
forum.last_message.author
}}
<br/>
{{
user_profile_link_short_name
(
forum.last_message.author
)
}}
<br/>
<a
href=
"
{{
forum.last_message.get_absolute_url
()
}}
"
>
<date>
{{
forum.last_message.date
|
localtime
|
date
(
DATETIME_FORMAT
)
}}
...
...
@@ -66,7 +66,7 @@
<div
class=
"ib w_medium last_message"
>
<div
class=
"ib w_medium"
>
<p
class=
"ib w_medium"
style=
"text-align: center;"
>
{{
user_profile_link
(
topic.author
)
}}
{{
user_profile_link
_short_name
(
topic.author
)
}}
</p>
<p
class=
"ib w_medium"
style=
"text-align: center;"
>
{{
topic._message_number
}}
...
...
@@ -75,7 +75,7 @@
<p
class=
"ib w_medium"
style=
"text-align: center;"
>
{%
set
last_msg
=
topic.last_message
%}
{%
if
last_msg
%}
{{
user_profile_link
(
last_msg.author
)
}}
<br/>
{{
user_profile_link
_short_name
(
last_msg.author
)
}}
<br/>
<a
href=
"
{{
last_msg.get_absolute_url
()
}}
"
>
<date>
{{
last_msg.date
|
date
(
DATETIME_FORMAT
)
}}
{{
last_msg.date
|
time
(
DATETIME_FORMAT
)
}}
</date>
</a>
...
...
@@ -133,7 +133,7 @@
<ul
class=
"msg_meta"
>
{%
for
meta
in
m.metas.select_related
(
'user'
)
.
order_by
(
'id'
)
%}
<li
style=
"background:
{%
if
m.author
==
meta.user
%}
#bfffbf
{%
else
%}
#ffffbf
{%
endif
%}
"
>
{{
meta.get_action_display
()
}}
{{
meta.user.get_
display
_name
()
}}
{{
meta.get_action_display
()
}}
{{
meta.user.get_
short
_name
()
}}
{%
trans
%}
at
{%
endtrans
%}{{
meta.date
|
localtime
|
time
(
DATETIME_FORMAT
)
}}
{%
trans
%}
the
{%
endtrans
%}{{
meta.date
|
localtime
|
date
(
DATETIME_FORMAT
)
}}
</li>
{%
endfor
%}
...
...
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