| |
@@ -1,5 +1,24 @@
|
| |
{% extends "master.html" %}
|
| |
|
| |
+ {% macro print_ssh_url(repo, git_url_ssh, current_user) %}
|
| |
+ {% if not user_can_clone_ssh(current_user) %}
|
| |
+ <a href="{{ url_for('ui_ns.user_settings') + '#nav-ssh-tab' }}">
|
| |
+ You need to upload SSH key to be able to clone over SSH
|
| |
+ </a>
|
| |
+ {% elif repo.read_only %}
|
| |
+ The permissions on this repository are being updated.
|
| |
+ Cloning over SSH is disabled.
|
| |
+ {% else %}
|
| |
+ <div class="form-group">
|
| |
+ <div class="input-group input-group-sm">
|
| |
+ <div class="input-group-addon">SSH</div>
|
| |
+ <input class="form-control bg-white" type="text" value="{{
|
| |
+ git_url_ssh }}{{ repo.fullname }}.git" readonly>
|
| |
+ </div>
|
| |
+ </div>
|
| |
+ {% endif %}
|
| |
+ {% endmacro %}
|
| |
+
|
| |
{% block title %}{{
|
| |
repo.namespace + '/' if repo.namespace }}{{ repo.name }}{% endblock %}
|
| |
{% set tag = "home" %}
|
| |
@@ -154,13 +173,7 @@
|
| |
<h5><strong>Source Code</strong></h5>
|
| |
<div>
|
| |
{% if g.authenticated and g.repo_committer %}
|
| |
- <div class="form-group">
|
| |
- <div class="input-group input-group-sm">
|
| |
- <div class="input-group-addon">SSH</div>
|
| |
- <input class="form-control bg-white" type="text" value="{{
|
| |
- git_url_ssh }}{{ repo.fullname }}.git" readonly>
|
| |
- </div>
|
| |
- </div>
|
| |
+ {{ print_ssh_url(repo, git_url_ssh, g.fas_user.username) }}
|
| |
{% endif %}
|
| |
<div class="form-group">
|
| |
<div class="input-group input-group-sm">
|
| |
@@ -175,13 +188,7 @@
|
| |
and repo.settings.get('project_documentation', True) %}
|
| |
<h5><strong>Documentation</strong></h5>
|
| |
{% if g.authenticated and g.repo_committer %}
|
| |
- <div class="form-group">
|
| |
- <div class="input-group input-group-sm">
|
| |
- <div class="input-group-addon">SSH</div>
|
| |
- <input class="form-control bg-white" type="text" value="{{
|
| |
- git_url_ssh }}docs/{{ repo.fullname }}.git" readonly>
|
| |
- </div>
|
| |
- </div>
|
| |
+ {{ print_ssh_url(repo, git_url_ssh + "docs/", g.fas_user.username) }}
|
| |
{% endif %}
|
| |
<div class="form-group">
|
| |
<div class="input-group input-group-sm">
|
| |
@@ -195,22 +202,10 @@
|
| |
{% if config.get('ENABLE_TICKETS', True)
|
| |
and repo.settings.get('issue_tracker', True) %}
|
| |
<h5><strong>Issues</strong></h5>
|
| |
- <div class="form-group">
|
| |
- <div class="input-group input-group-sm">
|
| |
- <div class="input-group-addon">SSH</div>
|
| |
- <input class="form-control bg-white" type="text" value="{{
|
| |
- git_url_ssh }}tickets/{{ repo.fullname }}.git" readonly>
|
| |
- </div>
|
| |
- </div>
|
| |
+ {{ print_ssh_url(repo, git_url_ssh + "tickets/", g.fas_user.username) }}
|
| |
{% endif %}
|
| |
<h5><strong>Pull Requests</strong></h5>
|
| |
- <div class="form-group">
|
| |
- <div class="input-group input-group-sm">
|
| |
- <div class="input-group-addon">SSH</div>
|
| |
- <input class="form-control bg-white" type="text" value="{{
|
| |
- git_url_ssh }}requests/{{ repo.fullname }}.git" readonly>
|
| |
- </div>
|
| |
- </div>
|
| |
+ {{ print_ssh_url(repo, git_url_ssh + "requests/", g.fas_user.username) }}
|
| |
{% endif %}
|
| |
</div>
|
| |
</div>
|
| |
As a usability improvement, I'd like to propose that url for SSH cloning is only displayed when:
read_only
set totrue
)This is based on feedback from several users who had problems with cloning as one of the above conditions wasn't met and it wasn't obvious for them.
The two different messages that may show up instead of the SSH url deserve some UI love, I'm open to suggestions here.