diff --git a/cms/static/js/models/alert.js b/cms/static/js/models/alert.js new file mode 100644 index 0000000000..3bafdd3f6d --- /dev/null +++ b/cms/static/js/models/alert.js @@ -0,0 +1,8 @@ +CMS.Models.Alert = Backbone.Model.extend({ + defaults: { + "type": null, + "title": null, + "message": null, + "shown": true + } +}); diff --git a/cms/static/js/views/alert.js b/cms/static/js/views/alert.js new file mode 100644 index 0000000000..443e1a411c --- /dev/null +++ b/cms/static/js/views/alert.js @@ -0,0 +1,11 @@ +CMS.Views.Alert = Backbone.View.extend({ + template: _.template($("#alert-tpl").text()), + initialize: function() { + this.setElement($("#page-alert")); + this.listenTo(this.model, 'change', this.render); + }, + render: function() { + this.$el.html(this.template(this.model.attributes)); + return this; + } +}); diff --git a/cms/templates/base.html b/cms/templates/base.html index 0f0af80b34..9aba566ee1 100644 --- a/cms/templates/base.html +++ b/cms/templates/base.html @@ -51,6 +51,52 @@ + + <%text> + + + + +
<%include file="widgets/header.html" /> diff --git a/cms/templates/widgets/header.html b/cms/templates/widgets/header.html index 3c8a598b5e..c2d9a4f93a 100644 --- a/cms/templates/widgets/header.html +++ b/cms/templates/widgets/header.html @@ -116,3 +116,4 @@
+