From ae75dc383401b4259098d144dd4f9312f0237426 Mon Sep 17 00:00:00 2001 From: Joel Lavikainen Date: Wed, 29 Mar 2017 17:45:42 +0300 Subject: [PATCH] Add frontend controllers for apy deals --- infoscreen/static/css/apy.css | 6 ++++++ infoscreen/static/html/apy.html | 12 ++++++++++++ infoscreen/static/html/apy_create.html | 10 ++++++++++ infoscreen/static/js/infoadmin_controllers.js | 7 +++++++ infoscreen/static/js/infoscreen_controllers.js | 9 +++++++++ 5 files changed, 44 insertions(+) create mode 100644 infoscreen/static/css/apy.css create mode 100644 infoscreen/static/html/apy.html create mode 100644 infoscreen/static/html/apy_create.html diff --git a/infoscreen/static/css/apy.css b/infoscreen/static/css/apy.css new file mode 100644 index 0000000..976fef8 --- /dev/null +++ b/infoscreen/static/css/apy.css @@ -0,0 +1,6 @@ +#header { + height: 30%; + width: 100%; + background-color:#7c1330; + text-align: center; +} \ No newline at end of file diff --git a/infoscreen/static/html/apy.html b/infoscreen/static/html/apy.html new file mode 100644 index 0000000..b645e65 --- /dev/null +++ b/infoscreen/static/html/apy.html @@ -0,0 +1,12 @@ + +
+
+
Kilta
+
Lehdet
+
+
+
{{event.name}}
+
{{event.amount}}
+
+ +
\ No newline at end of file diff --git a/infoscreen/static/html/apy_create.html b/infoscreen/static/html/apy_create.html new file mode 100644 index 0000000..1b0b2ee --- /dev/null +++ b/infoscreen/static/html/apy_create.html @@ -0,0 +1,10 @@ +
+
+ create apyitem +
+
+ + +
+ +
diff --git a/infoscreen/static/js/infoadmin_controllers.js b/infoscreen/static/js/infoadmin_controllers.js index c4b11d6..d6b3515 100644 --- a/infoscreen/static/js/infoadmin_controllers.js +++ b/infoscreen/static/js/infoadmin_controllers.js @@ -181,3 +181,10 @@ app.controller('infoadmin_image_create', ['$scope', 'Upload', '$timeout',"ItemLi }); } }]); + +app.controller('infoadmin_apyitem_create', function($scope, $http,ItemList){ + $scope.item = {} + $scope.send = function(){ + $http.post("/infoscreen/create_apyitem", $scope.item).then(ItemList.loadItems) + } +}); diff --git a/infoscreen/static/js/infoscreen_controllers.js b/infoscreen/static/js/infoscreen_controllers.js index 5b2f062..a70deb9 100644 --- a/infoscreen/static/js/infoscreen_controllers.js +++ b/infoscreen/static/js/infoscreen_controllers.js @@ -73,6 +73,15 @@ app.controller('SossoController', function($scope, $http) { $scope.data = response.data; }) }); + +app.controller('ApyController', function($scope, $http) { + $scope.data = []; + $http.get("/infoscreen/apyjson").then(function)(response) + { + $scope.data = response.data.data + } +}); + app.controller('EventController', function($scope, $http) { $scope.data = []; $http.get("https://sik.ayy.fi/api/events.php?limit=10").then(function(response)