예제 #1
0
<br>

@if( isset($event->signup_opens) AND isset($event->signup_closes) )
	<?php 
$signupTimespan = new Zeropingheroes\LanagerCore\Helpers\Timespan($event->signup_opens, $event->signup_closes);
switch ($signupTimespan->status) {
    case 0:
        $signupStatusLabel = Label::info('Not Yet Open');
        $signupRelativeTime = 'Opening ' . $signupTimespan->start->getRelativeDate();
        break;
    case 1:
        $signupStatusLabel = Label::success('Open');
        $signupRelativeTime = 'Closing ' . $signupTimespan->end->getRelativeDate();
        break;
    case 2:
        $signupStatusLabel = Label::warning('Closed');
        $signupRelativeTime = 'Closed ' . $signupTimespan->end->getRelativeDate();
        break;
}
?>

	<div class="row">
		<div class="col-md-6">
			<h4>Signups {{ $signupStatusLabel }}</h4>
		</div>
		<div class="col-md-6">
			<h4 class="pull-right">{{ $signupRelativeTime }}</h4>
		</div>
	</div>
	<hr>
예제 #2
0
		{{ Table::open(array('class' => 'events-list')) }}
		{{ Table::headers('Name', 'Time', '', 'Type', 'Signups', '') }}
		<?php 
foreach ($events as $event) {
    $eventTimespan = new Zeropingheroes\LanagerCore\Helpers\Timespan($event->start, $event->end);
    if (isset($event->signup_opens)) {
        $signupTimespan = new Zeropingheroes\LanagerCore\Helpers\Timespan($event->signup_opens, $event->signup_closes);
        switch ($signupTimespan->status) {
            case 0:
                $signupTimespan->status = Label::info('Not Yet Open');
                break;
            case 1:
                $signupTimespan->status = Label::success('Open');
                break;
            case 2:
                $signupTimespan->status = Label::warning('Closed');
                break;
        }
        $signupStatus = $signupTimespan->status;
        $signupCount = count($event->users) . ' ' . str_plural('user', count($event->users));
    } else {
        $signupStatus = '';
        $signupCount = '';
    }
    $tableBody[] = array('name' => link_to_route('event.show', $event->name, $event->id), 'time' => $eventTimespan->naturalFormat(), 'status' => $eventTimespan->status == 1 ? Label::success('In Progress') : '', 'type' => isset($event->event_type->name) ? $event->event_type->name : '', 'signup-count' => $signupCount, 'signup-status' => $signupStatus);
}
?>
		{{ Table::body($tableBody) }}
		{{ Table::close() }}
	@else
		No events found!