1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00

event monitor improvement

Many imrovement for the event monitoring admin module.
This commit is contained in:
siteswapjuggler 2017-09-04 00:09:08 +02:00
parent 73c9e301fb
commit e13817176f
5 changed files with 73 additions and 33 deletions

View File

@ -170,21 +170,27 @@ Application.Filters.filter "trainingReservationsFilter", [ ->
Application.Filters.filter "eventsReservationsFilter", [ -> Application.Filters.filter "eventsReservationsFilter", [ ->
(elements, selectedScope) -> (elements, selectedScope) ->
if !angular.isUndefined(elements) and !angular.isUndefined(selectedScope) and elements? and selectedScope? and selectedScope != "" if !angular.isUndefined(elements) and !angular.isUndefined(selectedScope) and elements? and selectedScope? and selectedScope != ""
switch selectedScope
when "all"
filteredElements = elements
when "passed"
filteredElements = []
angular.forEach elements, (element)->
element.start_at = element.availability.start_at if angular.isUndefined(element.start_at)
if new Date(element.start_at) < new Date
filteredElements.push(element)
filteredElements.reverse()
else
return []
filteredElements
else
filteredElements = [] filteredElements = []
angular.forEach elements, (element)-> angular.forEach elements, (element)->
element.start_at = element.availability.start_at if angular.isUndefined(element.start_at) element.start_at = element.availability.start_at if angular.isUndefined(element.start_at)
switch selectedScope if new Date(element.start_at) >= new Date
when "future" filteredElements.push(element)
if new Date(element.start_at) > new Date filteredElements.reverse()
filteredElements.push(element)
when "passed"
if new Date(element.start_at) <= new Date
filteredElements.push(element)
else
return []
filteredElements
else
elements
] ]
Application.Filters.filter "groupFilter", [ -> Application.Filters.filter "groupFilter", [ ->

View File

@ -1,8 +1,8 @@
<div class="col-md-6 m-b m-t"> <div class="col-md-6 m-b m-t">
<select ng-model="selectedTimezone" class="form-control"> <select ng-model="selectedTimezone" class="form-control">
<option value="" translate>{{ 'all_events' }}</option> <option value="" translate>{{ 'events_to_come' }}</option>
<option value="passed" translate>{{ 'passed_events' }}</option> <option value="passed" translate>{{ 'passed_events' }}</option>
<option value="future" translate>{{ 'events_to_come' }}</option> <option value="all" translate>{{ 'all_events' }}</option>
</select> </select>
</div> </div>
@ -11,25 +11,49 @@
<tr> <tr>
<th style="width:30%" translate>{{ 'title' }}</th> <th style="width:30%" translate>{{ 'title' }}</th>
<th style="width:30%" translate>{{ 'dates' }}</th> <th style="width:30%" translate>{{ 'dates' }}</th>
<th style="width:40%"></th> <th style="width:10%" translate>{{ 'booking' }}</th>
<th style="width:30%"></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr ng-repeat="event in filtered = (events | eventsReservationsFilter:selectedTimezone)"> <tr height="80px" ng-repeat="event in filtered = (events | eventsReservationsFilter:selectedTimezone)">
<td>
<td style="vertical-align:middle">
<a ui-sref="app.public.events_show({id: event.id})">{{ event.title }} </a> <a ui-sref="app.public.events_show({id: event.id})">{{ event.title }} </a>
</td> </td>
<td>
<span> {{ 'from_DATE' | translate:{DATE:(event.start_date | amDateFormat:'LL')} }} <span class="text-sm font-thin" translate>{{ 'to_date' }}</span> {{event.end_date | amDateFormat:'LL'}}</span> <td style="vertical-align:middle">
<br/>
<span ng-if="event.all_day == 'true'" translate>{{ 'all_day' }}</span> <!--One day event-->
<span ng-if="event.all_day == 'false'"> <span ng-if="(event.start_date | amDateFormat:'LL')==(event.end_date | amDateFormat:'LL')">
{{ 'from_TIME' | translate:{TIME:(event.start_date | amDateFormat:'LT')} }} {{ 'on_DATE' | translate:{DATE:(event.start_date | amDateFormat:'LL')} }}
<span class="text-sm font-thin" translate>{{ 'to_time' }}</span> <span ng-if="event.all_day == 'false'">
{{event.end_date | amDateFormat:'LT'}} {{ 'from_TIME' | translate:{TIME:(event.start_date | amDateFormat:'LT')} }}
</span> <span class="text-sm font-thin" translate>{{ 'to_time' }}</span>
{{event.end_date | amDateFormat:'LT'}}
</span>
</span>
<!--Multiple days envent-->
<span ng-if="(event.start_date | amDateFormat:'LL')!=(event.end_date | amDateFormat:'LL')">
{{'from_DATE' | translate:{DATE:(event.start_date | amDateFormat:'LL')} }}
{{'to_date' | translate}} {{event.end_date | amDateFormat:'LL'}}
<br ng-if="event.all_day == 'false'"/>
<span ng-if="event.all_day == 'false'">
{{ 'from_TIME' | translate:{TIME:(event.start_date | amDateFormat:'LT')} }}
<span class="text-sm font-thin" translate>{{ 'to_time' }}</span>
{{event.end_date | amDateFormat:'LT'}}
</span>
</span>
</td> </td>
<td>
<td style="vertical-align:middle">
<span class="ng-binding" ng-if="event.nb_total_places > 0">{{ event.nb_total_places - event.nb_free_places }} / {{ event.nb_total_places }}</span>
<span class="badge font-sbold cancelled" ng-if="event.nb_total_places < 0" translate>{{ 'cancelled' }}</span>
<span class="badge font-sbold" ng-if="!event.nb_total_places" translate>{{ 'free_entry' }}</span>
</td>
<td style="vertical-align:middle">
<div class="buttons"> <div class="buttons">
<button class="btn btn-default" ui-sref="app.admin.event_reservations({id: event.id})"> <button class="btn btn-default" ui-sref="app.admin.event_reservations({id: event.id})">
<i class="fa fa-bookmark"></i> {{ 'view_reservations' | translate }} <i class="fa fa-bookmark"></i> {{ 'view_reservations' | translate }}

View File

@ -78,7 +78,10 @@
</div> <!-- ./panel-body --> </div> <!-- ./panel-body -->
<div class="panel-footer no-padder"> <div class="panel-footer no-padder">
<input type="submit" ng-value="submitName" class="r-b btn-valid btn btn-warning btn-block p-lg btn-lg text-u-c" ng-disabled="eventForm.$invalid || event.category_id === null"/> <input type="submit"
ng-value="submitName"
class="r-b btn-valid btn btn-warning btn-block p-lg btn-lg text-u-c"
ng-disabled="eventForm.$invalid || event.category_id === null"/>
</div> </div>
</section> </section>
@ -194,14 +197,14 @@
<label translate>{{ 'start_time' }}</label> <label translate>{{ 'start_time' }}</label>
<div> <div>
<input type="hidden" name="event[start_time]" ng-value="event.start_time"> <input type="hidden" name="event[start_time]" ng-value="event.start_time">
<uib-timepicker ng-model="event.start_time" hour-step="1" minute-step="1" show-meridian="ismeridian"></uib-timepicker> <uib-timepicker ng-model="event.start_time" mousewheel="false" hour-step="1" minute-step="1" show-meridian="ismeridian"></uib-timepicker>
</div> </div>
</div> </div>
<div class="col-xs-6"> <div class="col-xs-6">
<label translate>{{ 'end_time' }}</label> <label translate>{{ 'end_time' }}</label>
<div> <div>
<input type="hidden" name="event[end_time]" ng-value="event.end_time"> <input type="hidden" name="event[end_time]" ng-value="event.end_time">
<uib-timepicker ng-model="event.end_time" hour-step="1" minute-step="1" show-meridian="ismeridian"></uib-timepicker> <uib-timepicker ng-model="event.end_time" mousewheel="false" hour-step="1" minute-step="1" show-meridian="ismeridian"></uib-timepicker>
</div> </div>
</div> </div>
</div> </div>

View File

@ -90,8 +90,15 @@ fr:
all_events: "Tous les évènements" all_events: "Tous les évènements"
passed_events: "Les évènements déjà passés" passed_events: "Les évènements déjà passés"
events_to_come: "Les évènements à venir" events_to_come: "Les évènements à venir"
from_DATE: "Du {{DATE}}" # angular interpolation prices: "Tarifs"
from_TIME: "De {{TIME}}" # angular interpolation on_DATE: "le {{DATE}}" # angular interpolation
from_DATE: "du {{DATE}}" # angular interpolation
from_TIME: "de {{TIME}}" # angular interpolation
booking: "Réservations"
sold_out: "Complet"
cancelled: "Annulé"
free_entry: "Entrée libre"
free_admission: "Entrée gratuite"
view_reservations: "Consulter les réservations" view_reservations: "Consulter les réservations"
categories: "Catégories" categories: "Catégories"
add_a_category: "Ajouter une catégorie" add_a_category: "Ajouter une catégorie"

View File

@ -55,7 +55,7 @@ fr:
add_an_event: "Ajouter un évènement" add_an_event: "Ajouter un évènement"
load_the_next_events: "Charger les évènements suivants ..." load_the_next_events: "Charger les évènements suivants ..."
no_passed_events: "Aucun évènement passé" no_passed_events: "Aucun évènement passé"
dates: "Dates :" dates: "Dates"
thank_you_your_payment_has_been_successfully_registered: "Merci. Votre paiement a bien été pris en compte !" thank_you_your_payment_has_been_successfully_registered: "Merci. Votre paiement a bien été pris en compte !"
surname: "Nom" surname: "Nom"
first_name: "Prénom" first_name: "Prénom"