diff --git a/www/js/routes.js b/www/js/routes.js index e632d538d9c12bfecef4049a356f99ef0aa97047..6fc1e0943ddf51f2746a6a16ca2732ff8de32efb 100644 --- a/www/js/routes.js +++ b/www/js/routes.js @@ -20,14 +20,17 @@ angular.module('app.routes', []) url: '/novo-evento', templateUrl: 'templates/novoEvento.html', controller: 'novoEventoCtrl' - }) - .state('listaDePresenAEventoX', { - url: '/presenca', + url: '/presenca/:eventId', templateUrl: 'templates/listaDePresenAEventoX.html', - controller: 'listaDePresenAEventoXCtrl' - }) + controller: 'listaDePresenAEventoXCtrl', + resolve: { + eventX: function($stateParams, EventsService) { + return EventsService.getEventById($stateParams.eventId); + } + } + }); $urlRouterProvider.otherwise('/home'); diff --git a/www/templates/ceitificator.html b/www/templates/ceitificator.html index 6d25dffdebe3bbfefbdf67c2248b0a86d43a75b9..b692e2d227b4acceebdae8c99d20e20e536a8cdf 100644 --- a/www/templates/ceitificator.html +++ b/www/templates/ceitificator.html @@ -5,7 +5,7 @@ <div class="item item-body"> <a ui-sref="novoEvento" id="ceitificator-button2" class="button button-positive button-block icon-right ion-android-add-circle">Criar Novo</a> <ion-list> - <ion-item ui-sref="listaDePresenAEventoX" ng-repeat="event in events">{{event.id}}: {{event.name}} - {{event.date}} - {{event.hours}}</ion-item> + <ion-item ng-repeat="event in events" ui-sref='listaDePresenAEventoX({eventId: event.id})'>{{event.id}}: {{event.name}} - {{event.date}} - {{event.hours}}</ion-item> </ion-list> </div> </div> diff --git a/www/templates/listaDePresenAEventoX.html b/www/templates/listaDePresenAEventoX.html index 6e4ed4a62212676cb4b47fe561a49bcde19fedc0..17be38a2b521fa7ac1ac798bda420b9b1bd3942b 100644 --- a/www/templates/listaDePresenAEventoX.html +++ b/www/templates/listaDePresenAEventoX.html @@ -1,6 +1,13 @@ <ion-view title="Lista de Presença - Evento X"> <ion-content overflow-scroll="true" padding="true" class="has-header"> <div class="list card"> + <div id="listaDePresenAEventoX-markdown1" style="color:#000000;"> + <p><strong>Evento:</strong> {{eventX.name}}</p> + <p><strong>Descrição:</strong> {{eventX.desc}}</p> + <p><strong>Data:</strong> {{eventX.date}}</p> + <p><strong>Local:</strong> {{eventX.place}}</p> + <p><strong>Horas:</strong> {{eventX.hours}}</p> + </div> <div class="item item-body"> <button id="listaDePresenAEventoX-button9" class="button button-positive button-block icon-right ion-qr-scanner" ng-click="scan()">Adicionar</button> <ion-list>