Update UI for ticket submission via email

This commit is contained in:
Drew DeVault 2019-08-22 13:31:29 +09:00
parent 204597dfb4
commit bf7f8aa3fc
2 changed files with 19 additions and 2 deletions

View File

@ -87,8 +87,10 @@ sock=/tmp/todo.sr.ht-lmtp.sock
# The lmtp daemon will make the unix socket group-read/write for users in this
# group.
sock-group=postfix
posting-domain=example.org
#
# Fill this in with the name of the domain to which emails should be sent.
# Leave blank to disable email submission.
posting-domain=
[meta.sr.ht]
origin=http://meta.sr.ht.local

View File

@ -73,6 +73,7 @@
{{ tracker.description | md }}
{% endif %}
{% if TicketAccess.submit in access %}
{% if current_user %}
<h3 style="margin-top: 1rem">Submit ticket</h3>
<form method="POST" action="{{
url_for(".tracker_submit_POST",
@ -121,6 +122,20 @@
{% endif %}> Submit another?
</label>
</form>
{% elif cfg("todo.sr.ht::mail", "posting-domain") %}
<a
class="btn btn-primary"
href="{{get_origin("meta.sr.ht", external=True)}}/register"
>Register here {{icon('caret-right')}}</a>
or
<a href="{{oauth_url}}">
Log in {{icon('caret-right')}}
</a>
to submit tickets, or
<a
href="mailto:{{tracker.owner.canonical_name}}/{{tracker.name}}@{{cfg("todo.sr.ht::mail", "posting-domain")}}"
>submit via email</a>.
{% endif %}
{% else %}
<hr />
<p>You need to <a href="{{ oauth_url }}">log in</a> to submit tickets.</p>