Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions modules/bibdocfile/lib/bibdocfile_templates.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of Invenio.
# Copyright (C) 2012, 2013, 2014 CERN.
# Copyright (C) 2012, 2013, 2014, 2017 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
Expand Down Expand Up @@ -79,14 +79,17 @@ def tmpl_display_bibrecdocs(self, bibrecdocs, docname="", version="", doctype=No
@return: the formatted representation.
@rtype: HTML string
"""
def _get_ordered_bibdocs():
d = bibrecdocs.list_bibdocs_by_names(doctype)
return [d[k] for k in sorted(d)]
t = ""
if docname:
try:
bibdocs = [bibrecdocs.get_bibdoc(docname)]
except Exception, dummy:
bibdocs = bibrecdocs.list_bibdocs(doctype)
bibdocs = _get_ordered_bibdocs()
else:
bibdocs = bibrecdocs.list_bibdocs(doctype)
bibdocs = _get_ordered_bibdocs()
if bibdocs:
types = list_types_from_array(bibdocs)
fulltypes = []
Expand Down