Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
bookshare
Commits
e236afad
Commit
e236afad
authored
Apr 25, 2015
by
Daniel W Bond
Browse files
user-facing support for BC book publication years
parent
6be60b80
Changes
2
Show whitespace changes
Inline
Side-by-side
bookshare/trades/templates/detail_listing.html
View file @
e236afad
...
...
@@ -84,6 +84,8 @@ SRCT Bookshare • {{ listing.title }}
</div>
{% endif %}
{% load trades_extras %}
<div
class=
"row"
>
<div
class=
"col-xs-8"
>
<h1>
...
...
@@ -106,7 +108,7 @@ SRCT Bookshare • {{ listing.title }}
<h4>
<small>
by
</small>
{{ listing.author }}
{% if listing.year %}
({{ listing.year }})
({{ listing.year
|bc
}})
{% endif %}
</h4>
</div>
...
...
bookshare/trades/templatetags/trades_extras.py
View file @
e236afad
...
...
@@ -39,3 +39,11 @@ def empty_stars(avg_stars):
@
register
.
filter
(
name
=
'int_maker'
)
def
int_maker
(
num
):
return
int
(
num
)
@
register
.
filter
(
name
=
'bc'
)
def
bc
(
num
):
if
num
<
0
:
positive_value
=
str
(
abs
(
num
))
return
"%s B.C."
%
(
positive_value
)
else
:
return
num
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