moved tickets page

This commit is contained in:
Davide Alberani 2016-06-19 16:58:38 +02:00
parent 15fb62564f
commit f4e29258cc
8 changed files with 14 additions and 13 deletions

View file

@ -3,9 +3,9 @@
<div class="panel panel-primary table-striped top5"> <div class="panel panel-primary table-striped top5">
<div class="panel-heading"> <div class="panel-heading">
<h1> <h1>
<button ng-if="event._id" ng-click="$state.go('event.info', {id: event._id})" class="btn btn-success"> <button ng-if="event._id" ng-click="$state.go('event.tickets', {id: event._id})" class="btn btn-success">
<span class="fa fa-info-circle vcenter"></span> <span class="fa fa-ticket vcenter"></span>
{{'Info' | translate}} {{'Tickets' | translate}}
</button> </button>
&nbsp;<span ng-if="!event.title">{{'New event' | translate}}</span>{{event.title}} &nbsp;<span ng-if="!event.title">{{'New event' | translate}}</span>{{event.title}}
</h1> </h1>

View file

@ -1,7 +1,7 @@
<!-- main view for Event --> <!-- main view for Event -->
<!-- div class="container"> <!-- div class="container">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li ui-sref-active="active"><a ui-sref="event.info({id: $state.params.id})">Info</a></li> <li ui-sref-active="active"><a ui-sref="event.tickets({id: $state.params.id})">Info</a></li>
<li ui-sref-active="active"><a ui-sref="event.edit({id: $state.params.id})">Edit</a></li> <li ui-sref-active="active"><a ui-sref="event.edit({id: $state.params.id})">Edit</a></li>
</ul --> </ul -->
<div ui-view></div> <div ui-view></div>

View file

@ -52,7 +52,7 @@
<tr ng-repeat="person in event.persons | splittedFilter:query | orderBy:personsOrder"> <tr ng-repeat="person in event.persons | splittedFilter:query | orderBy:personsOrder">
<td class="text-right">{{$index+1}}</td> <td class="text-right">{{$index+1}}</td>
<td> <td>
<span><strong><a ui-sref="person.info({id: person.person_id})"><span>{{person.name}}</span>&nbsp;<span>{{person.surname}}</span></a></strong></span><span ng-if="person.email">&nbsp;&lt;{{person.email}}&gt;</span> <span><strong><a ui-sref="person.info({id: person.person_id})"><span class="fa fa-lg fa-user"></span></a>&nbsp;<a ui-sref="event.ticket.edit({id: event._id, ticket_id: person.ticket_id})" ng-if="person.ticket_id"><span>{{person.name}}</span>&nbsp;<span>{{person.surname}}</span></a></strong></span><span ng-if="!person.ticket_id"><span>{{person.name}}</span>&nbsp;<span>{{person.surname}}</span></a></strong></span></span><span ng-if="person.email">&nbsp;&lt;{{person.email}}&gt;</span>
<p ng-if="person.company || person.job_title"><i ng-if="person.job_title">{{person.job_title}}</i><span ng-if="person.company && person.job_title">&nbsp;@&nbsp;</span><i ng-if="person.company">{{person.company}}</i></p> <p ng-if="person.company || person.job_title"><i ng-if="person.job_title">{{person.job_title}}</i><span ng-if="person.company && person.job_title">&nbsp;@&nbsp;</span><i ng-if="person.company">{{person.company}}</i></p>
</td> </td>
<td class="text-center"> <td class="text-center">

View file

@ -46,7 +46,8 @@
</td> </td>
<td> <td>
<button ng-if="hasPermission('event:tickets|create')" ng-click="$state.go('event.ticket.new', {id: event._id})" class="btn btn-link fa fa-user-plus" type="button" title="{{'Register' | translate}}"></button> <button ng-if="hasPermission('event:tickets|create')" ng-click="$state.go('event.ticket.new', {id: event._id})" class="btn btn-link fa fa-user-plus" type="button" title="{{'Register' | translate}}"></button>
<button ng-if="hasPermission('persons|update')" ng-click="$state.go('event.info', {id: event._id})" class="btn btn-link fa fa-list" type="button" title="{{'Manage attendees' | translate}}"></button> <button ng-if="hasPermission('persons|update')" ng-click="$state.go('event.tickets', {id: event._id})" class="btn btn-link fa fa-list" type="button" title="{{'Manage attendees' | translate}}"></button>
<button ng-if="hasPermission('event|update')" ng-click="$state.go('event.edit', {id: event._id})" type="button" class="btn btn-link fa fa-cog fa-lg" title="{{'Edit' | translate}}"></button>
<button ng-if="hasPermission('event|delete')" ng-click="remove(event._id)" type="button" class="btn btn-link fa fa-trash fa-lg" title="{{'Delete' | translate}}"></button> <button ng-if="hasPermission('event|delete')" ng-click="remove(event._id)" type="button" class="btn btn-link fa fa-trash fa-lg" title="{{'Delete' | translate}}"></button>
</td> </td>
</tr> </tr>

