Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BibDocFile: fix file ordering #216

Open
wants to merge 1 commit into
base: prod
Choose a base branch
from
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