{# -*- coding: utf-8 -*- This file is part of Invenio. Copyright (C) 2023 CERN. Invenio is free software; you can redistribute it and/or modify it under the terms of the MIT License; see LICENSE file for more details. #} {%- import "invenio_github/settings/helpers.html" as helpers with context %} {%- if not request.is_xhr %} {%- extends config.GITHUB_SETTINGS_TEMPLATE %} {%- endif %} {%- block settings_content %} {%- if connected %} {%- block repositories_get_started %} {{ helpers.panel_start(_('GitHub Repositories') , with_body=False, icon="github icon", btn=_('Sync now ...'), btn_icon='sync alternate icon', btn_id='sync_repos', btn_name='sync-repos', btn_text=_('(updated {})').format(last_sync|naturaltime), id="github-view", ) }}

{{ _("Get started") }}

1 {{ _("Flip the switch") }}

{{ _('Select the repository you want to preserve, and toggle the switch below to turn on automatic preservation of your software.') }}

2 {{ _("Create a release") }}

{{ _('Go to GitHub and create a release. {} will automatically download a .zip-ball of each new release and register a DOI.') .format(config.THEME_SITENAME | default('System')) }}

3 {{ _("Get the badge") }}

{{ _('After your first release, a DOI badge that you can include in GitHub README will appear next to your repository below.') }}


{#- TODO remove hardcoding Zenodo stuff #} 10.5281/zenodo.8475
{{ _("(example)") }}
{{ helpers.panel_end(with_body=False) }} {%- endblock %} {%- if repos %} {%- block enabled_repositories %} {%- for repo_id, repo in repos if repo.instance and repo.instance.hook %} {%- if loop.first %} {{ helpers.panel_start(_('Enabled Repositories') , with_body=False) }}
{%- endif %}
{% include "invenio_github/settings/index_item.html" with context %}
{%- if loop.last %}
{{ helpers.panel_end(with_body=False) }} {%- endif %} {%- endfor %} {%- endblock %} {% endif %} {%- block disabled_repositories %} {{ helpers.panel_start(_('Repositories') , with_body=False) }}
{%- block repositories_tooltip %}

{{ _('If your organization\'s repositories do not show up in the list, please ensure you have enabled third-party access to the {} application. Private repositories are not supported.') .format(config.THEME_SITENAME | default('Invenio')) }}

{%- endblock %} {%- if not repos %}

{{_('You have no repositories on GitHub.
Go to GitHub and create your first or click Sync-button to synchronize latest changes from GitHub.')}}

{%- else %} {%- for repo_id, repo in repos if not repo.instance or not repo.instance.hook %} {%- if loop.first %}
{%- endif %}
{% include "invenio_github/settings/index_item.html" with context %}
{%- endfor %} {% endif %}
{{ helpers.panel_end(with_body=False) }} {%- endblock %} {#- If the user has not connected his GitHub account... #} {%- else %} {%- block connect_to_github %} {{ helpers.panel_start( _('GitHub'), icon="github icon", ) }}

{{ _('Software preservation made simple!') }}

{{ _('To get started, click "Connect" and we will get a list of your repositories from GitHub.') }}

{{ helpers.panel_end() }} {%- endblock %} {%- endif %} {%- endblock %} {%- block javascript %} {{ super() }} {{ webpack['invenio-github-init.js'] }} {%- endblock javascript %}