Sort sort options for display.

    :param sort_options: A dictionary containing the field name as key and
        asc/desc as value.
    :returns: A dictionary with sorting options for Invenio-Search-JS.

def sorted_options(sort_options):
    """Sort sort options for display.

    :param sort_options: A dictionary containing the field name as key and
        asc/desc as value.
    :returns: A dictionary with sorting options for Invenio-Search-JS.
    """
    return [
        {
            'title': v['title'],
            'value': ('-{0}'.format(k)
                      if v.get('default_order', 'asc') == 'desc' else k),
        }
        for k, v in
        sorted(sort_options.items(), key=lambda x: x[1].get('order', 0))
    ]