0
試圖將這些通知系統放在我的模板上。如何使用Bootstrap在Django中使用notify?
我使用的是:
{% for message in messages %}
<<What I need to put here to create a notifiy for each error message??>>
{% endfor %}
試圖將這些通知系統放在我的模板上。如何使用Bootstrap在Django中使用notify?
我使用的是:
{% for message in messages %}
<<What I need to put here to create a notifiy for each error message??>>
{% endfor %}
解決了:
<script>
{% for message in messages %}
$(document).ready(function() {
$.pnotify({
title: '{{ message.tags|upper }}',
text: '{{ message }}.',
type: '{{ message.tags }}',
hide: false,
styling: 'bootstrap',
closer_hover: false,
sticker_hover: false
});
});
{% endfor %}
</script>
你使用:https://github.com/mouse0270/bootstrap-notify? – sphoenix