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

user-facing support for BC book publication years

parent 6be60b80
...@@ -84,6 +84,8 @@ SRCT Bookshare • {{ listing.title }} ...@@ -84,6 +84,8 @@ SRCT Bookshare • {{ listing.title }}
</div> </div>
{% endif %} {% endif %}
{% load trades_extras %}
<div class="row"> <div class="row">
<div class="col-xs-8"> <div class="col-xs-8">
<h1> <h1>
...@@ -106,7 +108,7 @@ SRCT Bookshare &bull; {{ listing.title }} ...@@ -106,7 +108,7 @@ SRCT Bookshare &bull; {{ listing.title }}
<h4> <h4>
<small>by</small> {{ listing.author }} <small>by</small> {{ listing.author }}
{% if listing.year %} {% if listing.year %}
({{ listing.year }}) ({{ listing.year|bc }})
{% endif %} {% endif %}
</h4> </h4>
</div> </div>
......
...@@ -39,3 +39,11 @@ def empty_stars(avg_stars): ...@@ -39,3 +39,11 @@ def empty_stars(avg_stars):
@register.filter(name='int_maker') @register.filter(name='int_maker')
def int_maker(num): def int_maker(num):
return int(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