fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Now shelf archive contains all pdf, odt and txt formats from books.
[wolnelektury.git]
/
apps
/
catalogue
/
templatetags
/
catalogue_tags.py
diff --git
a/apps/catalogue/templatetags/catalogue_tags.py
b/apps/catalogue/templatetags/catalogue_tags.py
index
36e80d2
..
c315cfe
100644
(file)
--- a/
apps/catalogue/templatetags/catalogue_tags.py
+++ b/
apps/catalogue/templatetags/catalogue_tags.py
@@
-37,6
+37,23
@@
def capfirst(text):
return ''
return ''
+
+def simple_title(tags):
+ mapping = {
+ 'author': u'Autor',
+ 'theme': u'motyw',
+ 'epoch': u'epoka',
+ 'genre': u'gatunek',
+ 'kind': u'rodzaj',
+ 'set': u'półka',
+ }
+
+ title = []
+ for tag in tags:
+ title.append("%s: %s" % (mapping[tag.category], tag.name))
+ return capfirst(', '.join(title))
+
+
@register.simple_tag
def title_from_tags(tags):
def split_tags(tags):
@register.simple_tag
def title_from_tags(tags):
def split_tags(tags):
@@
-45,6
+62,9
@@
def title_from_tags(tags):
result[tag.category] = tag
return result
result[tag.category] = tag
return result
+ # TODO: Remove this after adding flection mechanism
+ return simple_title(tags)
+
class Flection(object):
def get_case(self, name, flection):
return name
class Flection(object):
def get_case(self, name, flection):
return name
@@
-112,7
+132,7
@@
def authentication_form():
def breadcrumbs(tags, search_form=True):
from catalogue.forms import SearchForm
context = {'tag_list': tags}
def breadcrumbs(tags, search_form=True):
from catalogue.forms import SearchForm
context = {'tag_list': tags}
- if search_form:
+ if search_form
and len(tags) < 6
:
context['search_form'] = SearchForm(tags=tags)
return context
context['search_form'] = SearchForm(tags=tags)
return context