Skip to content
Open

1 #1

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assets/greenhouse/GH_POST_CLONE_SCRIPT.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
set -e

npm install
sed -i.bak "s/\$API_KEY/g" project.json
npm run restore
41 changes: 9 additions & 32 deletions project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@
"excludePlugins": [],
"constants": {}
},
"test": {
"excludePlugins": [],
"constants": {}
},
"preprod": {
"excludePlugins": [],
"constants": {}
},
"qa": {
"excludePlugins": [],
"constants": {}
},
"prod": {
"excludePlugins": [
"cordova-plugin-console"
Expand All @@ -28,38 +16,27 @@
},
"apps": {
"default": {
"name": "App",
"id": "id.goes.here",
"name": "tmdb.app",
"id": "beul.rene.polytech2016.tmdb",
"constants": {
"I18N": {
"LOCALES": ["en-US", "fr-FR"],
"DEFAULT": "en-US"
"DEFAULT": "fr-FR"
}
},
"builds": {
"dev": {
"constants": {
"API_SERVER_URL": ""
}
},
"test": {
"constants": {
"API_SERVER_URL": ""
}
},
"preprod": {
"constants": {
"API_SERVER_URL": ""
}
},
"qa": {
"constants": {
"API_SERVER_URL": ""
"API_SERVER_URL": "https://api.themoviedb.org",
"API_IMAGE_URL": "https://image.tmdb.org",
"API_KEY": "$API_KEY"
}
},
"prod": {
"constants": {
"API_SERVER_URL": ""
"API_SERVER_URL": "https://api.themoviedb.org",
"API_IMAGE_URL": "https://image.tmdb.org",
"API_KEY": "$API_KEY"
}
}
}
Expand Down
19 changes: 19 additions & 0 deletions src/modules/app.states.details/controller.details.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* @memberOf app.states.details
*/
(function (module) {
'use strict';

function DetailsController($scope, movieDetails) {
var controller = this;

$scope.movieDetails = movieDetails;
}

module.controller('detailsController', [
'$scope',
'movieDetails',
DetailsController
]);

}(angular.module('app.states.details')));
34 changes: 34 additions & 0 deletions src/modules/app.states.details/details.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* @module app.states.home
*/
(function (module) {
'use strict';

var STATE_DETAILS = 'states.details';

function movieDetailsResolver($stateParams, statesService) {
return statesService.getMovie($stateParams.movieId);
}

function config($stateProvider) {
$stateProvider.state(STATE_DETAILS, {
data: { module: module, navBar: true },
url: '/details/:movieId',
views: {
'content-smartphone': {
controller: 'detailsController as detailsController'
}
},
resolve: {
movieDetails: ['$stateParams', 'statesService', movieDetailsResolver]
}
});
}

function run($rootScope) { $rootScope.STATE_DETAILS = STATE_DETAILS; }

module.constant('STATE_DETAILS', STATE_DETAILS);
module.config(['$stateProvider', config]);
module.run(['$rootScope', run]);

}(angular.module('app.states.details', ['app.states'])));
3 changes: 3 additions & 0 deletions src/modules/app.states.details/smartphone/details.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ion-view(view-title="{{ movieDetails.title }}")
ion-content
p {{ movieDetails.description }}
20 changes: 7 additions & 13 deletions src/modules/app.states.home/controller.home.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,21 @@
(function (module) {
'use strict';

function HomeController($scope, popupService, statesData) {
function HomeController($scope, statesService) {
var controller = this;

$scope.statesData = statesData;
$scope.search = { query: '', results: [] };

$scope.from = 'homeController';

controller.showPopup = function () {
var scope = { from: $scope.from, title: 'Popup' };
popupService.open(module, 'smartphone/popup', scope);
};

controller.onLanguageChange = function (locale) {
console.debug(locale);
controller.search = function () {
statesService.search($scope.search.query).then(function (results) {
$scope.search.results = results;
});
};
}

module.controller('homeController', [
'$scope',
'popupService',
'statesData',
'statesService',
HomeController
]);

Expand Down
2 changes: 1 addition & 1 deletion src/modules/app.states.home/i18n/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"STATES.HOME": {
"TITLE": "Page d'accueil",
"CONTENT": "Bonjour depuis {{ greeter }}",
"BUTTON": "Afficher la popup"
"BUTTON": "Surprise Mother******"
}
}
11 changes: 0 additions & 11 deletions src/modules/app.states.home/smartphone/content.home.pug

This file was deleted.

25 changes: 21 additions & 4 deletions src/modules/app.states.home/smartphone/home.pug
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
ion-view.view-home(
view-title="{{ 'STATES.HOME.TITLE' | translate }}",
translate-namespace="STATES.HOME")
ion-view(view-title="ACCUEIL")
ion-header-bar.bar-subheader.item-input-inset
label.item-input-wrapper
i.icon.ion-ios-search.placeholder-icon
input(
placeholder="Rechercher",
ng-model="search.query",
type="search")
button.button-clear.button-royal(
ng-disabled="search.query.length < 3",
on-tap="homeController.search()")
| OK
ion-content
ng-include(src="'modules/app.states.home/smartphone/content.home.html'")
ion-list
ion-item.item-divider Résultats
ion-item(ng-if="search.result.length < 1") Aucun résultat
ion-item.item-icon-right(
ng-repeat="result in search.results",
ui-state-params="{ movieId: result.id }",
ui-state="STATE_DETAILS")
| {{ result.title }}
i.icon.ion-ios-chevron-right
3 changes: 0 additions & 3 deletions src/modules/app.states.home/smartphone/popup.pug

This file was deleted.

12 changes: 11 additions & 1 deletion src/modules/app.states/service.states.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,19 @@
(function (module) {
'use strict';

function StatesService(httpService, i18nService) {
function StatesService($q, httpService, i18nService) {
var service = this;

service.getMovie = function (id) {
return $q.resolve({ id: id, title: 'Movie', description: 'Awesome' });
};

service.search = function (query) {
return $q.resolve(
[{ title: query, id: 1 }, { title: query, id: 2 }]
);
};

/**
* Resolve states data.
* @return {Promise} Passing an object.
Expand Down
3 changes: 2 additions & 1 deletion src/modules/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
* @module main
*/
angular.module('main', [
'app.states.home'
'app.states.home',
'app.states.details'
]);