Add the ability to set an alert message to the front page
Roomlist has something like the following implemented that shows a random message to users who log in:
{% if messages %}
{% for message in messages %}
<div class="row">
<div class="col-md-12">
<div class="alert alert-{{ message.tags }} alert-dismissable text-center" style='font-size:14px' role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="close"><span aria-hidden="true">×</span></button>
<strong>{{ message }}</strong>
</div>
</div>
</div>
{% endfor %}
{% endif %}
I want something very similar to this only that allows us to define one field for the message tag and the message contents in the admin interface, so that we don't have to ping @patriot_down to add an alert to the page.
Off the top of my head I imagine it would require adding an alerts table which allows us to define a variety of different alerts, their type and contents, and then separately select the particular alert which should be active (restricted such that only one can ever actually be active at a time).
I'm thinking an alert object would look something like this:
alert: {
tags: [String(), ...],
message: String(),
startDate: Date(),
endDate: Date()
}
Somebody with a bit more django specific knowledge might be able to further refine my words into specific implementations, feel free to comment pls.