From 88da8d067a1a3c19724b2c72d65f4126649a06a3 Mon Sep 17 00:00:00 2001 From: Mohammed Tantawy <6102@ait.nsw.edu.au> Date: Sat, 2 Feb 2019 16:03:37 +1100 Subject: [PATCH] Started routing --- .../scripts/ads-details/ads-details.html | 86 ++++ src/assets/scripts/ads-details/ads.service.js | 17 + src/assets/scripts/ads-details/controller.js | 8 + src/assets/scripts/ads-details/index.js | 7 + src/assets/scripts/ads/ads.html | 88 ++++ src/assets/scripts/ads/controller.js | 6 + src/assets/scripts/ads/index.js | 6 + src/assets/scripts/app/index.js | 30 ++ src/assets/scripts/dashboard/controller.js | 17 + src/assets/scripts/dashboard/index.js | 21 +- src/assets/scripts/index.js | 3 + src/assets/scripts/nwSidebar/nwSidebar.html | 425 ++++++++++-------- 12 files changed, 514 insertions(+), 200 deletions(-) create mode 100644 src/assets/scripts/ads-details/ads-details.html create mode 100644 src/assets/scripts/ads-details/ads.service.js create mode 100644 src/assets/scripts/ads-details/controller.js create mode 100644 src/assets/scripts/ads-details/index.js create mode 100644 src/assets/scripts/ads/ads.html create mode 100644 src/assets/scripts/ads/controller.js create mode 100644 src/assets/scripts/ads/index.js create mode 100644 src/assets/scripts/dashboard/controller.js diff --git a/src/assets/scripts/ads-details/ads-details.html b/src/assets/scripts/ads-details/ads-details.html new file mode 100644 index 0000000..cf72bb6 --- /dev/null +++ b/src/assets/scripts/ads-details/ads-details.html @@ -0,0 +1,86 @@ +
+
+ +
+
+ +
+
+ +
+ +
+ + +
+
+
+
+ company +
+
+

Graphic Design Internship

+
Great Southern Press
+
+
+
+
+
+
About the business:
+

Great Southern Press is a leading B2B publishing and events company built on + partnerships with industry. We deliver quality business information to our industries and great marketing + results to our clients. + + We build long-lasting partnerships with our industry partners in the energy and infrastructure sectors, + aligning the success of our business with the continued growth and expansion of the industries we publish + for. +

+
About the role:
+

This part-time role will suit a university graduate or someone looking + for an entry-level design position. The successful candidate will be involved in all areas of design + including:

+ + • Publication layout (annual directories, books etc).
+ • Creation of artwork for print and online advertisements.
+ • Wallcharts, flyers, brochures and other print design as required.
+ • Event collateral including branding, signage, handbooks etc.
+ • Designs for website, email communications and social media.

+ + Reporting to the Head of Design, you will have an opportunity to work with and be mentored by someone + with more than 10 years’ industry experience. +

+
+
+
+ + +
+
+
+
Location:
+

Melbourne, CBD & Inner Suburbs

+
Application close:
+

14th March 2019 (Friday)

+
Skills:
+
Graphic Design
+
Adobe Creaetive CC
+
Illustration
+

Posted 3 days ago

+
+
+
+ + +
+ + + +
+
+ + +
+ + +
\ No newline at end of file diff --git a/src/assets/scripts/ads-details/ads.service.js b/src/assets/scripts/ads-details/ads.service.js new file mode 100644 index 0000000..fde2223 --- /dev/null +++ b/src/assets/scripts/ads-details/ads.service.js @@ -0,0 +1,17 @@ +const AdsDetailsService = ($http) => { + let serv = {}; + + serv.fetchAdsService = () =>{ + return $http.get('https://nomitwisp-restapi.herokuapp.com/api/ads') + .then( (result) => { + console.log(result); + return result; + }, (error) => { + console.log(error); + return error; + }); + } + return serv; +} + +export default AdsDetailsService; \ No newline at end of file diff --git a/src/assets/scripts/ads-details/controller.js b/src/assets/scripts/ads-details/controller.js new file mode 100644 index 0000000..0a76b90 --- /dev/null +++ b/src/assets/scripts/ads-details/controller.js @@ -0,0 +1,8 @@ +const AdsDetailsController = async($scope, AdsDetailsService, $routeParams) => { + await AdsDetailsService.fetchAdsService() + .then((data) => { + $scope.ad = data[$routeParams.id]; + }) +} + +export default AdsDetailsController; \ No newline at end of file diff --git a/src/assets/scripts/ads-details/index.js b/src/assets/scripts/ads-details/index.js new file mode 100644 index 0000000..bd0ccbe --- /dev/null +++ b/src/assets/scripts/ads-details/index.js @@ -0,0 +1,7 @@ +import * as angular from 'angular'; +import AdsDetailsController from './controller'; +import AdsDetailsService from './ads.service' + +angular.module('nwAdsDetails', []) + .controller(AdsDetailsController.name, AdsDetailsController) + .factory(AdsDetailsService.name, AdsDetailsService); \ No newline at end of file diff --git a/src/assets/scripts/ads/ads.html b/src/assets/scripts/ads/ads.html new file mode 100644 index 0000000..4000d8e --- /dev/null +++ b/src/assets/scripts/ads/ads.html @@ -0,0 +1,88 @@ +
+
+
+

All Published Ads

+
+
+
+ +
+
+ + +
+
+ Card image cap +
+
+

Graphic Designer

+
+ +
+
+

Sierra Delta Creative

