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

pull request modification

Modification as requested for the pull request.
This commit is contained in:
siteswapjuggler 2017-09-24 15:12:46 +02:00
parent 52071c7b83
commit 37bdfcb96f
5 changed files with 40 additions and 23 deletions

View File

@ -170,27 +170,29 @@ Application.Filters.filter "trainingReservationsFilter", [ ->
Application.Filters.filter "eventsReservationsFilter", [ ->
(elements, 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 = []
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()
element.end_at = element.availability.end_at if angular.isUndefined(element.end_at)
switch selectedScope
when "future"
if new Date(element.end_at) >= new Date
filteredElements.push(element)
when "future_asc"
if new Date(element.end_at) >= new Date
filteredElements.push(element)
when "passed"
if new Date(element.end_at) <= new Date
filteredElements.push(element)
else
return []
switch selectedScope
when "future_asc"
filteredElements.reverse()
else
filteredElements
else
elements
]
Application.Filters.filter "groupFilter", [ ->

View File

@ -1,8 +1,9 @@
<div class="col-md-6 m-b m-t">
<select ng-model="selectedTimezone" class="form-control">
<option value="" translate>{{ 'events_to_come' }}</option>
<option value="" translate>{{ 'all_events' }}</option>
<option value="passed" translate>{{ 'passed_events' }}</option>
<option value="all" translate>{{ 'all_events' }}</option>
<option value="future" translate>{{ 'events_to_come' }}</option>
<option value="future_asc" translate>{{ 'events_to_come_asc' }}</option>
</select>
</div>

View File

@ -101,8 +101,15 @@ en:
all_events: "All events"
passed_events: "Passed events"
events_to_come: "Events to come"
from_DATE: "From {{DATE}}" # angular interpolation
from_TIME: "From {{TIME}}" # angular interpolation
events_to_come_asc: "Events to come | chronological order"
on_DATE: "on {{DATE}}" # angular interpolation
from_DATE: "from {{DATE}}" # angular interpolation
from_TIME: "from {{TIME}}" # angular interpolation
booking: "Booking"
sold_out: "Sold out"
cancelled: "Cancelled"
free_entry: "Free entry"
free_admission: "Free admission"
view_reservations: "View reservations"
categories: "Categories"
add_a_category: "Add a category"

View File

@ -101,7 +101,7 @@ fr:
all_events: "Tous les évènements"
passed_events: "Les évènements déjà passés"
events_to_come: "Les évènements à venir"
prices: "Tarifs"
events_to_come_asc: "Les évènements à venir | ordre chronologique"
on_DATE: "le {{DATE}}" # angular interpolation
from_DATE: "du {{DATE}}" # angular interpolation
from_TIME: "de {{TIME}}" # angular interpolation

View File

@ -101,8 +101,15 @@ pt:
all_events: "Todos eventos"
passed_events: "Eventos anteriores"
events_to_come: "Eventos futuros"
events_to_come_asc: "Events to come | chronological order" #translation_missing
on_DATE: "on {{DATE}}" # angular interpolation #translation_missing
from_DATE: "Em {{DATE}}" # angular interpolation
from_TIME: "Ás {{TIME}}" # angular interpolation
booking: "Booking" #translation_missing
sold_out: "Sold out" #translation_missing
cancelled: "Cancelled" #translation_missing
free_entry: "Free entry" #translation_missing
free_admission: "Free admission" #translation_missing
view_reservations: "Ver reservas"
categories: "Categorias"
add_a_category: "Adicionar categoria"