Skip to content

Commit

Permalink
Merge branch 'master' of github.com:fykosak/webs
Browse files Browse the repository at this point in the history
  • Loading branch information
vanekm committed Nov 21, 2024
2 parents a99c442 + 22951f8 commit 3c555f3
Show file tree
Hide file tree
Showing 29 changed files with 1,011 additions and 2,071 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ coverage.html
www/fykos/videos
www/fykos/images/people
www/fykos/images/events
.vscode
.vscode
.cache
.config
.local
26 changes: 14 additions & 12 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ chooser := "sk --preview-window right:65% --preview 'just --show {} | (bat --lan
uid := `id -u`
gid := `id -g`
user := uid + ":" + gid
runner := "podman"
tag := "webs"
name := "webs"

Expand All @@ -19,13 +18,13 @@ choose:

# Build OCI image for webs
build:
{{ runner }} build \
podman build \
--file docker/Dockerfile \
--tag "{{ tag }}"

# Start container, optionally passing flags
start *FLAGS:
{{ runner }} run \
podman run \
--volume .:/var/www/html \
--volume ./docker/config/apache.conf:/etc/apache2/sites-available/000-default.conf \
--volume ./docker/config/php.ini:/usr/local/etc/php/php-local.ini \
Expand Down Expand Up @@ -54,22 +53,22 @@ start *FLAGS:

# Stop container
stop:
-{{ runner }} kill "{{ name }}" &> /dev/null
-{{ runner }} rm "{{ name }}" &> /dev/null
-podman kill "{{ name }}" &> /dev/null
-podman rm "{{ name }}" &> /dev/null

# Restart container
restart: stop (start "--detach")

# Ensure that container is running in the background
ensure:
@{{ runner }} ps \
@podman ps \
--filter "name={{ name }}" \
--filter "status=running" \
--noheading | grep "{{ name }}" &> /dev/null || just start --detach

