inspirehep.modules.theme package

Submodules

inspirehep.modules.theme.bundles module

Inspire bundles.

inspirehep.modules.theme.ext module

Invenio standard theme.

class inspirehep.modules.theme.ext.INSPIRETheme(app=None, **kwargs)[source]

Bases: object

Invenio theme extension.

init_app(app, assets=None, **kwargs)[source]

Initialize application object.

init_config(config)[source]

Initialize configuration.

setup_app(app)[source]

Initialize Gravatar extension.

inspirehep.modules.theme.jinja2filters module

Jinja utilities for INSPIRE.

inspirehep.modules.theme.jinja2filters.apply_template_on_array(array, template_path, **common_context)[source]

Render a template specified by ‘template_path’.

For every item in array, renders the template passing the item as ‘content’ parameter. Additionally attaches ‘common_context’ as other rendering arguments.

Returns list of rendered html strings.

Parameters:
  • array – iterable with specific context
  • template_path – path to the template
Return type:

list of strings

inspirehep.modules.theme.jinja2filters.author_profile(record)[source]

Return array of rendered links to authors.

inspirehep.modules.theme.jinja2filters.author_urls(l, separator)[source]

Creates link to go back to search results in detailed pages.

inspirehep.modules.theme.jinja2filters.citation_phrase(count)[source]
inspirehep.modules.theme.jinja2filters.clean_roles(roles)[source]

Extract names from user roles.

inspirehep.modules.theme.jinja2filters.collection_select_current(collection_name, current_collection)[source]

Returns the active collection based on the current collection page.

inspirehep.modules.theme.jinja2filters.conference_date(record)[source]
inspirehep.modules.theme.jinja2filters.construct_date_format(date)[source]
inspirehep.modules.theme.jinja2filters.count_plots(record)[source]

Return single email rendered (mailto).

Return array of rendered links to emails.

inspirehep.modules.theme.jinja2filters.epoch_to_year_format(date)[source]
inspirehep.modules.theme.jinja2filters.experiment_date(record)[source]
inspirehep.modules.theme.jinja2filters.find_collection_from_url(url)[source]

Returns the collection based on the URL.

inspirehep.modules.theme.jinja2filters.format_author_name(name)[source]
inspirehep.modules.theme.jinja2filters.format_cnum_with_hyphons(value)[source]
inspirehep.modules.theme.jinja2filters.format_cnum_with_slash(value)[source]
inspirehep.modules.theme.jinja2filters.format_date(date)[source]

Displays a date in a human-friendly format.

Return array of rendered links to institutes.

inspirehep.modules.theme.jinja2filters.is_cataloger(user)[source]

Check if user has a cataloger role.

Checks if given url is an external link.

inspirehep.modules.theme.jinja2filters.is_list(value)[source]

Checks if an object is a list.

inspirehep.modules.theme.jinja2filters.is_upper(s)[source]
inspirehep.modules.theme.jinja2filters.join_array(eval_ctx, value, separator)[source]
inspirehep.modules.theme.jinja2filters.join_nested_lists(l, sep)[source]
inspirehep.modules.theme.jinja2filters.json_dumps(data)[source]
inspirehep.modules.theme.jinja2filters.limit_facet_elements(l)[source]
inspirehep.modules.theme.jinja2filters.new_line_after(text)[source]
inspirehep.modules.theme.jinja2filters.publication_info(record)[source]

Display inline publication and conference information.

The record is a LiteratureRecord instance

inspirehep.modules.theme.jinja2filters.remove_duplicates_from_list(l)[source]
inspirehep.modules.theme.jinja2filters.sanitize_arxiv_pdf(arxiv_value)[source]

Sanitizes the arXiv PDF link so it is always correct

inspirehep.modules.theme.jinja2filters.sanitize_collection_name(collection_name)[source]

Changes ‘hep’ to ‘literature’ and ‘hepnames’ to ‘authors’.

inspirehep.modules.theme.jinja2filters.search_for_experiments(value)[source]
inspirehep.modules.theme.jinja2filters.show_citations_number(citation_count)[source]

Shows citations number

inspirehep.modules.theme.jinja2filters.sort_list_by_dict_val(l)[source]
inspirehep.modules.theme.jinja2filters.strip_leading_number_plot_caption(text)[source]

Return array of rendered links.

inspirehep.modules.theme.jinja2filters.words(value, limit, separator=' ')[source]

Return first limit number of words ending by separator‘ ‘

