remotes/origin/editis_13-01-19
gzbender 7 years ago
parent f592b7813f
commit f40e09e25b
  1. 2
      api/v1/serializers/config.py
  2. 18
      apps/config/migrations/0011_config_main_page_video_url.py
  3. 1
      apps/config/models.py
  4. 2
      project/templates/blocks/video.html

@ -22,6 +22,7 @@ class ConfigSerializer(serializers.ModelSerializer):
# MAIN_PAGE_TOP_IMAGE = serializers.ImageField(required=False, allow_null=True)
REFERRER_BONUS = serializers.IntegerField()
REFERRAL_BONUS = serializers.IntegerField()
MAIN_PAGE_VIDEO_URL = serializers.CharField(required=False)
class Meta:
model = Config
@ -41,6 +42,7 @@ class ConfigSerializer(serializers.ModelSerializer):
'MAIN_PAGE_TOP_IMAGE',
'REFERRER_BONUS',
'REFERRAL_BONUS',
'MAIN_PAGE_VIDEO_URL',
)
def get_SCHOOL_LOGO_IMAGE(self, config):

@ -0,0 +1,18 @@
# Generated by Django 2.0.7 on 2018-12-03 18:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('config', '0010_auto_20180820_0853'),
]
operations = [
migrations.AddField(
model_name='config',
name='MAIN_PAGE_VIDEO_URL',
field=models.URLField(default='https://www.youtube.com/embed/1w3amQGtQyc', max_length=126),
),
]

@ -19,6 +19,7 @@ class Config(models.Model):
MAIN_PAGE_TOP_IMAGE = models.ImageField(null=True, blank=True)
REFERRER_BONUS = models.IntegerField(default=10)
REFERRAL_BONUS = models.IntegerField(default=10)
MAIN_PAGE_VIDEO_URL = models.URLField(max_length=126, default='https://www.youtube.com/embed/1w3amQGtQyc')
def save(self, *args, **kwargs):
self.pk = 1

@ -3,7 +3,7 @@
<iframe class="main-video" style="display: inline-block;"
width="100%"
height="360"
src="https://www.youtube.com/embed/1w3amQGtQyc"
src="{{ config.MAIN_PAGE_VIDEO_URL }}"
frameborder="0"
allow="autoplay; encrypted-media"
allowfullscreen

Loading…
Cancel
Save