|
|
|
@ -1,78 +1,15 @@
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use Carbon\Carbon;
|
|
|
|
|
use Illuminate\Support\Str;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Shows basic event infos and countdowns.
|
|
|
|
|
*
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
|
|
|
|
function EventConfig_countdown_page()
|
|
|
|
|
{
|
|
|
|
|
$config = config();
|
|
|
|
|
$name = $config->get('name', '');
|
|
|
|
|
/** @var Carbon $buildup */
|
|
|
|
|
$buildup = $config->get('buildup_start');
|
|
|
|
|
/** @var Carbon $start */
|
|
|
|
|
$start = $config->get('event_start');
|
|
|
|
|
/** @var Carbon $end */
|
|
|
|
|
$end = $config->get('event_end');
|
|
|
|
|
/** @var Carbon $teardown */
|
|
|
|
|
$teardown = $config->get('teardown_end');
|
|
|
|
|
$elements = [];
|
|
|
|
|
|
|
|
|
|
$elements[] = div('col-sm-12 text-center', [
|
|
|
|
|
heading(sprintf(
|
|
|
|
|
__('Welcome to the %s!'),
|
|
|
|
|
$name . ' <span class="icon-icon_angel"></span> ' . Str::upper(config('app_name'))
|
|
|
|
|
), 2)
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
if (!empty($buildup) && $buildup->greaterThan(new Carbon())) {
|
|
|
|
|
$elements[] = div('col-sm-3 text-center hidden-xs', [
|
|
|
|
|
heading(__('Buildup starts'), 4),
|
|
|
|
|
'<span class="moment-countdown text-big" data-timestamp="' . $buildup->getTimestamp() . '">%c</span>',
|
|
|
|
|
'<small>' . $buildup->format(__('Y-m-d')) . '</small>'
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!empty($start) && $start->greaterThan(new Carbon())) {
|
|
|
|
|
$elements[] = div('col-sm-3 text-center hidden-xs', [
|
|
|
|
|
heading(__('Event starts'), 4),
|
|
|
|
|
'<span class="moment-countdown text-big" data-timestamp="' . $start->getTimestamp() . '">%c</span>',
|
|
|
|
|
'<small>' . $start->format(__('Y-m-d')) . '</small>'
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!empty($end) && $end->greaterThan(new Carbon())) {
|
|
|
|
|
$elements[] = div('col-sm-3 text-center hidden-xs', [
|
|
|
|
|
heading(__('Event ends'), 4),
|
|
|
|
|
'<span class="moment-countdown text-big" data-timestamp="' . $end->getTimestamp() . '">%c</span>',
|
|
|
|
|
'<small>' . $end->format(__('Y-m-d')) . '</small>'
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!empty($teardown) && $teardown->greaterThan(new Carbon())) {
|
|
|
|
|
$elements[] = div('col-sm-3 text-center hidden-xs', [
|
|
|
|
|
heading(__('Teardown ends'), 4),
|
|
|
|
|
'<span class="moment-countdown text-big" data-timestamp="' . $teardown->getTimestamp() . '">%c</span>',
|
|
|
|
|
'<small>' . $teardown->format(__('Y-m-d')) . '</small>'
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return join('', $elements);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Render edit page for event config.
|
|
|
|
|
*
|
|
|
|
|
* @param string $event_name The event name
|
|
|
|
|
* @param string $event_welcome_msg The welcome message
|
|
|
|
|
* @param int $buildup_start_date unix time stamp
|
|
|
|
|
* @param int $event_start_date unix time stamp
|
|
|
|
|
* @param int $event_end_date unix time stamp
|
|
|
|
|
* @param int $teardown_end_date unix time stamp
|
|
|
|
|
* @param string $buildup_start_date Date (Y-M-D H:i)
|
|
|
|
|
* @param string $event_start_date Date (Y-M-D H:i)
|
|
|
|
|
* @param string $event_end_date Date (Y-M-D H:i)
|
|
|
|
|
* @param string $teardown_end_date Date (Y-M-D H:i)
|
|
|
|
|
*
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
|
|
|
|
function EventConfig_edit_view(
|
|
|
|
@ -97,12 +34,10 @@ function EventConfig_edit_view(
|
|
|
|
|
)
|
|
|
|
|
]),
|
|
|
|
|
div('col-md-3 col-xs-6', [
|
|
|
|
|
form_date('buildup_start_date', __('Buildup date'), $buildup_start_date),
|
|
|
|
|
form_date('event_start_date', __('Event start date'), $event_start_date)
|
|
|
|
|
]),
|
|
|
|
|
div('col-md-3 col-xs-6', [
|
|
|
|
|
form_date('teardown_end_date', __('Teardown end date'), $teardown_end_date),
|
|
|
|
|
form_date('event_end_date', __('Event end date'), $event_end_date)
|
|
|
|
|
form_datetime('buildup_start_date', __('Buildup date'), $buildup_start_date),
|
|
|
|
|
form_datetime('event_start_date', __('Event start date'), $event_start_date),
|
|
|
|
|
form_datetime('event_end_date', __('Event end date'), $event_end_date),
|
|
|
|
|
form_datetime('teardown_end_date', __('Teardown end date'), $teardown_end_date),
|
|
|
|
|
])
|
|
|
|
|
]),
|
|
|
|
|
div('row', [
|
|
|
|
|