inspirehep.modules.theme.jinja2filters.words_to_end(value, limit, separator=' ')[source]

Return last limit number of words ending by separator‘ ‘

inspirehep.modules.theme.views module

Theme views.

exception inspirehep.modules.theme.views.UnhealthCeleryTestException[source]

Bases: exceptions.Exception

exception inspirehep.modules.theme.views.UnhealthTestException[source]

Bases: exceptions.Exception

inspirehep.modules.theme.views.ajax_citations()[source]

Handler for datatables citations view

Deprecated since version 2018-08-23.

inspirehep.modules.theme.views.ajax_conference_contributions()[source]

Handler for other conference contributions

inspirehep.modules.theme.views.ajax_experiment_contributions()[source]

Handler for experiment contributions

inspirehep.modules.theme.views.ajax_experiments_people()[source]

Datatable handler to get people working in an experiment.

inspirehep.modules.theme.views.ajax_institutions_experiments()[source]

Datatable handler to get experiments in an institution.

inspirehep.modules.theme.views.ajax_institutions_papers()[source]

Datatable handler to get papers from an institution.

inspirehep.modules.theme.views.ajax_institutions_people()[source]

Datatable handler to get people working in an institution.

inspirehep.modules.theme.views.ajax_other_conferences()[source]

Handler for other conferences in the series

inspirehep.modules.theme.views.ajax_references()[source]

Handler for datatables references view.

Deprecated since version 2018-06-07.

inspirehep.modules.theme.views.author_new()[source]
inspirehep.modules.theme.views.author_update()[source]
inspirehep.modules.theme.views.conferences()[source]

View for conferences collection landing page.

inspirehep.modules.theme.views.data()[source]

View for data collection landing page.

inspirehep.modules.theme.views.experiments()[source]

View for experiments collection landing page.

inspirehep.modules.theme.views.get_experiment_publications(experiment_name)[source]

Get paper count for a given experiment.

Parameters:experiment_name (string) – canonical name of the experiment.
inspirehep.modules.theme.views.get_institution_experiments_datatables_rows(hits)[source]

Row used by datatables to render institution experiments.

inspirehep.modules.theme.views.get_institution_experiments_from_es(icn)[source]

Get experiments from a given institution.

To avoid killing ElasticSearch the number of experiments is limited.

Parameters:icn (string) – Institution canonical name.
inspirehep.modules.theme.views.get_institution_papers_datatables_rows(hits)[source]

Row used by datatables to render institution papers.

inspirehep.modules.theme.views.get_institution_papers_from_es(recid)[source]

Get papers where some author is affiliated with institution.

Parameters:recid (string) – id of the institution.
inspirehep.modules.theme.views.get_institution_people_datatables_rows(recid)[source]

Datatable rows to render people working in an institution.

Parameters:recid (string) – id of the institution.
inspirehep.modules.theme.views.health[source]
(task)inspirehep.modules.theme.views.health_celery_task[source]
inspirehep.modules.theme.views.healthcelery[source]
inspirehep.modules.theme.views.hepnames()[source]

View for authors collection landing page.

inspirehep.modules.theme.views.index()[source]

View for literature collection landing page.

inspirehep.modules.theme.views.institutions()[source]

View for institutions collection landing page.

inspirehep.modules.theme.views.insufficient_permissions(error)[source]
inspirehep.modules.theme.views.internal_error(error)[source]
inspirehep.modules.theme.views.jobs()[source]

View for jobs collection landing page.

inspirehep.modules.theme.views.journals()[source]

View for journals collection landing page.

inspirehep.modules.theme.views.linkedaccounts()[source]

Redirect to the homepage when logging in with ORCID.

inspirehep.modules.theme.views.literature_new()[source]
inspirehep.modules.theme.views.login_success()[source]

Injects current user to the template and passes it to the parent tab.

inspirehep.modules.theme.views.page_not_found(error)[source]
inspirehep.modules.theme.views.ping()[source]
inspirehep.modules.theme.views.postfeedback()[source]

Handler to create a ticket from user feedback.

inspirehep.modules.theme.views.record(control_number)[source]
inspirehep.modules.theme.views.register_menu_items()[source]

Hack to remove children of Settings menu

inspirehep.modules.theme.views.unauthorized(error)[source]
inspirehep.modules.theme.views.unhealth[source]
(task)inspirehep.modules.theme.views.unhealth_celery_task[source]
inspirehep.modules.theme.views.unhealthcelery[source]

Module contents

INSPIRE theme and filters.