+
Two stars
+

Some quick example text to build on the card title and make up the bulk of the card's content.

+
+ +
+ VIEW MORE +
+
+
+
+ + +
+
+ Card image cap +
+
+

Graphic Designer

+
+ +
+
+

Sierra Delta Creative

+
Two stars
+

Some quick example text to build on the card title and make up the bulk of the card's content.

+
+ +
+ VIEW MORE +
+
+
+
+ + + +
+
+ Card image cap +
+
+

Graphic Designer

+
+ +
+
+

Sierra Delta Creative

+
Two stars
+

Some quick example text to build on the card title and make up the bulk of the card's content.

+
+ +
+ VIEW MORE +
+
+
+
+ + +
+
+ +
+
+
\ No newline at end of file diff --git a/src/assets/scripts/ads/controller.js b/src/assets/scripts/ads/controller.js new file mode 100644 index 0000000..0c7c7d1 --- /dev/null +++ b/src/assets/scripts/ads/controller.js @@ -0,0 +1,6 @@ +/** @ngInject */ +const AdsController = ($scope) => { + +} + +export default AdsController; \ No newline at end of file diff --git a/src/assets/scripts/ads/index.js b/src/assets/scripts/ads/index.js new file mode 100644 index 0000000..35d7b32 --- /dev/null +++ b/src/assets/scripts/ads/index.js @@ -0,0 +1,6 @@ +import * as angular from 'angular'; +import AdsController from './controller'; + +angular.module('nwAds', []) + .controller(AdsController.name, AdsController); + \ No newline at end of file diff --git a/src/assets/scripts/app/index.js b/src/assets/scripts/app/index.js index 4d4d0dc..6ff29c6 100644 --- a/src/assets/scripts/app/index.js +++ b/src/assets/scripts/app/index.js @@ -9,6 +9,8 @@ angular.module('NomitWisp', 'NomitWisp-Footer', 'nwDashboard', 'nwLogout', + 'nwAds', + 'nwAdsDetails', ngRoute ]) @@ -18,6 +20,34 @@ angular.module('NomitWisp', controller: 'DashboardController', templateUrl: 'assets/scripts/dashboard/dashboard.html' }) + .when('/ads', { + controller: 'AdsController', + templateUrl: 'assets/scripts/ads/ads.html' + }) + .when('/ads/:id',{ + controller: 'AdsDetailsController', + templateUrl: 'assets/scripts/ads-details/ads-details.html' + }) + // .when('/profile', { + // controller: 'ProfileController', + // templateUrl: '' + // }) + // .when('/users', { + // controller: 'UsersController', + // templateUrl: '' + // }) + // .when('/companies', { + // controller: 'CompaniesController', + // templateUrl: '' + // }) + // .when('/referees', { + // controller: 'RefereesController', + // templateUrl: '' + // }) + // .when('/reports', { + // controller: 'ReportsController', + // templateUrl: '' + // }) .otherwise({ redirectTo: '/' }); diff --git a/src/assets/scripts/dashboard/controller.js b/src/assets/scripts/dashboard/controller.js new file mode 100644 index 0000000..c0a3dd9 --- /dev/null +++ b/src/assets/scripts/dashboard/controller.js @@ -0,0 +1,17 @@ +/** @ngInject */ +const DashboardController = ($scope, $cookies) => { + const token = $cookies.get('access_token'); + console.log(token); + + if(typeof(token) !== "undefined"){ + $scope.user = parseJwt( token ); + } +} + +function parseJwt(token) { + var base64Url = token.split('.')[1]; + var base64 = base64Url.replace('-', '+').replace('_', '/'); + return JSON.parse(window.atob(base64)); +}; + +export default DashboardController; \ No newline at end of file diff --git a/src/assets/scripts/dashboard/index.js b/src/assets/scripts/dashboard/index.js index 02d842e..722e817 100644 --- a/src/assets/scripts/dashboard/index.js +++ b/src/assets/scripts/dashboard/index.js @@ -1,23 +1,6 @@ import * as angular from 'angular'; import ngCookies from 'angular-cookies'; +import DashboardController from './controller'; angular.module('nwDashboard', [ngCookies]) - .controller('DashboardController', DashboardController); - -/** @ngInject */ -function DashboardController($scope, $cookies){ - // service carica dashboard - // jquery per grafici - const token = $cookies.get('access_token'); - console.log(token); - - if(typeof(token) !== "undefined"){ - $scope.user = parseJwt( token ); - } -} - -function parseJwt(token) { - var base64Url = token.split('.')[1]; - var base64 = base64Url.replace('-', '+').replace('_', '/'); - return JSON.parse(window.atob(base64)); -}; \ No newline at end of file + .controller(DashboardController.name, DashboardController); \ No newline at end of file diff --git a/src/assets/scripts/index.js b/src/assets/scripts/index.js index 6ebe8fe..e326821 100755 --- a/src/assets/scripts/index.js +++ b/src/assets/scripts/index.js @@ -23,4 +23,7 @@ import './nwFooter'; import './nwSidebar'; import './nwTopbar'; import './dashboard' +import './ads'; +import './ads-details'; + import './app'; \ No newline at end of file diff --git a/src/assets/scripts/nwSidebar/nwSidebar.html b/src/assets/scripts/nwSidebar/nwSidebar.html index a331b2d..7f6ea22 100644 --- a/src/assets/scripts/nwSidebar/nwSidebar.html +++ b/src/assets/scripts/nwSidebar/nwSidebar.html @@ -1,94 +1,158 @@ - -