Skip to content

Commit

Permalink
Merge branch 'master' into nicer-results-filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
vanekm committed Nov 17, 2023
2 parents e3ee814 + d78101d commit 95b26db
Show file tree
Hide file tree
Showing 84 changed files with 2,082 additions and 559 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ You can use `npm run dev` to automatically rebuild files when they are changed.
Installing Prerequisites
1. open wsl
2. if not installed, install `apache2` (`sudo apt install apache2`)
3. if not installed, install `php8.1` (`sudo apt install php8.1`)
3. if not installed, install `php8.1` (`sudo apt install php8.1`, you might also need `php8.1-dom` and `php8.1-soap`)
4. if not installed, install `mysql` (google how to do that - e.g. via `sudo apt install mysql-server`)
5. if not installed, install `composer` (google how to do that - sudo apt install composer does not work as of July 2022)
6. if not installed, install `node`, version at least 16. Alternatively, install nvm and then `nvm use 16`
Expand Down
6 changes: 3 additions & 3 deletions app/Components/ApiResults/ApiResultsComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ public function serialiseResults(): array
}
if (!$data['times']['visible']) {
// results are hidden
$data["submits"] = null;
foreach ($data["teams"] as &$team) {
$team["bonus"] = null;
$data['submits'] = null;
foreach ($data['teams'] as &$team) {
$team['bonus'] = null;
}
}
return $data;
Expand Down
2 changes: 1 addition & 1 deletion app/Components/Map/MapComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function processTeams(): void
$this->teamCountries = [];

foreach ($this->serviceTeam->getTeams($this->forEventId) as $team) {
if (!in_array($team->status, ["participated", "disqualified", "applied", "pending", "approved"])) {
if (!in_array($team->status, ['participated', 'disqualified', 'applied', 'pending', 'approved'])) {
continue;
}
$this->teamCount++;
Expand Down
2 changes: 1 addition & 1 deletion app/Components/PdfGallery/PdfGalleryControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static function getPdfs($path, $wwwDir): array
$wwwPath = substr($file->getPathname(), strlen($wwwDir));
$pdfs[] = [
'src' => $wwwPath,
'name' => $file->getBasename(".pdf"),
'name' => $file->getBasename('.pdf'),
];
}

Expand Down
2 changes: 1 addition & 1 deletion app/Components/UpperHomePrague/UpperHomePrague.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function render(): void
{
$this->template->lang = $this->getPresenter()->lang;
$this->template->gamePhaseCalculator = $this->gamePhaseCalculator;
$this->template->render(__DIR__ . DIRECTORY_SEPARATOR . "upperHomePrague.latte");
$this->template->render(__DIR__ . DIRECTORY_SEPARATOR . 'upperHomePrague.latte');
}

protected function createComponentCountdown(): CountdownComponent
Expand Down
6 changes: 3 additions & 3 deletions app/Models/Game/Connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ public function getResults(): array
return $this->getCache()->load('results', function (?array &$dependencies): array {
$context = null;
if ($this->httpAuthUser) {
$auth = base64_encode($this->httpAuthUser . ":" . $this->httpAuthPassword);
$auth = base64_encode($this->httpAuthUser . ':' . $this->httpAuthPassword);
$context = stream_context_create([
"http" => [
"header" => "Authorization: Basic $auth"
'http' => [
'header' => "Authorization: Basic $auth"
]
]);
}
Expand Down
2 changes: 1 addition & 1 deletion app/Models/GamePhaseCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function isGame(int $period = self::NOW): bool
return $this->checkEvent(
$period,
$this->getGameBegin(),
$this->getGameBegin()->add(new \DateInterval("PT3H")),
$this->getGameBegin()->add(new \DateInterval('PT3H')),
);
}

Expand Down
2 changes: 1 addition & 1 deletion app/Modules/Core/BasePresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected function localize(): void
{
// Lang is null in error presenter because no rote rule was applied
if (!isset($this->lang) || $this->lang == null) {
$this->lang = "en"; // todo guess language by domain
$this->lang = 'en'; // todo guess language by domain
}

$this->translator->setLang($this->lang);
Expand Down
8 changes: 4 additions & 4 deletions app/Modules/Dsef/ArchiveModule/BasePresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected function getEvent(): ModelEvent
$year = $this->eventYear;
$month = $this->eventMonth;
$events = $this->serviceEvent->getEventsByYear(
[$this->context->getParameters()["eventTypeId"]],
[$this->context->getParameters()['eventTypeId']],
intval($year)
);
$events = array_filter($events, function ($event) use ($month) {
Expand Down Expand Up @@ -99,20 +99,20 @@ protected function getNavItems(): array
$items = [];
if (RegistrationPresenter::isVisible($this->gamePhaseCalculator)) {
$items[] = new NavItem(
new PageTitle(null, "Registrace", 'visible-sm-inline glyphicon glyphicon-info-sign'), // TODO
new PageTitle(null, 'Registrace', 'visible-sm-inline glyphicon glyphicon-info-sign'), // TODO
':Default:Registration:',
);
}

if (CurrentPresenter::isVisible($this->gamePhaseCalculator)) {
$items[] = new NavItem(
new PageTitle(null, "Aktuální ročník", 'visible-sm-inline glyphicon glyphicon-info-sign'), // TODO
new PageTitle(null, 'Aktuální ročník', 'visible-sm-inline glyphicon glyphicon-info-sign'), // TODO
':Default:Current:',
);
}

$items[] = new NavItem(
new PageTitle(null, "Archiv", 'visible-sm-inline glyphicon glyphicon-info-sign'), // TODO
new PageTitle(null, 'Archiv', 'visible-sm-inline glyphicon glyphicon-info-sign'), // TODO
':Default:Archive:default',
);
return $items;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,4 +477,4 @@
aeronomii nebo výzkumu ionosféry.
</p>
</section>
</div>
</div>
Loading

0 comments on commit 95b26db

Please sign in to comment.