diff --git a/readthedocsext/theme/templates/projects/partials/edit/keys_list.html b/readthedocsext/theme/templates/projects/partials/edit/keys_list.html index 36e8f267..4bae6492 100644 --- a/readthedocsext/theme/templates/projects/partials/edit/keys_list.html +++ b/readthedocsext/theme/templates/projects/partials/edit/keys_list.html @@ -1,28 +1,57 @@ {% extends "includes/crud/table_list.html" %} -{% load i18n %} - -{% load core_tags %} -{% load privacy_tags %} -{% load projects_tags %} +{% load trans blocktrans from i18n %} {% block top_left_menu_items %} {% endblock top_left_menu_items %} -{% comment %} - Do not show an empty menu bar at the top. Once users can add SSH keys, we can - remove this override and enable the ``create_button`` block -{% endcomment %} {% block top_menu %} + + + {% if not can_reattach_key_automatically %} +
+
+ {% blocktrans trimmed %} + SSH key can't be automatically reattached to Git provider + {% endblocktrans %} +
+

+ {% if not project.remote_repository %} + {% url "projects_edit" project_slug=project.slug as project_edit_url %} + {% blocktrans trimmed with project_edit_url=project_edit_url %} + You need to connect this project to a Git repository first. + {% endblocktrans %} +

+ {% else %} + {% url "socialaccount_connections" as socialaccount_connections_url %} + {% blocktrans trimmed with socialaccount_connections_url=socialaccount_connections_url %} + You need to connect your account to a Git provider associated with this project first. + {% endblocktrans %} +

+ {% endif %} + {% blocktrans trimmed %} + Alternatively, you can + manually add the SSH key to your Git provider. + {% endblocktrans %} +

+
+ {% endif %} {% endblock top_menu %} -{% block create_button %} - {% comment %} - {# TODO this is not supported currently, and is an admin only action #} - {% url "..." project.slug as create_url %} - {% trans "Add SSH key" as create_text %} - {% include "includes/crud/create_button.html" with url=create_url text=create_text %} - {% endcomment %} -{% endblock create_button %} {% block list_placeholder_icon_class %} fa-duotone fa-lock-keyhole