From 1dbd27934fb16a3a398acc230bbd889dcc5ef3f7 Mon Sep 17 00:00:00 2001 From: charltonaustin Date: Thu, 6 Oct 2016 15:58:47 -0400 Subject: [PATCH] Adding in an outline of a front-end for retrieving messages from the backend api. --- static/directives/quay-message-bar.html | 5 +++++ static/js/directives/quay-message-bar.js | 17 +++++++++++++++++ templates/base.html | 1 + 3 files changed, 23 insertions(+) create mode 100644 static/directives/quay-message-bar.html create mode 100644 static/js/directives/quay-message-bar.js diff --git a/static/directives/quay-message-bar.html b/static/directives/quay-message-bar.html new file mode 100644 index 000000000..f5b512511 --- /dev/null +++ b/static/directives/quay-message-bar.html @@ -0,0 +1,5 @@ +
+
+ {{ message.content }} +
+
diff --git a/static/js/directives/quay-message-bar.js b/static/js/directives/quay-message-bar.js new file mode 100644 index 000000000..55d4b1b8a --- /dev/null +++ b/static/js/directives/quay-message-bar.js @@ -0,0 +1,17 @@ +/** + * An element which displays a message for users to read. + */ +angular.module('quay').directive('quayMessageBar', function () { + return { + priority: 0, + templateUrl: '/static/directives/quay-message-bar.html', + replace: false, + transclude: false, + restrict: 'C', + scope: {}, + controller: function ($scope, $element, ApiService) { + $scope.messages = []; + // ApiService.getMessages().then(function(data){ $scope.messages = data['messages'] || []; }); + } + }; +}); diff --git a/templates/base.html b/templates/base.html index c67835a93..f860cef37 100644 --- a/templates/base.html +++ b/templates/base.html @@ -229,6 +229,7 @@ mixpanel.init("{{ mixpanel_key }}", { track_pageview : false, debug: {{ is_debug {% endif %} +