Datenbank erweitert by Akki, Detail-Seite by Kalle
This commit is contained in:
parent
6a0a74191e
commit
607ffbd0f6
@ -355,8 +355,7 @@ angular.module('starter', ['ionic','ngIOS9UIWebViewPatch','starter.controllers',
|
|||||||
.state('app.pokemondetail', {
|
.state('app.pokemondetail', {
|
||||||
url: "/pokemondetail",
|
url: "/pokemondetail",
|
||||||
params: {
|
params: {
|
||||||
contractdetail: null,
|
pokemondetail: null
|
||||||
actionDelete: false
|
|
||||||
},
|
},
|
||||||
views: {
|
views: {
|
||||||
'menuContent': {
|
'menuContent': {
|
||||||
|
|||||||
BIN
www/pokedex.db
BIN
www/pokedex.db
Binary file not shown.
@ -13,49 +13,147 @@
|
|||||||
</a>
|
</a>
|
||||||
</ion-nav-buttons> <!--end left button on navigation bar-->
|
</ion-nav-buttons> <!--end left button on navigation bar-->
|
||||||
|
|
||||||
<!--contract detail section-->
|
<ion-content>
|
||||||
<form name="contractForm">
|
<!--Pokemon detail section-->
|
||||||
<ion-content id="contract-details-content">
|
<div class="list card">
|
||||||
<!--contract detail input section-->
|
|
||||||
<md-input-container md-no-float>
|
|
||||||
<i class="ion-android-person"></i>
|
|
||||||
<input ng-model="contract.firstName" name="firstName" required placeholder="* First Name (required)">
|
|
||||||
</md-input-container>
|
|
||||||
<md-input-container md-no-float>
|
|
||||||
<i class="ion-android-people"></i>
|
|
||||||
<input ng-model="contract.lastName" name="lastName" required placeholder="* Last Name (required)">
|
|
||||||
</md-input-container>
|
|
||||||
<md-input-container md-no-float>
|
|
||||||
<i class="ion-android-phone-portrait"></i>
|
|
||||||
<input ng-model="contract.telephone" name="telephone" required placeholder="* Telephone (required)"
|
|
||||||
type="tel">
|
|
||||||
</md-input-container>
|
|
||||||
<md-input-container md-no-float>
|
|
||||||
<i class="ion-android-mail"></i>
|
|
||||||
<input ng-model="contract.email" name="email" placeholder="Email">
|
|
||||||
</md-input-container>
|
|
||||||
<md-input-container md-no-float>
|
|
||||||
<i class="ion-android-calendar"></i>
|
|
||||||
<input ng-model="contract.createDate" disabled name="dateTime" placeholder="Date Time">
|
|
||||||
</md-input-container>
|
|
||||||
<md-input-container md-no-float>
|
|
||||||
<i class="ion-android-favorite"></i>
|
|
||||||
<input ng-model="contract.age" numbers-only name="age" placeholder="Age" type="tel">
|
|
||||||
</md-input-container><!--end contract detail input section-->
|
|
||||||
|
|
||||||
<!--contract switch section-->
|
<div class="item item-avatar">
|
||||||
<md-switch ng-model="contract.isEnable" ng-disabled="actionDelete">
|
<img src="{{pokemon.pokemonimage}}">
|
||||||
{{(contract.isEnable == true ? 'Enable' : 'Disabled' ) }} Contract
|
<h2>{{pokemon.pokemonname}}</h2>
|
||||||
</md-switch><!--end contract switch section-->
|
<p>Pokedex-Id: {{ pokemon.pokedexidString }}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
</ion-content>
|
<div class="item item-body">
|
||||||
|
<img class="full-image" src="{{pokemon.pokemonimage}}">
|
||||||
|
<p>
|
||||||
|
Richtig geiles Pokemon.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div class="item item-divider">
|
||||||
|
Beschreibung
|
||||||
|
</div>
|
||||||
|
<div class="item item-text-wrap">
|
||||||
|
This is a basic Card with some text.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div class="item item-divider">
|
||||||
|
Typ
|
||||||
|
</div>
|
||||||
|
<div class="item item-text-wrap">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-50">
|
||||||
|
<div ng-if="pokemon.pokemontypa > 0" class="pokemontyp{{ pokemon.pokemontypa }}">
|
||||||
|
<img src="img/typbilder/{{ pokemon.pokemontypa }}.png" alt="PokemonTyp" width="32" height="32">
|
||||||
|
{{ pokemon.pokemontypaString }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-50">
|
||||||
|
<div ng-if="pokemon.pokemontypb > 0" class="pokemontyp{{ pokemon.pokemontypb }}">
|
||||||
|
<img src="img/typbilder/{{ pokemon.pokemontypb }}.png" alt="PokemonTyp" width="32" height="32">
|
||||||
|
{{ pokemon.pokemontypbString }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div class="item item-divider">
|
||||||
|
Schwächen
|
||||||
|
</div>
|
||||||
|
<div class="item item-text-wrap">
|
||||||
|
|
||||||
|
<div ng-if="pokemon.pokemonweaka > 0" class="row">
|
||||||
|
<div ng-if="pokemon.pokemonweaka > 0" class="col-50">
|
||||||
|
<div ng-if="pokemon.pokemonweaka > 0" class="pokemontyp{{ pokemon.pokemonweaka }}">
|
||||||
|
<img src="img/typbilder/{{ pokemon.pokemonweaka }}.png" alt="PokemonTyp" width="32" height="32">
|
||||||
|
{{ pokemon.pokemonweakaString }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div ng-if="pokemon.pokemonweakb > 0" class="col-50">
|
||||||
|
<div ng-if="pokemon.pokemonweakb > 0" class="pokemontyp{{ pokemon.pokemonweakb }}">
|
||||||
|
<img src="img/typbilder/{{ pokemon.pokemonweakb }}.png" alt="PokemonTyp" width="32" height="32">
|
||||||
|
{{ pokemon.pokemonweakbString }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-if="pokemon.pokemonweakc > 0" class="row">
|
||||||
|
<div ng-if="pokemon.pokemonweakc > 0" class="col-50">
|
||||||
|
<div ng-if="pokemon.pokemonweakc > 0" class="pokemontyp{{ pokemon.pokemonweakc }}">
|
||||||
|
<img src="img/typbilder/{{ pokemon.pokemonweakc }}.png" alt="PokemonTyp" width="32" height="32">
|
||||||
|
{{ pokemon.pokemonweakcString }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div ng-if="pokemon.pokemonweakd > 0" class="col-50">
|
||||||
|
<div ng-if="pokemon.pokemonweakd > 0" class="pokemontyp{{ pokemon.pokemonweakd }}">
|
||||||
|
<img src="img/typbilder/{{ pokemon.pokemonweakd }}.png" alt="PokemonTyp" width="32" height="32">
|
||||||
|
{{ pokemon.pokemonweakdString }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-if="pokemon.pokemonweake > 0" class="row">
|
||||||
|
<div ng-if="pokemon.pokemonweake > 0" class="col-50">
|
||||||
|
<div ng-if="pokemon.pokemonweake > 0" class="pokemontyp{{ pokemon.pokemonweake }}">
|
||||||
|
<img src="img/typbilder/{{ pokemon.pokemonweake }}.png" alt="PokemonTyp" width="32" height="32">
|
||||||
|
{{ pokemon.pokemonweakeString }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div ng-if="pokemon.pokemonweakf > 0" class="col-50">
|
||||||
|
<div ng-if="pokemon.pokemonweakf > 0" class="pokemontyp{{ pokemon.pokemonweakf }}">
|
||||||
|
<img src="img/typbilder/{{ pokemon.pokemonweakf }}.png" alt="PokemonTyp" width="32" height="32">
|
||||||
|
{{ pokemon.pokemonweakfString }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-if="pokemon.pokemonweakg > 0" class="row">
|
||||||
|
<div ng-if="pokemon.pokemonweakg > 0" class="col-50">
|
||||||
|
<div ng-if="pokemon.pokemonweakg > 0" class="pokemontyp{{ pokemon.pokemonweakg }}">
|
||||||
|
<img src="img/typbilder/{{ pokemon.pokemonweakg }}.png" alt="PokemonTyp" width="32" height="32">
|
||||||
|
{{ pokemon.pokemonweakgString }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div class="item item-divider">
|
||||||
|
Basiswerte
|
||||||
|
</div>
|
||||||
|
<div class="item item-text-wrap">
|
||||||
|
This is a basic Card with some text.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div class="item item-divider">
|
||||||
|
Evolution
|
||||||
|
</div>
|
||||||
|
<div class="item item-text-wrap">
|
||||||
|
{{ pokemon.pokemonentwa }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ion-content>
|
||||||
<div class="footer-fab-bar">
|
<div class="footer-fab-bar">
|
||||||
<a class="md-button md-accent md-fab fab-footer" ng-click="showListBottomSheet($event,contractForm)"
|
<a class="md-button md-accent md-fab fab-footer" ng-click="showListBottomSheet($event,contractForm)"
|
||||||
aria-label="Contract Form Actions">
|
aria-label="Contract Form Actions">
|
||||||
<i class="ion-android-star"></i>
|
<i class="ion-android-star"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</form><!--end contract detail section-->
|
<!--end Pokemon detail section-->
|
||||||
|
|
||||||
<!--angular template section-->
|
<!--angular template section-->
|
||||||
<script type="text/ng-template" id="contract-actions-template">
|
<script type="text/ng-template" id="contract-actions-template">
|
||||||
@ -68,7 +166,7 @@
|
|||||||
ng-class="{ 'disabled-link': disableSaveBtn}"
|
ng-class="{ 'disabled-link': disableSaveBtn}"
|
||||||
ng-click="saveContract(contract,$event)">
|
ng-click="saveContract(contract,$event)">
|
||||||
<i class="ion-android-list"></i>
|
<i class="ion-android-list"></i>
|
||||||
<span>Save Contract</span>
|
<span>Als Favorit speichern</span>
|
||||||
</a>
|
</a>
|
||||||
</md-list-item>
|
</md-list-item>
|
||||||
|
|
||||||
@ -76,7 +174,7 @@
|
|||||||
<a class="md-default-theme md-bottom-sheet-list-item"
|
<a class="md-default-theme md-bottom-sheet-list-item"
|
||||||
ng-click="deleteContract(contract,$event)">
|
ng-click="deleteContract(contract,$event)">
|
||||||
<i class="ion-android-delete"></i>
|
<i class="ion-android-delete"></i>
|
||||||
<span>Remove Contract</span>
|
<span>Als Lesezeichen speichern</span>
|
||||||
</a>
|
</a>
|
||||||
</md-list-item>
|
</md-list-item>
|
||||||
<!--end md bottom sheet list item-->
|
<!--end md bottom sheet list item-->
|
||||||
|
|||||||
@ -84,8 +84,7 @@ appControllers.controller('pokemonListCtrl', function ($scope, $stateParams,$fil
|
|||||||
$scope.navigateTo = function (targetPage, objectData) {
|
$scope.navigateTo = function (targetPage, objectData) {
|
||||||
$timeout(function(){
|
$timeout(function(){
|
||||||
$state.go(targetPage, {
|
$state.go(targetPage, {
|
||||||
pokemondetail: objectData,
|
pokemondetail: objectData
|
||||||
actionDelete: (objectData == null ? false : true)
|
|
||||||
});
|
});
|
||||||
},400);
|
},400);
|
||||||
};// End navigateTo.
|
};// End navigateTo.
|
||||||
@ -103,7 +102,7 @@ appControllers.controller('pokemonListCtrl', function ($scope, $stateParams,$fil
|
|||||||
});// End of Pokemon List Page Controller.
|
});// End of Pokemon List Page Controller.
|
||||||
|
|
||||||
// Controller of pokemon Detail Page.
|
// Controller of pokemon Detail Page.
|
||||||
appControllers.controller('pokemonDetailCtrl', function ($mdBottomSheet, $mdToast, $scope, $stateParams, $filter, $mdDialog, $ionicHistory, pokedexDB, $ionicHistory) {
|
appControllers.controller('pokemonDetailCtrl', function ($mdBottomSheet, $mdToast, $scope, $stateParams, $filter, $mdDialog, $ionicHistory, pokedexDB) {
|
||||||
|
|
||||||
// initialForm is the first activity in the controller.
|
// initialForm is the first activity in the controller.
|
||||||
// It will initial all variable data and let the function works when page load.
|
// It will initial all variable data and let the function works when page load.
|
||||||
@ -116,7 +115,7 @@ appControllers.controller('pokemonDetailCtrl', function ($mdBottomSheet, $mdToas
|
|||||||
// Parameter :
|
// Parameter :
|
||||||
// $stateParams.actionDelete(bool) = status that pass from pokemon list page.
|
// $stateParams.actionDelete(bool) = status that pass from pokemon list page.
|
||||||
// $stateParams.pokemondetail(object) = pokemon that user select from pokemon list page.
|
// $stateParams.pokemondetail(object) = pokemon that user select from pokemon list page.
|
||||||
$scope.pokemon = $scope.getPokemonData($stateParams.actionDelete, $stateParams.pokemondetail);
|
$scope.pokemon = $scope.getPokemonData($stateParams.pokemondetail);
|
||||||
|
|
||||||
//$scope.actionDelete is the variable for allow or not allow to delete data.
|
//$scope.actionDelete is the variable for allow or not allow to delete data.
|
||||||
// It will allow to delete data when have data in the database.
|
// It will allow to delete data when have data in the database.
|
||||||
@ -124,7 +123,7 @@ appControllers.controller('pokemonDetailCtrl', function ($mdBottomSheet, $mdToas
|
|||||||
}; //End initialForm.
|
}; //End initialForm.
|
||||||
|
|
||||||
// getPokemonData is for get pokemon detail data.
|
// getPokemonData is for get pokemon detail data.
|
||||||
$scope.getPokemonData = function (actionDelete, pokemonDetail) {
|
$scope.getPokemonData = function (pokemonDetail) {
|
||||||
// tempPokemon is temporary pokemon data detail.
|
// tempPokemon is temporary pokemon data detail.
|
||||||
var tempPokemon = {
|
var tempPokemon = {
|
||||||
id: null,
|
id: null,
|
||||||
@ -137,10 +136,11 @@ appControllers.controller('pokemonDetailCtrl', function ($mdBottomSheet, $mdToas
|
|||||||
pokemontypbString: '',
|
pokemontypbString: '',
|
||||||
pokemonimage: ''
|
pokemonimage: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
// If actionDelete is true pokemon Detail Page will show pokemon detail that receive form pokemon list page.
|
// If actionDelete is true pokemon Detail Page will show pokemon detail that receive form pokemon list page.
|
||||||
// else it will show pokemon for user to add new data.
|
// else it will show pokemon for user to add new data.
|
||||||
return (actionDelete ? angular.copy(pokemonDetail) : tempPokemon);
|
//return (actionDelete ? angular.copy(pokemonDetail) : tempPokemon);
|
||||||
|
return (pokemonDetail);
|
||||||
|
|
||||||
};//End get pokemon detail data.
|
};//End get pokemon detail data.
|
||||||
|
|
||||||
// savePokemon is for save pokemon.
|
// savePokemon is for save pokemon.
|
||||||
|
|||||||
@ -88,7 +88,32 @@ appServices.factory('pokedexDB', function ($cordovaSQLite)
|
|||||||
pokemontypa : res.rows.item(i).POKEMONTYPA ,
|
pokemontypa : res.rows.item(i).POKEMONTYPA ,
|
||||||
pokemontypb : res.rows.item(i).POKEMONTYPB ,
|
pokemontypb : res.rows.item(i).POKEMONTYPB ,
|
||||||
pokemontypaString : pokemontypen[res.rows.item(i).POKEMONTYPA] ,
|
pokemontypaString : pokemontypen[res.rows.item(i).POKEMONTYPA] ,
|
||||||
pokemontypbString : pokemontypen[res.rows.item(i).POKEMONTYPB] ,
|
pokemontypbString : pokemontypen[res.rows.item(i).POKEMONTYPB] ,
|
||||||
|
pokemonweaka : res.rows.item(i).POKEMONWEAKA ,
|
||||||
|
pokemonweakb : res.rows.item(i).POKEMONWEAKB ,
|
||||||
|
pokemonweakc : res.rows.item(i).POKEMONWEAKC ,
|
||||||
|
pokemonweakd : res.rows.item(i).POKEMONWEAKD ,
|
||||||
|
pokemonweake : res.rows.item(i).POKEMONWEAKE ,
|
||||||
|
pokemonweakf : res.rows.item(i).POKEMONWEAKF ,
|
||||||
|
pokemonweakg : res.rows.item(i).POKEMONWEAKG ,
|
||||||
|
pokemonweakaString : pokemontypen[res.rows.item(i).POKEMONWEAKA] ,
|
||||||
|
pokemonweakbString : pokemontypen[res.rows.item(i).POKEMONWEAKB] ,
|
||||||
|
pokemonweakcString : pokemontypen[res.rows.item(i).POKEMONWEAKC] ,
|
||||||
|
pokemonweakdString : pokemontypen[res.rows.item(i).POKEMONWEAKD] ,
|
||||||
|
pokemonweakeString : pokemontypen[res.rows.item(i).POKEMONWEAKE] ,
|
||||||
|
pokemonweakfString : pokemontypen[res.rows.item(i).POKEMONWEAKF] ,
|
||||||
|
pokemonweakgString : pokemontypen[res.rows.item(i).POKEMONWEAKG] ,
|
||||||
|
pokemonmaxa : res.rows.item(i).POKEMONMAXA ,
|
||||||
|
pokemonmaxb : res.rows.item(i).POKEMONMAXB ,
|
||||||
|
pokemonmaxc : res.rows.item(i).POKEMONMAXC ,
|
||||||
|
pokemonmaxd : res.rows.item(i).POKEMONMAXD ,
|
||||||
|
pokemonmaxe : res.rows.item(i).POKEMONMAXE ,
|
||||||
|
pokemonmaxf : res.rows.item(i).POKEMONMAXF ,
|
||||||
|
pokemonmaxg : res.rows.item(i).POKEMONMAXG ,
|
||||||
|
pokemontext : res.rows.item(i).POKEMONTEXT ,
|
||||||
|
pokemonnote : res.rows.item(i).POKEMONNOTE ,
|
||||||
|
pokemonentwa : res.rows.item(i).POKEMONENTWA ,
|
||||||
|
pokemonentwb : res.rows.item(i).POKEMONENTWB ,
|
||||||
pokemonimage : res.rows.item(i).POKEMONIMAGE
|
pokemonimage : res.rows.item(i).POKEMONIMAGE
|
||||||
};
|
};
|
||||||
pokemonList.push(dataItem);
|
pokemonList.push(dataItem);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user