-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[proofing] Hide proofing button for unauth users
A few users have tried making changes, clicked submit, and found that their changes were lost. A proper flow here will prompt login and save user changes. But for now, just hide the button and add another warning. Test plan: unit tests and tried it on dev.
- Loading branch information
Showing
3 changed files
with
18 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{% extends 'proofing/base.html' %} | ||
{% import "macros/proofing.html" as m %} | ||
{% import "macros/components.html" as site_components %} | ||
{% import "macros/components.html" as mc %} | ||
{% import "proofing/pages/editor-components.html" as editor %} | ||
|
||
|
||
|
@@ -24,15 +24,15 @@ | |
<article class="p-4"> | ||
{% if not current_user.is_authenticated -%} | ||
{% set url = url_for('auth.register') %} | ||
{% call site_components.p_warning() %}{% trans %} | ||
{% call mc.p_warning() %}{% trans %} | ||
Since you are not logged in, some functions (such as the OCR button) have | ||
been disabled. To use all website features, please <a class="underline" | ||
href="{{ url }}">create an account</a>. | ||
{% endtrans %}{% endcall %} | ||
{%- endif %} | ||
|
||
{{ editor.navigation_bar(project, cur=cur, prev=prev, next=next) }} | ||
{{ site_components.flash_messages() }} | ||
{{ mc.flash_messages() }} | ||
|
||
{% if conflict %} | ||
<pre class="p-2 bg-slate-100 my-4">{{ conflict.content }}</pre> | ||
|
@@ -48,7 +48,7 @@ | |
{{ editor.image_box() }} | ||
</div> | ||
|
||
<div class="mt-8 p-4 border bg-slate-200"> | ||
<div class="my-8 p-4 border bg-slate-200 rounded"> | ||
{{ form.summary.label(class_="text-slate-600 mb-2 block") }} | ||
{{ form.summary(class_="block rounded bg-white w-full mb-4 p-2", | ||
placeholder=_("Fixed various OCR errors")) }} | ||
|
@@ -68,18 +68,30 @@ | |
"peer-checked:bg-slate-100 peer-checked:text-gray-800 peer-checked:border-gray-300") }} | ||
</div> | ||
|
||
{% if current_user.is_authenticated %} | ||
{% set cc0 = "https://creativecommons.org/publicdomain/zero/1.0/" %} | ||
<p class="my-4 text-sm">{% trans %} | ||
By saving your changes, you agree to release your contribution under the | ||
<a class="underline" href="{{ cc0 }}">CC0 (public domain) license</a>. | ||
{% endtrans %}</p> | ||
|
||
<input class="btn btn-submit" | ||
type="submit" | ||
value="{{ _('Publish changes') }}" | ||
@click="hasUnsavedChanges = false"> | ||
{% endif %} | ||
</div> | ||
</form> | ||
|
||
{% if not current_user.is_authenticated %} | ||
{% set create = url_for("auth.register") %} | ||
{% set log_in = url_for("auth.sign_in") %} | ||
{% call mc.p_warning() %} | ||
Only registered users can save changes. <a href="{{ create }}">Create an | ||
account</a> or <a href="{{ log_in }}">sign in</a> to save your | ||
changes. | ||
{% endcall %} | ||
{% endif %} | ||
</article> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/build/openseadragon/openseadragon.min.js"></script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters