Commit e236afad authored by Daniel W Bond's avatar Daniel W Bond

user-facing support for BC book publication years

parent 6be60b80
......@@ -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 &bull; {{ listing.title }}
<h4>
<small>by</small> {{ listing.author }}
{% if listing.year %}
({{ listing.year }})
({{ listing.year|bc }})
{% endif %}
</h4>
</div>
......
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment