From ffddf169d1fe2e72bd14627a9daf2653364ca1ae Mon Sep 17 00:00:00 2001 From: Victor Mocelin <vm13@inf.ufpr.br> Date: Sat, 2 Apr 2016 16:18:58 -0300 Subject: [PATCH] Alterada os routes para individualizar os eventos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Passa o id do evento como parâmetro para a tela da lista. Alterado o layout da tela da lista, para mostrar as informações da palestra. --- www/js/routes.js | 13 ++++++++----- www/templates/ceitificator.html | 2 +- www/templates/listaDePresenAEventoX.html | 7 +++++++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/www/js/routes.js b/www/js/routes.js index e632d53..6fc1e09 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 6d25dff..b692e2d 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 6e4ed4a..17be38a 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> -- GitLab