added function to set messages in JavaScript
This commit is contained in:
parent
6aa241b268
commit
56f1a15cac
@ -11,3 +11,10 @@ $(function () {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function new_message(text, type) {
|
||||
message = $('#dummy-notification').clone(true);
|
||||
$(message).show().addClass(type).children('em').html(text);
|
||||
$('#notifications').append(message);
|
||||
}
|
||||
|
@ -50,7 +50,13 @@
|
||||
|
||||
<div id="wrapper">
|
||||
<div id="content">
|
||||
{% if messages %}
|
||||
<div id="notifications">
|
||||
<div id="dummy-notification" class="notification" style="display:none">
|
||||
<a class="close" href="#">
|
||||
<img alt="close" title="{% trans 'Close this notification' %}" src="{% static 'images/icons/cross.png' %}">
|
||||
</a>
|
||||
<em></em>
|
||||
</div>
|
||||
{% for message in messages %}
|
||||
<div class="notification {% if message.tags %}{{ message.tags }}{% endif %}">
|
||||
<a class="close" href="#">
|
||||
@ -64,7 +70,7 @@
|
||||
$(this).hide("fast");
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
<div id="footer">
|
||||
|
Loading…
Reference in New Issue
Block a user