mirror of https://git.sr.ht/~sircmpwn/man.sr.ht
create: fix logic error with existing refs
The "existing" branch in the template is used on the repo select screen to filter out repositories which already have a wiki created for them. This change adds a short-circuit which avoids the check in other situations. While I'm here I also tweaked the appearance of this page a bit.
This commit is contained in:
parent
cb0e0d1446
commit
d842538a2f
|
@ -45,23 +45,23 @@
|
||||||
{{csrf_token()}}
|
{{csrf_token()}}
|
||||||
<input type="hidden" name="{{ typename }}" value="{{ item.name }}" />
|
<input type="hidden" name="{{ typename }}" value="{{ item.name }}" />
|
||||||
<h4>
|
<h4>
|
||||||
{% if item.name not in existing %}
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
class="pull-right btn btn-primary btn-lg"
|
|
||||||
>Select {{ typename_pretty }} {{ icon("caret-right") }}</button>
|
|
||||||
{% else %}
|
|
||||||
<button
|
|
||||||
class="pull-right btn btn-default btn-lg"
|
|
||||||
disabled
|
|
||||||
>Already created</button>
|
|
||||||
{% endif %}
|
|
||||||
<a
|
<a
|
||||||
href="{{ item.url }}"
|
href="{{ item.url }}"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
>{{ item.name }}</a>
|
>{{ item.name }}</a>
|
||||||
</h4>
|
</h4>
|
||||||
|
{% if typename != "repo" or item.name not in existing %}
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
class="btn btn-primary btn-lg"
|
||||||
|
>Select {{ typename_pretty }} {{ icon("caret-right") }}</button>
|
||||||
|
{% else %}
|
||||||
|
<button
|
||||||
|
class="pull-right btn btn-default btn-lg"
|
||||||
|
disabled
|
||||||
|
>Already created</button>
|
||||||
|
{% endif %}
|
||||||
</form>
|
</form>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -67,6 +67,19 @@ h5 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.configure {
|
||||||
|
.event {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
h4 {
|
||||||
|
border: none;
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
code.grey {
|
code.grey {
|
||||||
background: $gray-200;
|
background: $gray-200;
|
||||||
padding: 0 0.25rem;
|
padding: 0 0.25rem;
|
||||||
|
|
Loading…
Reference in New Issue