mirror of https://git.sr.ht/~sircmpwn/hub.sr.ht
projects: remember visibility across form submissions
References: https://lists.sr.ht/~sircmpwn/sr.ht-discuss/%3CCJ5SEF4HBSQ5.2N6Y2AG1CUDQZ%40arctic%3E
This commit is contained in:
parent
45a2f75b8b
commit
d292f65f1f
|
@ -4,7 +4,7 @@ import requests
|
|||
import yaml
|
||||
from abc import ABC
|
||||
from flask import url_for
|
||||
from jinja2 import Markup, escape
|
||||
from markupsafe import Markup, escape
|
||||
from srht.api import ensure_webhooks, encrypt_request_authorization, get_results
|
||||
from srht.markdown import markdown, sanitize
|
||||
from srht.config import get_origin, cfg
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
class="form-check-input"
|
||||
type="radio"
|
||||
name="visibility"
|
||||
{% if project.visibility.value == "public" %}
|
||||
{% if (visibility and visibility == "public") or project.visibility.value == "public" %}
|
||||
checked
|
||||
{% endif %}
|
||||
value="public"> Public
|
||||
|
@ -90,7 +90,7 @@
|
|||
class="form-check-input"
|
||||
type="radio"
|
||||
name="visibility"
|
||||
{% if project.visibility.value == "unlisted" %}
|
||||
{% if (visibility and visibility == "unlisted") or project.visibility.value == "unlisted" %}
|
||||
checked
|
||||
{% endif %}
|
||||
value="unlisted"> Unlisted
|
||||
|
@ -108,7 +108,7 @@
|
|||
class="form-check-input"
|
||||
type="radio"
|
||||
name="visibility"
|
||||
{% if project.visibility.value == "private" %}
|
||||
{% if (visibility and visibility == "private") or project.visibility.value == "private" %}
|
||||
checked
|
||||
{% endif %}
|
||||
value="private"> Private
|
||||
|
|
|
@ -77,7 +77,10 @@
|
|||
type="radio"
|
||||
name="visibility"
|
||||
value="public"
|
||||
checked> Public
|
||||
{% if not visibility or visibility == "public" %}
|
||||
checked
|
||||
{% endif %}
|
||||
> Public
|
||||
<small id="visibility-public-help" class="form-text text-muted">
|
||||
Shown on your profile and listed in the public project index
|
||||
</small>
|
||||
|
@ -92,7 +95,11 @@
|
|||
class="form-check-input"
|
||||
type="radio"
|
||||
name="visibility"
|
||||
value="unlisted"> Unlisted
|
||||
value="unlisted"
|
||||
{% if visibility and visibility == "unlisted" %}
|
||||
checked
|
||||
{% endif %}
|
||||
> Unlisted
|
||||
<small id="visibility-unlisted-help" class="form-text text-muted">
|
||||
Visible to anyone who knows the URL, but not shown on your profile
|
||||
</small>
|
||||
|
@ -107,7 +114,11 @@
|
|||
class="form-check-input"
|
||||
type="radio"
|
||||
name="visibility"
|
||||
value="private"> Private
|
||||
value="private"
|
||||
{% if visibility and visibility == "private" %}
|
||||
checked
|
||||
{% endif %}
|
||||
> Private
|
||||
<small id="visibility-unlisted-help" class="form-text text-muted">
|
||||
Only visible to you and your collaborators
|
||||
</small>
|
||||
|
|
Loading…
Reference in New Issue