Browse Source

Nicer "your settings have been updated" message.

pull/140/head
Pēteris Caune 7 years ago
parent
commit
e1d5fa8638
3 changed files with 14 additions and 15 deletions
  1. +7
    -6
      hc/accounts/views.py
  2. +1
    -1
      templates/accounts/badges.html
  3. +6
    -8
      templates/accounts/notifications.html

+ 7
- 6
hc/accounts/views.py View File

@ -237,6 +237,12 @@ def notifications(request):
_ensure_own_team(request)
profile = request.profile
ctx = {
"status": "default",
"page": "profile",
"profile": profile
}
if request.method == "POST":
form = ReportSettingsForm(request.POST)
if form.is_valid():
@ -257,12 +263,7 @@ def notifications(request):
profile.next_nag_date = None
profile.save()
messages.success(request, "Your settings have been updated!")
ctx = {
"page": "profile",
"profile": profile,
}
ctx["status"] = "info"
return render(request, "accounts/notifications.html", ctx)


+ 1
- 1
templates/accounts/badges.html View File

@ -13,7 +13,7 @@
<div class="row">
<div class="col-sm-2">
<ul class="nav nav-pills nav-stacked">
<li><a href="{% url 'hc-profile' %}">Security</a></li>
<li><a href="{% url 'hc-profile' %}">Account</a></li>
<li><a href="{% url 'hc-notifications' %}">Email Reports</a></li>
<li class="active"><a href="{% url 'hc-badges' %}">Badges</a></li>
</ul>


+ 6
- 8
templates/accounts/notifications.html View File

@ -8,13 +8,6 @@
<div class="col-sm-12">
<h1 class="settings-title">Settings</h1>
</div>
{% if messages %}
<div class="col-sm-12">
{% for message in messages %}
<p class="alert alert-{{ message.tags }}">{{ message }}</p>
{% endfor %}
</div>
{% endif %}
</div>
<div class="row">
@ -27,7 +20,7 @@
</div>
<div class="col-sm-9 col-md-6">
<div class="panel panel-default">
<div class="panel panel-{{ status }}">
<div class="panel-body settings-block">
<form method="post">
{% csrf_token %}
@ -91,6 +84,11 @@
class="btn btn-default pull-right">Save Changes</button>
</form>
</div>
{% if status == "info" %}
<div class="panel-footer">
Your settings have been updated!
</div>
{% endif %}
</div>
</div>
</div>


Loading…
Cancel
Save