{# # This file is part of Invenio. # Copyright (C) 2014, 2015, 2016 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # Invenio is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Invenio; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #} {%- import "invenio_github/settings/helpers.html" as helpers with context %} {%- from "invenio_github/helpers.html" import doi_badge with context -%} {%- extends config.GITHUB_SETTINGS_TEMPLATE %} {%- block javascript %} {{ super() }} {% assets "invenio_github_js" %}{% endassets %} {%- endblock %} {%- block settings_content %} {%- set github_rel_url = 'https://github.com/{0}/releases/new'.format(repo.name) %} {%- set latest_success_pid = None %} {%- set latest_published = repo.latest_release(status='D') %} {%- if latest_published %} {%- set latest_success_pid = latest_published|release_pid %} {%- endif %}
{{ doi_badge(latest_success_pid.pid_value, github_id=repo.github_id) }}
{%- endif %} {{ helpers.panel_start( _('GitHub / Releases'), with_body=False, btn='Create release ...', btn_icon='fa fa-github', btn_href=github_rel_url, ) }} {%- if not releases %} {%- if repo.enabled %} {%- block repo_getstarted scoped %} {%- endblock repo_getstarted %} {%- else -%} {%- block repo_enable scoped %}{{ release.event.payload|tojson|prettyjson }}
{{config.THEME_SITENAME | default('Invenio')}} automatically
extracts metadata about your repository from GitHub APIs.
For example, the authors are determined from the
repository's contributor statistics.
The automatic extraction is solely a best
guess. Add a
{{config.GITHUB_METADATA_FILE}}
file the root of
your repository to explicit define the metadata. The format of
file is the same as for our REST API (use e.g. below JSON to
get started).
{{ serializer.serialize(release.pid, release.record)|prettyjson }}
{{ release.model.errors|tojson|prettyjson }}