Update the smart link app to use Django templating language. gh-issues #151.

This commit is contained in:
Roberto Rosario
2015-07-28 02:44:33 -04:00
parent fc9f9f1e68
commit 7cae9dd18e
5 changed files with 44 additions and 26 deletions

View File

@@ -116,16 +116,22 @@ class ResolvedSmartLinkView(DocumentListView):
return queryset
def get_extra_context(self):
return {
'hide_links': True,
'object': self.document,
'title': _(
'Documents in smart link "%(smart_link)s" as relation to '
dynamic_label = self.smart_link.get_dynamic_label(self.document)
if dynamic_label:
title = _('Documents in smart link: %s') % dynamic_label
else:
title = _(
'Documents in smart link "%(smart_link)s" as related to '
'"%(document)s"'
) % {
'document': self.document,
'smart_link': self.smart_link.get_dynamic_label(self.document),
'smart_link': self.smart_link.label,
}
return {
'hide_links': True,
'object': self.document,
'title': title,
}