diff --git a/cms/static/coffee/fixtures/alert.underscore b/cms/static/coffee/fixtures/alert.underscore deleted file mode 120000 index 35fe9133d1..0000000000 --- a/cms/static/coffee/fixtures/alert.underscore +++ /dev/null @@ -1 +0,0 @@ -../../../templates/js/alert.underscore \ No newline at end of file diff --git a/cms/static/coffee/fixtures/notification.underscore b/cms/static/coffee/fixtures/notification.underscore deleted file mode 120000 index 71b1ba2d89..0000000000 --- a/cms/static/coffee/fixtures/notification.underscore +++ /dev/null @@ -1 +0,0 @@ -../../../templates/js/notification.underscore \ No newline at end of file diff --git a/cms/static/coffee/fixtures/prompt.underscore b/cms/static/coffee/fixtures/prompt.underscore deleted file mode 120000 index c4be9fdc58..0000000000 --- a/cms/static/coffee/fixtures/prompt.underscore +++ /dev/null @@ -1 +0,0 @@ -../../../templates/js/prompt.underscore \ No newline at end of file diff --git a/cms/static/coffee/fixtures/system-feedback.underscore b/cms/static/coffee/fixtures/system-feedback.underscore new file mode 120000 index 0000000000..10893f87c4 --- /dev/null +++ b/cms/static/coffee/fixtures/system-feedback.underscore @@ -0,0 +1 @@ +../../../templates/js/system-feedback.underscore \ No newline at end of file diff --git a/cms/static/coffee/spec/models/feedback_spec.coffee b/cms/static/coffee/spec/models/feedback_spec.coffee index 49f0da4dc0..6ddac41ebf 100644 --- a/cms/static/coffee/spec/models/feedback_spec.coffee +++ b/cms/static/coffee/spec/models/feedback_spec.coffee @@ -8,27 +8,27 @@ describe "CMS.Models.SystemFeedback", -> it "should have an empty title by default", -> expect(@model.get("title")).toEqual("") - it "should not have a type set by default", -> - expect(@model.get("type")).toBeNull() + it "should not have an intent set by default", -> + expect(@model.get("intent")).toBeNull() describe "CMS.Models.WarningMessage", -> beforeEach -> @model = new CMS.Models.WarningMessage() - it "should have the correct type", -> - expect(@model.get("type")).toEqual("warning") + it "should have the correct intent", -> + expect(@model.get("intent")).toEqual("warning") describe "CMS.Models.ErrorMessage", -> beforeEach -> @model = new CMS.Models.ErrorMessage() - it "should have the correct type", -> - expect(@model.get("type")).toEqual("error") + it "should have the correct intent", -> + expect(@model.get("intent")).toEqual("error") describe "CMS.Models.ConfirmationMessage", -> beforeEach -> @model = new CMS.Models.ConfirmationMessage() - it "should have the correct type", -> - expect(@model.get("type")).toEqual("confirmation") + it "should have the correct intent", -> + expect(@model.get("intent")).toEqual("confirmation") diff --git a/cms/static/coffee/spec/views/feedback_spec.coffee b/cms/static/coffee/spec/views/feedback_spec.coffee index 821dadb417..3bde86e077 100644 --- a/cms/static/coffee/spec/views/feedback_spec.coffee +++ b/cms/static/coffee/spec/views/feedback_spec.coffee @@ -1,4 +1,10 @@ +tpl = readFixtures('system-feedback.underscore') + beforeEach -> + setFixtures(sandbox({id: "page-alert"})) + appendSetFixtures(sandbox({id: "page-notification"})) + appendSetFixtures(sandbox({id: "page-prompt"})) + appendSetFixtures($(" - - ## javascript diff --git a/cms/templates/js/alert.underscore b/cms/templates/js/alert.underscore deleted file mode 100644 index 908c00eebb..0000000000 --- a/cms/templates/js/alert.underscore +++ /dev/null @@ -1,45 +0,0 @@ -
" - aria-hidden="<% if(obj.shown) { %>false<% } else { %>true<% } %>" - aria-labelledby="alert-<%= type %>-title" - <% if (obj.message) { %>aria-describedby="alert-<%= type %>-description" <% } %> - <% if (obj.actions) { %>role="dialog"<% } %> - > -
- <% var iconText = {"warning": "⚠", "confirmation": "✓", "error": "⚠", "announcement": "📢", "step-required": "", "help": "❓", "saving": "⚙"} %> - <%= iconText[type] %> - -
-

<%= title %>

- <% if(obj.message) { %>

<%= message %>

<% } %> -
- - <% if(obj.actions) { %> - - <% } %> - - <% if(obj.closeIcon) { %> - - - close alert - - <% } %> -
-
diff --git a/cms/templates/js/notification.underscore b/cms/templates/js/notification.underscore deleted file mode 100644 index f91e4ddd3f..0000000000 --- a/cms/templates/js/notification.underscore +++ /dev/null @@ -1,46 +0,0 @@ -
aria-describedby="notification-<%= type %>-description" <% } %> - <% if (obj.actions) { %>role="dialog"<% } %> - > -
- <% var iconText = {"warning": "⚠", "confirmation": "✓", "error": "⚠", "announcement": "📢", "step-required": "", "help": "❓", "saving": "⚙"} %> - <%= iconText[type] %> - -
-

<%= title %>

- <% if(obj.message) { %>

<%= message %>

<% } %> -
- - <% if(obj.actions) { %> - - <% } %> - - <% if(obj.closeIcon) { %> - - - close notification - - <% } %> -
-
diff --git a/cms/templates/js/prompt.underscore b/cms/templates/js/prompt.underscore deleted file mode 100644 index 93fe9c5c49..0000000000 --- a/cms/templates/js/prompt.underscore +++ /dev/null @@ -1,35 +0,0 @@ -
" - aria-hidden="<% if(obj.shown) { %>false<% } else { %>true<% } %>" - aria-labelledby="prompt-<%= type %>-title" - <% if (obj.message) { %>aria-describedby="prompt-<%= type %>-description" <% } %> - <% if (obj.actions) { %>role="dialog"<% } %> - > -
-
-

<%= title %>

- <% if(obj.message) { %>

<%= message %>

<% } %> -
- - <% if(obj.actions) { %> - - <% } %> -
-
diff --git a/cms/templates/js/system-feedback.underscore b/cms/templates/js/system-feedback.underscore new file mode 100644 index 0000000000..09d59700c5 --- /dev/null +++ b/cms/templates/js/system-feedback.underscore @@ -0,0 +1,48 @@ +
aria-describedby="<%= type %>-<%= intent %>-description" <% } %> + <% if (obj.actions) { %>role="dialog"<% } %> + > +
+ <% if(obj.icon) { %> + <% var iconText = {"warning": "⚠", "confirmation": "✓", "error": "⚠", "announcement": "📢", "step-required": "", "help": "❓", "saving": "⚙"} %> + <%= iconText[intent] %> + <% } %> + +
+

<%= title %>

+ <% if(obj.message) { %>

<%= message %>

<% } %> +
+ + <% if(obj.actions) { %> + + <% } %> + + <% if(obj.closeIcon) { %> + + + close <%= type %> + + <% } %> +
+