Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add confirmation flash when submission preferences are saved #5046

Merged
merged 6 commits into from
Dec 18, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions securedrop/journalist_app/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def update_submission_preferences():
form = SubmissionPreferencesForm()
if form.validate_on_submit():
# The UI prompt ("prevent") is the opposite of the setting ("allow"):
flash(gettext("Preferences saved."), "submission-preferences-success")
zenmonkeykstop marked this conversation as resolved.
Show resolved Hide resolved
value = not bool(request.form.get('prevent_document_uploads'))
InstanceConfig.set('allow_document_uploads', value)
return redirect(url_for('admin.manage_config'))
Expand Down
1 change: 1 addition & 0 deletions securedrop/journalist_templates/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ <h2>{{ gettext('Submission Preferences') }}</h2>
<button type="submit" id="submit-submission-preferences">
<i class="fas fa-pencil-alt"></i> {{ gettext('UPDATE SUBMISSION PREFERENCES') }}
</button>
{% include 'submission_preferences_saved_flash.html' %}
</form>

{% endblock %}
2 changes: 1 addition & 1 deletion securedrop/journalist_templates/logo_upload_flashed.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{# these are flashed messages for the logo upload file verifiaction #}
{# these are flashed messages for the logo upload file verification #}
{% with messages = get_flashed_messages(with_categories=True, category_filter=["logo-success", "logo-error"]) %}
{% for category, message in messages %}
{% set category_status = category[5:] %}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{# these are flashed messages for the logo upload file verifiaction #}
zenmonkeykstop marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's update or remove this comment (these are the flashed messages for the submission file preferences)

{% with messages = get_flashed_messages(with_categories=True, category_filter=["submission-preferences-success"]) %}
{% for category, message in messages %}
{% set category_status = category[23:] %}
zenmonkeykstop marked this conversation as resolved.
Show resolved Hide resolved
<div class="flash {{ category_status }}">
<img src="{{ url_for('static', filename='i/success_checkmark.png') }}" height="17" width="20">
{{ message }}
</div>
{% endfor %}
{% endwith %}