Skip to content

Commit 512c439

Browse files
authored
Import page: don't allow import of private projects if not allowed (#584)
1 parent 4ad0608 commit 512c439

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

readthedocsext/theme/templates/includes/header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<div class="five wide mobile only right aligned column">
5151
<div class="ui wide dropdown"
5252
data-bind="semanticui: {dropdown: {action: 'select'}}">
53-
{# Ignore "aboid inline styles" rule #}
53+
{# Ignore "avoid inline styles" rule #}
5454
{# djlint:off H021 #}
5555
<i class="fad fa-bars large icon" style="--fa-secondary-opacity: 0.8;"></i>
5656
{# djlint:on #}

readthedocsext/theme/templates/projects/partials/project_create_automatic.html

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
{% load static %}
2-
{% load i18n %}
1+
{% load trans blocktrans from i18n %}
32

43
{% comment rst %}
54
Project automatic configuration view
@@ -25,9 +24,14 @@
2524
{% endblock project_add_configuration %}
2625

2726
{% block project_add_automatic_search %}
27+
{# Ignore "avoid inline styles" rule #}
28+
{# djlint:off H021 #}
2829
<div class="ui small error message"
2930
data-bind="visible: error"
30-
style="display: none">{% trans "There was an error while syncing your remote repositories" %}</div>
31+
style="display: none">
32+
{# djlint:on #}
33+
{% trans "There was an error while syncing your remote repositories" %}
34+
</div>
3135

3236
{# Search prompt and dropdown #}
3337
<label>{% trans "Repository name:" %}</label>
@@ -123,12 +127,16 @@
123127
connected and why the repository can/cannot be used.
124128

125129
{% endcomment %}
130+
{# Ignore "avoid inline styles" rule #}
131+
{# djlint:off H021 #}
126132
<div class="ui fluid card"
127133
data-bind="visible: is_selected, with: selected"
128134
style="display: none">
135+
{# djlint:on #}
129136
<div class="content">
130137
<img class="ui right floated mini rounded image"
131-
data-bind="attr: { src: avatar_url }">
138+
data-bind="attr: { src: avatar_url }"
139+
alt="{% trans "Repository logo" %}" />
132140
<div class="header" data-bind="text: full_name"></div>
133141
<div class="meta" data-bind="text: clone_url"></div>
134142
<div class="description">
@@ -218,7 +226,8 @@
218226
<a class="ui basic image label"
219227
data-bind="attr: {href: urls.home }"
220228
target="_blank">
221-
<img data-bind="if: $parent.avatar_url, attr: {src: $parent.avatar_url}" />
229+
<img data-bind="if: $parent.avatar_url, attr: {src: $parent.avatar_url}"
230+
alt="{% trans "Repository logo" %}" />
222231
<span data-bind="text: name"></span>
223232
</a>
224233
</div>
@@ -242,7 +251,10 @@
242251
<input type="hidden" name="remote_repository" data-bind="value: pk" />
243252
<input type="hidden" name="default_branch" data-bind="value: default_branch" />
244253

245-
<button class="ui primary button" data-bind="css: {disabled: !admin}">{% trans "Continue" %}</button>
254+
<button class="ui primary button"
255+
data-bind="css: {disabled: (!admin || !$parent.is_repository_supported($data))}">
256+
{% trans "Continue" %}
257+
</button>
246258
</form>
247259
</span>
248260
</div>

0 commit comments

Comments
 (0)