Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
61 changes: 35 additions & 26 deletions static/css/_globals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,40 +76,49 @@ body {
width: $sponsor-width;
}


.sponsors{
.newLiner{
.sponsors {
gap: 15px 10px;
.newLiner {
width: 100%;
margin-bottom: 0;
height: 0;
}
.sponsor{
.big, .medium, .small{

width: 100%;
aspect-ratio: 1;
display: flex;
flex-direction: column;
align-content: center;
align-items: center;
justify-content: center;
}
.big{
max-width: 260px;
}
.medium{
max-width: 200px;
}
.small{
max-width: 140px;
}
}
.sponsor img {
}

.sponsors .big, .sponsors .medium, .sponsors .small, .sponsor_logo_holder{
width: 100%;
aspect-ratio: 1.2;
display: flex;
flex-direction: column;
align-content: center;
align-items: center;
justify-content: center;
}
.sponsors .big, .sponsor_logo_big{
max-width: 260px;
}
.sponsors .medium, .sponsor_logo_medium{
max-width: 200px;
}
.sponsors .small, .sponsor_logo_small{
max-width: 140px;
}
.sponsors .big img, .sponsors .medium img, .sponsors .small img, .sponsor_logo_holder img{
max-width: 95%;
max-height: 95%;
}
}

@media only screen and (max-width: 600px) {
.sponsors .big, .sponsor_logo_big{
max-width: 190px;
}
.sponsors .medium, .sponsor_logo_medium{
max-width: 160px;
}
.sponsors .small, .sponsor_logo_small{
max-width: 120px;
}
}

.btn-primary:hover {
background-color: $secondary;
Expand Down
7 changes: 2 additions & 5 deletions static/vauhtijuoksu2025/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -480,11 +480,8 @@ a:hover {
min-height: 180px;
p, h1, h2, h3, h4, h5, h6 {
width: 100%;
margin-bottom: 0;
}
img {
max-width: 200px;
max-height: 200px;
margin-bottom: 10px;
margin-top: 10px;
}
.cms-placeholder{
display: none;
Expand Down
Binary file added static/vauhtijuoksu2025/img/char/bmfm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions templates/vauhtijuoksu/plugins/sponsorLogoHolder.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% load cms_tags %}
<div class="sponsor_logo_holder sponsor_logo_{% if instance.size == "L" %}big{% elif instance.size == "S" %}small{% else %}medium{% endif %}">
{% for plugin in instance.child_plugin_instances %}
{% render_plugin plugin %}
{% endfor %}
</div>
2 changes: 1 addition & 1 deletion templates/vauhtijuoksu/plugins/tabletimetable.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</div>
{% for day in games %}
<div class="tttday">
{{ day.0.start_time|date:"w"|fiweekday }} {{ day.0.start_time|date:"j.n." }}
{{ day.1.start_time|date:"w"|fiweekday }} {{ day.1.start_time|date:"j.n." }}
</div>
{% endfor %}
</div>
Expand Down
14 changes: 13 additions & 1 deletion vj_cms/cms_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,23 @@
from django.utils import timezone

from vj_cms.client import VJClient
from vj_cms.models import GameInfo, Timetable, Donatebar, AnchorLink, TweakSettings
from vj_cms.models import GameInfo, Timetable, Donatebar, AnchorLink, TweakSettings, SponsorLogoHolder
from datetime import datetime

client = VJClient(settings.VJ_API_URL)

@plugin_pool.register_plugin
class SponsorLogoHolderPlugin(CMSPluginBase):
name = 'Sponsor Logo Holder'
model = SponsorLogoHolder
render_template = "vauhtijuoksu/plugins/sponsorLogoHolder.html"
cache = False
allow_children = True
def render(self, context, instance, placeholder):
context = super().render(context, instance, placeholder)
return context


@plugin_pool.register_plugin
class MobileSpeechbubblePlugin(CMSPluginBase):
name = 'Mobile Speechbubble'
Expand Down
26 changes: 26 additions & 0 deletions vj_cms/migrations/0010_sponsorlogoholder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 3.2.25 on 2025-04-17 14:09

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('cms', '0022_auto_20180620_1551'),
('vj_cms', '0009_delete_prioritymessages'),
]

operations = [
migrations.CreateModel(
name='SponsorLogoHolder',
fields=[
('cmsplugin_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='vj_cms_sponsorlogoholder', serialize=False, to='cms.cmsplugin')),
('size', models.CharField(default='M', max_length=1, verbose_name='Logo size (L/M/S)')),
],
options={
'abstract': False,
},
bases=('cms.cmsplugin',),
),
]
6 changes: 4 additions & 2 deletions vj_cms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from cms.models import CMSPlugin
from django.db import models


class GameInfo(models.Model):
# From API
api_id = models.UUIDField(primary_key=True)
Expand Down Expand Up @@ -67,4 +66,7 @@ class AnchorLink(CMSPlugin):
class TweakSettings(CMSPlugin):
message_duration = models.PositiveIntegerField('Carousel message duration (seconds)', default=8)
show_scrolldown_menu = models.BooleanField('Show scrolldown menu', default=False)
show_login = models.BooleanField('Show login', default=True)
show_login = models.BooleanField('Show login', default=True)

class SponsorLogoHolder(CMSPlugin):
size = models.CharField("Logo size (L/M/S)", default="M", max_length=1)
Loading