View file

@ -121,9 +121,9 @@ eventManApp.config(['$stateProvider', '$urlRouterProvider',
templateUrl: 'event-edit.html', templateUrl: 'event-edit.html',
controller: 'EventDetailsCtrl' controller: 'EventDetailsCtrl'
}) })
.state('event.info', { .state('event.tickets', {
url: '/:id', url: '/:id/tickets',
templateUrl: 'event-info.html', templateUrl: 'event-tickets.html',
controller: 'EventDetailsCtrl' controller: 'EventDetailsCtrl'
}) })
.state('event.ticket', { .state('event.ticket', {

View file

@ -121,7 +121,7 @@ eventManControllers.controller('EventDetailsCtrl', ['$scope', '$state', 'Event',
); );
}); });
if ($state.is('event.info')) { if ($state.is('event.tickets')) {
$scope.allPersons = Person.all(); $scope.allPersons = Person.all();
// Handle WebSocket connection used to update the list of persons. // Handle WebSocket connection used to update the list of persons.

View file

@ -34,7 +34,7 @@
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="event in events | splittedFilter:query | orderBy:eventsOrderProp"> <tr ng-repeat="event in events | splittedFilter:query | orderBy:eventsOrderProp">
<td><strong><a ui-sref="event.info({id: event._id})">{{event.title}}</a></strong></td> <td><strong><a ui-sref="event.tickets({id: event._id})">{{event.title}}</a></strong></td>
<td class="text-center"> <td class="text-center">
<button class="btn btn-link" name="switch-registered" ng-click="switchRegistered(event, person, !event.person_data.person_id)"><span class="fa fa-lg {{(event.person_data.person_id) && 'fa-check-circle text-success' || 'fa-times-circle text-danger'}}"></span></button> <button class="btn btn-link" name="switch-registered" ng-click="switchRegistered(event, person, !event.person_data.person_id)"><span class="fa fa-lg {{(event.person_data.person_id) && 'fa-check-circle text-success' || 'fa-times-circle text-danger'}}"></span></button>
</td> </td>

View file

@ -677,7 +677,7 @@ class EventsHandler(CollectionHandler):
ret = {'action': 'update', 'person_id': person_id, 'person': new_person_data, 'uuid': uuid} ret = {'action': 'update', 'person_id': person_id, 'person': new_person_data, 'uuid': uuid}
if old_person_data != new_person_data: if old_person_data != new_person_data:
self.send_ws_message('event/%s/updates' % id_, json.dumps(ret)) self.send_ws_message('event/%s/tickets/updates' % id_, json.dumps(ret))
return ret return ret
def handle_put_tickets(self, id_, person_id, data): def handle_put_tickets(self, id_, person_id, data):
@ -966,7 +966,7 @@ def run():
db_connector.add('settings', db_connector.add('settings',
{'setting': 'server_cookie_secret', 'cookie_secret': cookie_secret}) {'setting': 'server_cookie_secret', 'cookie_secret': cookie_secret})
_ws_handler = (r"/ws/+event/+(?P<event_id>[\w\d_-]+)/+updates/?", WebSocketEventUpdatesHandler) _ws_handler = (r"/ws/+event/+(?P<event_id>[\w\d_-]+)/+tickets/+updates/?", WebSocketEventUpdatesHandler)
_persons_path = r"/persons/?(?P<id_>[\w\d_-]+)?/?(?P<resource>[\w\d_-]+)?/?(?P<resource_id>[\w\d_-]+)?" _persons_path = r"/persons/?(?P<id_>[\w\d_-]+)?/?(?P<resource>[\w\d_-]+)?/?(?P<resource_id>[\w\d_-]+)?"
_events_path = r"/events/?(?P<id_>[\w\d_-]+)?/?(?P<resource>[\w\d_-]+)?/?(?P<resource_id>[\w\d_-]+)?" _events_path = r"/events/?(?P<id_>[\w\d_-]+)?/?(?P<resource>[\w\d_-]+)?/?(?P<resource_id>[\w\d_-]+)?"
_users_path = r"/users/?(?P<id_>[\w\d_-]+)?/?(?P<resource>[\w\d_-]+)?/?(?P<resource_id>[\w\d_-]+)?" _users_path = r"/users/?(?P<id_>[\w\d_-]+)?/?(?P<resource>[\w\d_-]+)?/?(?P<resource_id>[\w\d_-]+)?"