# Execute provided commands in container
exec +CMD='bash': ensure
{{ runner }} exec \
podman exec \
--interactive \
--tty \
"{{ name }}" \
Expand Down Expand Up @@ -102,11 +101,14 @@ login:
echo "$1" >> "$file"
}
i "parameters:"
i " # FKSDB API endpoint"
i " fksdbDownloader:"
i " login: '$fksdblogin'"
i " password: '$fksdbpassword'"
i " url: 'https://db.fykos.cz/api/'"
i " gameApi:"
i " url: 'https://game.online.fyziklani.cz/public/api/results'"
i " login: ''"
i " password: ''"
i " problemManagerDownloader:"
i " login: ''"
i " password: ''"
Expand All @@ -115,7 +117,7 @@ login:
done
echo "config files appeared in $target"
# Delete containers an OCI images
[confirm("you sure you want to delete dev containers [y/N]")]
clean: stop
-{{ runner }} rmi {{ tag }}
## Delete containers an OCI images
#[confirm("you sure you want to delete dev containers [y/N]")]
#clean: stop
# -podman rmi {{ tag }}
6 changes: 3 additions & 3 deletions app/Components/ApiResults/ApiResultsComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ private function serialiseTeams(): array
{
$teams = [];
foreach ($this->downloader->download(new TeamsRequest($this->eventId)) as $team) {
if ($team['state'] === 'cancelled') {
if ($team['state'] === 'canceled') {
continue;
}

$members = [];
foreach ($team['members'] as $member) {
$members[] = [
'name' => $member['name'],
'schoolName' => $member['school']['name'] ?? '',
'countryIso' => $member['school']['countryIso'] ?? '',
'schoolName' => $member['school']['nameAbbrev'] ?? '',
'countryIso' => $member['school']['countryISO'] ?? '',
];
}
$teams[] = [
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 @@ -64,7 +64,7 @@
}
{foreach $members as $key => $member}
{varType App\Models\Downloader\TeamMemberModel $member}
{$member->name}{if !$iterator->isLast()}, {/if}
{$member->name|trim}{if !$iterator->isLast()},{/if}
{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'] !== 'ZZ'} <span
Expand Down
2 changes: 1 addition & 1 deletion app/Modules/Dsef/Core/templates/@layout.latte
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<div class="category">
<div class="category-title">{switch $language->value}{case cs}Organizátoři{default}Organized by{/switch}</div>
<div class="category-sponsors">
<a {switch $language->value}{case cs}href="https://www.fykos.cz/"{default}href="https://www.fykos.org/"{/switch} style="text-align: center">
<a {switch $language->value}{case cs}href="https://fykos.cz/"{default}href="https://fykos.org/"{/switch} style="text-align: center">
<img src="{$basePath}/images/logos/fykos_logo.png" alt="logo FYKOSu" style="max-width: 9rem">
</a>
<a {switch $language->value}{case cs}href="https://www.mff.cuni.cz/"{default}href="https://www.mff.cuni.cz/en"{/switch} style="text-align: center">
Expand Down
147 changes: 74 additions & 73 deletions app/Modules/Fof/Core/styles/sponsors.scss
Original file line number Diff line number Diff line change
@@ -1,73 +1,74 @@
.sponsors {
.category-title {
border-bottom: 2px solid black;
text-align: center;
padding-bottom: 1em;
margin: 0 auto;
width: 10em;
font-weight: bold;
}

.category-sponsors {
a {
display: block;
margin: 2em 0;
@include media-breakpoint-down(md) { // Needed for !important modifier
img {
max-width: 40% !important;
}
}
}
}

.category-full-line {
flex-basis: 100%;
}
}

@include media-breakpoint-up(md) {
.sponsors {
.inner-container {
display: flex;
flex-wrap: wrap;
}

.category {
display: flex;
flex-grow: 1;
margin: 1em;

.category-title {
border-right: 2px solid black;
border-bottom: none;
width: 7em;
text-align: right;
padding-right: 1em;
padding-bottom: 0;
display: flex;
align-items: center;
justify-content: flex-end;
flex-shrink: 0;
height: 3cm;
margin: 0;
}

.category-sponsors {
display: flex;
flex-wrap: wrap;
gap: 1cm 0;
justify-content: center;

a {
text-decoration: none;
margin: 0 1em;

display: flex;
align-items: center;

}
}

}
}
}
.sponsors {
.category-title {
border-bottom: 2px solid black;
text-align: center;
padding-bottom: 1em;
margin: 0 auto;
width: 10em;
font-weight: bold;
}

.category-sponsors {
a {
display: block;
margin: 2em 0;
@include media-breakpoint-down(md) { // Needed for !important modifier
img {
max-width: 40% !important;
}
}
}
}

.category-full-line {
flex-basis: 100%;
}
}

@include media-breakpoint-up(md) {
.sponsors {
.inner-container {
display: flex;
flex-wrap: wrap;
}

.category {
display: flex;
flex-grow: 1;
margin: 1em;

.category-title {
border-right: 2px solid black;
border-bottom: none;
width: 7em;
text-align: right;
padding-right: 1em;
padding-bottom: 0;
display: flex;
align-items: center;
justify-content: flex-end;
flex-shrink: 0;
min-height: 3cm;
height: inherit;
margin: 0;
}

.category-sponsors {
display: flex;
flex-wrap: wrap;
gap: 1cm 0;
justify-content: left;

a {
text-decoration: none;
margin: 0 1em;

display: flex;
align-items: center;

}
}

}
}
}
2 changes: 1 addition & 1 deletion app/Modules/Fof/Core/templates/@layout.latte
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
<div class="category">
<div class="category-title">{switch $language->value}{case cs}Organizátoři{default}Organized by{/switch}</div>
<div class="category-sponsors">
<a {switch $language->value}{case cs}href="https://www.fykos.cz/"{default}href="https://www.fykos.org/"{/switch} style="text-align: center">
<a {switch $language->value}{case cs}href="https://fykos.cz/"{default}href="https://fykos.org/"{/switch} style="text-align: center">
<img src="{$basePath}/images/logos/fykos_logo.png" alt="logo FYKOSu" style="max-width: 9rem">
</a>
<a {switch $language->value}{case cs}href="https://www.mff.cuni.cz/"{default}href="https://www.mff.cuni.cz/en"{/switch} style="text-align: center">
Expand Down
8 changes: 4 additions & 4 deletions app/Modules/Fof/DefaultModule/BasePresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ protected function getNavItems(): array
),
':Default:Accommodation:default',
);
//$items[] = new NavItem(
// new PageTitle($this->csen('Program', 'Schedule'), 'visible-sm-inline glyphicon glyphicon-info-sign'),
// ':Default:Schedule:default',
//);
$items[] = new NavItem(
new PageTitle($this->csen('Program', 'Schedule'), 'visible-sm-inline glyphicon glyphicon-info-sign'),
':Default:Schedule:default',
);

if (TeamsPresenter::isVisible($this->getNewestEvent())) {
$items[] = new NavItem(
Expand Down
Loading

0 comments on commit 3c555f3

Please sign in to comment.