-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1014 from Metro-Records/feature/manage-alerts
Add ability to manage alerts
- Loading branch information
Showing
12 changed files
with
251 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,6 +89,7 @@ | |
"adv_cache_tag", | ||
"debug_toolbar", | ||
"captcha", | ||
"markdownify.apps.MarkdownifyConfig", | ||
) | ||
|
||
try: | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Generated by Django 3.2.19 on 2023-09-11 14:33 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("lametro", "0011_relatebillsubject"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Alert", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("description", models.TextField(blank=True, null=True)), | ||
( | ||
"type", | ||
models.CharField( | ||
choices=[ | ||
("primary", "Primary"), | ||
("secondary", "Secondary"), | ||
("success", "Success"), | ||
("danger", "Danger"), | ||
("warning", "Warning"), | ||
("info", "Info"), | ||
], | ||
max_length=255, | ||
), | ||
), | ||
], | ||
), | ||
] |
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
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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<div class="row"> | ||
<div class="col-xs-12"> | ||
<h2 class="text-white" style="display: inline-block;">Manage Alerts</h2> | ||
<button class="btn btn-primary" id="alert-manager-toggle" style="margin-left: 10px; width: 70px;">Show</button> | ||
</div> | ||
|
||
</div> | ||
|
||
<div class="row" id="alert-manager"> | ||
<div class="col-md-7"> | ||
<h3 class="text-white">Add New</h3> | ||
<form role="form" method="POST" enctype="multipart/form-data" id="alert-form"> | ||
{% csrf_token %} | ||
<p> | ||
{{alert_form.type.label_tag}} {{alert_form.type}} | ||
</p> | ||
|
||
<p> | ||
{{alert_form.description.label_tag}} | ||
<div class="d-flex" style="background-color: white; flex-direction: column;"> | ||
<div style="border-bottom: 1px solid rgb(118, 118, 118);"> | ||
<button id="link" type="button" aria-label="Insert markdown for a link"> | ||
<i class="fa fa-link" aria-hidden="true"></i> | ||
</button> | ||
<button id="bold" type="button" aria-label="Insert markdown for bold text"> | ||
<i class="fa fa-bold" aria-hidden="true"></i> | ||
</button> | ||
<button id="italic" type="button" aria-label="Insert markdown for italic text"> | ||
<i class="fa fa-italic" aria-hidden="true"></i> | ||
</button> | ||
</div> | ||
|
||
{{alert_form.description}} | ||
</div> | ||
|
||
{% for error in alert_form.description.errors %} | ||
<span style="color: #eb6864; display: block;">*{{error|striptags}}</span> | ||
{% endfor %} | ||
</p> | ||
|
||
<button type="submit" class="btn btn-primary">Submit</button> | ||
</form> | ||
</div> | ||
|
||
<div class="col-md-5 text-white"> | ||
<h3 class="text-white">View Existing</h3> | ||
{% if alerts %} | ||
<table class="table"> | ||
<thead> | ||
<th>Type</th> | ||
<th>Description</th> | ||
<th aria-hidden="true"></th> | ||
</thead> | ||
<tbody> | ||
{% for alert in alerts %} | ||
<tr> | ||
<td>{{alert.type|title}}</td> | ||
<td>{{alert.description}}</td> | ||
<td> | ||
<form action="{% url 'delete_alert' alert.pk %}" method="POST"> | ||
{% csrf_token %} | ||
<button type="submit" class="btn btn-primary">Delete</button> | ||
</form> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% else %} | ||
<p>No Alerts Added</p> | ||
{% endif %} | ||
</div> | ||
</div> | ||
<hr class="col-md-12" aria-hidden="true"> |
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
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