-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix live stream size on s on medium 16:9 screens; Add live info section
- Loading branch information
Showing
12 changed files
with
238 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
use Illuminate\Http\Request; | ||
use LaravelLocalization; | ||
use App\Schedule; | ||
|
||
class CurrentEventController extends Controller { | ||
|
||
private $now; | ||
|
||
private function getCurr($events) { | ||
$coll = $events -> where('hour', '<=', $this->now); | ||
$last = $coll -> pop(); | ||
$prevToLast = $coll -> last(); | ||
while(!is_null($last) && $coll -> isNotEmpty() && $last -> hour == $prevToLast -> hour) { | ||
if($last -> type != "general" && $prevToLast -> type == "general") { | ||
$coll -> pop(); | ||
$coll -> push($last); | ||
} | ||
$last = $coll -> pop(); | ||
$prevToLast = $coll -> last(); | ||
} | ||
return $last; | ||
} | ||
|
||
private function getNext($events) { | ||
$next = $events -> where('hour', '>', $this->now) -> whereIn('type', ['talk', 'performance']) -> first(); | ||
return $next; | ||
} | ||
|
||
public function __construct() { | ||
$this->now = '15:35';#date('H:i'); | ||
} | ||
|
||
public function index(Request $request) { | ||
|
||
if(env('SHOW_HIDDEN_ENTRIES', false) == true) { | ||
$where = []; | ||
} else { | ||
$where = [['visible', true]]; | ||
} | ||
|
||
$events = Schedule :: where(array_merge($where, [['type', '!=', 'workshop']])) | ||
-> orderBy('hour', 'asc') | ||
-> get(); | ||
|
||
$curr = $this->getCurr($events); | ||
$next = $this->getNext($events); | ||
return view('api/currentEvent', compact('curr', 'next')); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{% if curr is not null or next is not null %} | ||
<div class="container-fluid"> | ||
<div class="row"> | ||
{% if curr is not null %} | ||
{% if next is not null %} | ||
<div class="col col-6"> | ||
<h4>{{ trans('general.home.live.curr') }}</h4> | ||
<h5>{{ curr.event_title | raw }}</h5> | ||
<h6>{{ curr.event_prev | markdown }}</h6> | ||
</div> | ||
{% else %} | ||
<div class="col col-12"> | ||
<h4>{{ trans('general.home.live.curr') }}</h4> | ||
<h5>{{ curr.event_title | raw }}</h5> | ||
{{ curr.event_prev | markdown }} | ||
</div> | ||
{% endif %} | ||
{% endif %} | ||
|
||
{% if next is not null %} | ||
{% if curr is not null %} | ||
<div class="col col-6"> | ||
<h4>{{ trans('general.home.live.next') }}</h4> | ||
<h5>{{ next.event_title | raw }}</h5> | ||
<h6>{{ next.event_prev | markdown }}</h6> | ||
</div> | ||
{% else %} | ||
<div class="col col-12"> | ||
<h4>{{ trans('general.home.live.next') }}</h4> | ||
<h5>{{ next.event_title | raw }}</h5> | ||
<h6>{{ next.event_prev | markdown }}</h6> | ||
</div> | ||
{% endif %} | ||
{% endif %} | ||
</div> | ||
</div> | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters