Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vyfuk events #83

Merged
merged 13 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/Components/Navigation/Navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public function addNavItem(NavItem $item): void
public static function mapLangToIcon(Language $lang): string
{
return match ($lang) {
Language::en => 'flag-icon flag-icon-us',
Language::cs => 'flag-icon flag-icon-cz',
Language::en => 'fi fi-us',
Language::cs => 'fi fi-cz',
};
}
}
1 change: 0 additions & 1 deletion app/Components/Results/results.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { useState } from 'react';
import ReactDOM from 'react-dom';
import './style.scss';
import { TranslatorProvider, useTranslator } from './resultsTranslator';
import { co } from '@fullcalendar/core/internal-common';

interface Contestant {
contestant: {
Expand Down
2 changes: 1 addition & 1 deletion app/Components/ResultsPanel/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const CategoryColumn: React.FC<{
<div className="team-name">{mappedTeams[p.team.teamId]?.name ?? p.team.name}</div>
<div className="flags">
{[...new Set(mappedTeams[p.team.teamId]?.participants.map(p => p.countryIso))].filter(iso => iso !== '').map(iso =>
<span className={`flag-icon flag-icon-${iso?.toLowerCase()}`} />,
<span className={`fi fi-${iso?.toLowerCase()}`} />,
)}
</div>
</td>
Expand Down
2 changes: 1 addition & 1 deletion app/Components/ResultsPanel/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

.flags {
flex-shrink: 0;
.flag-icon {
.fi {
margin-left: .3rem;

}
Expand Down
2 changes: 1 addition & 1 deletion app/Components/TeamList/teamList.latte
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
{do $inSchool++}
{if $iterator->isLast() || (!is_null($members[$key + 1]) && isset($member->school) && isset($members[$key + 1]->school) && $member->school['schoolId'] != $members[$key + 1]->school['schoolId'])}
<span class="text-muted"> ({if $inSchool > 1}{$inSchool}&nbsp;&times;&nbsp;{/if}{$member->school['nameAbbrev']??''}{if isset($member->school) && $member->school['countryISO'] !== ''} <span
class="flag-icon flag-icon-{$member->school['countryISO']??'zz'|lower}"></span>{/if})</span>
class="fi fi-{$member->school['countryISO']??'zz'|lower}"></span>{/if})</span>
{do $inSchool = 0}
{/if}
{if !$iterator->isLast()}, {/if}
Expand Down
4 changes: 2 additions & 2 deletions app/Components/TeamResults/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
padding-left: 10px;
}

.flag-icon {
.fi {
margin-right: 5px; /* Space between flag and country code */
border: 1px solid black;
}
Expand Down Expand Up @@ -94,7 +94,7 @@
// margin-bottom: 20px; /* This will give a larger gap after the "One member teams only" checkbox. */
// }

// .flag-icon {
// .fi {
// margin-right: 5px; /* Space between flag and country name */
// }

Expand Down
2 changes: 1 addition & 1 deletion app/Components/TeamResults/teamResults.latte
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
{if $iterator->isLast() || (!is_null($members[$key + 1]) && isset($member->school) && isset($members[$key + 1]->school) && $member->school['schoolId'] != $members[$key + 1]->school['schoolId'])}
{$member->name|trim}
<span class="text-muted"> ({if $inSchool > 1}{$inSchool}&nbsp;&times;&nbsp;{/if}{$member->school['nameAbbrev']??$notAStudentText}{if isset($member->school) && $member->school['countryISO'] !== null}
<span class="flag-icon flag-icon-{$member->school['countryISO']??'zz'|lower}"></span>{/if})</span>{if !$iterator->isLast()},{/if}
<span class="fi fi-{$member->school['countryISO']??'zz'|lower}"></span>{/if})</span>{if !$iterator->isLast()},{/if}
{do $inSchool = 0}
{else}
{$member->name|trim}{if !$iterator->isLast()},{/if}
Expand Down
4 changes: 2 additions & 2 deletions app/Modules/Dsef/Core/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ $navbar-dark-hover-color: $text-on-primary;


@import "node_modules/bootstrap/scss/bootstrap";
$flag-icon-css-path: '/node_modules/flag-icon-css/flags';
@import '../../../../../node_modules/flag-icon-css/sass/flag-icon';
$flag-icons-path: '/node_modules/flag-icons/flags';
@import "../../../../../node_modules/flag-icons/sass/flag-icons";


@import "./../../../Fol/Core/styles/layout";
Expand Down
4 changes: 2 additions & 2 deletions app/Modules/Fof/Core/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ $navbar-dark-hover-color: $text-on-primary;


@import "node_modules/bootstrap/scss/bootstrap";
$flag-icon-css-path: '/node_modules/flag-icon-css/flags';
@import '../../../../../node_modules/flag-icon-css/sass/flag-icon';
$flag-icons-path: '/node_modules/flag-icons/flags';
@import "../../../../../node_modules/flag-icons/sass/flag-icons";


@import "./../../../Fol/Core/styles/layout";
Expand Down
4 changes: 2 additions & 2 deletions app/Modules/Fol/Core/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ $navbar-dark-hover-color: $text-on-primary;


@import "node_modules/bootstrap/scss/bootstrap";
$flag-icon-css-path: '/node_modules/flag-icon-css/flags';
@import 'node_modules/flag-icon-css/sass/flag-icon';
$flag-icons-path: '/node_modules/flag-icons/flags';
@import "../../../../../node_modules/flag-icons/sass/flag-icons";


@import "./layout";
Expand Down
30 changes: 15 additions & 15 deletions app/Modules/Fol/DefaultModule/templates/Default/default.latte
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@
<div class="legends-year">2023</div>
<div class="legends-item">
<div>
<span class="flag-icon flag-icon-sg"></span>
<span class="fi fi-sg"></span>
Puddle
</div>
<div class="members">
Expand All @@ -496,7 +496,7 @@
<div class="legends-year">2022</div>
<div class="legends-item">
<div>
<span class="flag-icon flag-icon-us"></span>
<span class="fi fi-us"></span>
S.I.M.P.S.
</div>
<div class="members">
Expand All @@ -508,8 +508,8 @@
<div class="legends-year">2021</div>
<div class="legends-item">
<div>
<span class="flag-icon flag-icon-jp"></span>
<span class="flag-icon flag-icon-us"></span>
<span class="fi fi-jp"></span>
<span class="fi fi-us"></span>
Metaphysical Brawlers
</div>
<div class="members">
Expand All @@ -521,10 +521,10 @@
<div class="legends-year">2020</div>
<div class="legends-item">
<div>
<span class="flag-icon flag-icon-hk"></span>
<span class="flag-icon flag-icon-jp"></span>
<span class="flag-icon flag-icon-us"></span>
<span class="flag-icon flag-icon-vn"></span>
<span class="fi fi-hk"></span>
<span class="fi fi-jp"></span>
<span class="fi fi-us"></span>
<span class="fi fi-vn"></span>
The Large Noobs Collider
</div>
<div class="members">
Expand All @@ -538,7 +538,7 @@
<div class="legends-year">2019</div>
<div class="legends-item" n:syntax="off">
<div>
<span class="flag-icon flag-icon-us"></span>
<span class="fi fi-us"></span>
Temple of Next
</div>
<div class="members">
Expand All @@ -550,8 +550,8 @@
<div class="legends-year">2018</div>
<div class="legends-item">
<div>
<span class="flag-icon flag-icon-ch"></span>
<span class="flag-icon flag-icon-cz"></span>
<span class="fi fi-ch"></span>
<span class="fi fi-cz"></span>
NOFY066
</div>
<div class="members">
Expand All @@ -563,9 +563,9 @@
<div class="legends-year">2017</div>
<div class="legends-item">
<div>
<span class="flag-icon flag-icon-at"></span>
<span class="flag-icon flag-icon-cz"></span>
<span class="flag-icon flag-icon-sk"></span>
<span class="fi fi-at"></span>
<span class="fi fi-cz"></span>
<span class="fi fi-sk"></span>
FtáKopySk -fks.sk
</div>
<div class="members">
Expand All @@ -577,7 +577,7 @@
<div class="legends-year">2016</div>
<div class="legends-item">
<div>
<span class="flag-icon flag-icon-in"></span>
<span class="fi fi-in"></span>
Castrambe
</div>
<div class="members">
Expand Down
4 changes: 2 additions & 2 deletions app/Modules/Fykos/Core/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ $navbar-dark-color: $text-on-primary;
$navbar-dark-hover-color: $text-on-primary;

@import "node_modules/bootstrap/scss/bootstrap";
$flag-icon-css-path: '/node_modules/flag-icon-css/flags';
@import '../../../../../node_modules/flag-icon-css/sass/flag-icon';
$flag-icons-path: '/node_modules/flag-icons/flags';
@import "../../../../../node_modules/flag-icons/sass/flag-icons";

// @import '../../../../Models/OldFykos/css/cssAll';

Expand Down
2 changes: 0 additions & 2 deletions app/Modules/Fykos/DefaultModule/ResultsPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,4 @@ public function renderDefault(): void
$this->template->contest = $this->getContest();
$this->template->results = $this->downloader->download(new SeriesResultsRequest(1, $year));
}


}
5 changes: 0 additions & 5 deletions app/Modules/Vyfuk/Core/styles/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ body {
background-color: black;
}

.btn-primary {
@extend .btn-primary;
color: $text-on-primary;
}

.btn-outline {
@extend .btn-outline;
text-align: center;
Expand Down
23 changes: 18 additions & 5 deletions app/Modules/Vyfuk/Core/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ $text-on-primary: white;
$text-dimmed: #CCCCCC;

$page-width: 77rem;

$min-contrast-ratio: 3;
$base-font-size: 18px;

// Use the following font weights.
Expand All @@ -32,17 +32,30 @@ $navbar-dark-hover-color: $text-dimmed;

@import "node_modules/bootstrap/scss/bootstrap";
@import 'bootstrap-icons/font/bootstrap-icons.scss';
$flag-icon-css-path: '/node_modules/flag-icon-css/flags';
@import '../../../../../node_modules/flag-icon-css/sass/flag-icon';
$flag-icons-path: '/node_modules/flag-icons/flags';
@import "../../../../../node_modules/flag-icons/sass/flag-icons";
@import "./../../../Fof/Core/styles/sponsors";

@import "./layout";
@import "./titlepage";
@import "./navigation";
@import "./organizers";
@import "./other.scss";

// @import "./../../../Fol/Core/styles/layout";
// @import "./../../../Fol/Core/styles/titlepage";
// @import "./../../../Fol/Core/styles/navigation";

// @import "./../../../Fof/DefaultModule/styles/organisers";
// @import "./../../../Fof/DefaultModule/styles/rules";
// @import "./../../../Fof/DefaultModule/styles/timeline";


// @import '../../../../Components/ResultsPanel/styles';
// @import '../../../../Components/UpperHomePrague/styles';
// @import '../../../../Components/TeamResults/styles';

// @import "node_modules/@fortawesome/fontawesome-free/scss/fontawesome";
// @import "node_modules/@fortawesome/fontawesome-free/scss/solid";
// @import '../../../../Models/OldFykos/css/cssAll';
Headary marked this conversation as resolved.
Show resolved Hide resolved

@import '../../../../Components/Problem/problem';
@import '../../../../Components/Problem/vyfuk';
Expand Down
9 changes: 9 additions & 0 deletions app/Modules/Vyfuk/Core/styles/other.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.event-img-box {
text-align: center;
}

.event-img {
max-width: 100%;
max-height: 300px;
padding: 10px;
}
58 changes: 4 additions & 54 deletions app/Modules/Vyfuk/DefaultModule/EventsPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@

use App\Models\Downloader\EventService;
use DateTime;
use Exception;
use Nette\Application\AbortException;
use Nette\Application\BadRequestException;
use Nette\Application\Responses\CallbackResponse;
use Nette\Caching\Cache;
use Nette\Caching\Storage;

Expand Down Expand Up @@ -49,59 +45,13 @@ public function renderDetail(int $event): void
$this->template->participants = implode(', ', $array);
}

public function renderDefault(?int $typeID = null): void
public function renderTabor(): void
{
$eventTypes = [
10 => 'tábor',
12 => 'Podzimní setkání',
11 => 'Jarní setkání',
15 => 'Kyberkoncil'
];
$ids = array_keys($eventTypes);
$selectedId = in_array($typeID, $ids) ? $typeID : null;

$events = $this->eventService->getEvents($selectedId ? [$selectedId] : $ids);
$this->template->eventTypes = $eventTypes;
$this->template->selected = $selectedId;
$this->template->events = array_reverse($events);
}

/**
* @throws AbortException
* @throws BadRequestException
* @throws \Throwable
*/
public function actionGetRawCalendar(): void
{
$calendar = $this->loadCalendar();
if (!$calendar) {
$this->error('', 503);
} else {
$this->sendResponse(new CallbackResponse(function ($request, $response) use ($calendar) {
$response->setHeader('Content-Type', 'text/calendar');
echo ($calendar);
}));
}
$this->template->events = array_reverse($this->eventService->getEvents([10]));
}

/**
* @throws \Throwable
*/
private function loadCalendar(): string
public function renderSetkani(): void
{
return $this->cache->load(
'vyfuk.calender',
function (&$dependencies): string {
$dependencies[Cache::Expire] = time() + 24 * 60 * 60;
$curl = curl_init('https://drive.vyfuk.org/remote.php/dav/public-calendars/tLnfCNLzypBHHeEb?export');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($curl);
curl_close($curl);
if (curl_getinfo($curl)['http_code'] != 200) {
throw new Exception('Vyfuk calendar failed to be downloaded');
}
return $res;
}
);
$this->template->events = array_reverse($this->eventService->getEvents([11, 12]));
}
}
30 changes: 0 additions & 30 deletions app/Modules/Vyfuk/DefaultModule/scripts/calendar-vyfuk.js

This file was deleted.

11 changes: 0 additions & 11 deletions app/Modules/Vyfuk/DefaultModule/templates/Events/calendar.latte

This file was deleted.

Loading
Loading