diff --git a/api/v1/serializers/school.py b/api/v1/serializers/school.py index a84c745e..4f8cd318 100644 --- a/api/v1/serializers/school.py +++ b/api/v1/serializers/school.py @@ -55,6 +55,7 @@ class SchoolScheduleSerializer(serializers.ModelSerializer): 'start_at', 'schoolschedule_images', 'cover', + 'trial_lesson', ) read_only_fields = ( @@ -114,6 +115,7 @@ class SchoolScheduleSerializerImg(serializers.ModelSerializer): 'start_at', 'schoolschedule_images', 'cover', + 'trial_lesson', ) read_only_fields = ( diff --git a/api/v1/serializers/user.py b/api/v1/serializers/user.py index 888806d0..bbb5e6b5 100644 --- a/api/v1/serializers/user.py +++ b/api/v1/serializers/user.py @@ -42,6 +42,7 @@ class UserSerializer(serializers.ModelSerializer): 'photo', 'balance', 'show_in_mainpage', + 'trial_lesson', ) read_only_fields = ( diff --git a/apps/school/migrations/0021_schoolschedule_trial_lesson.py b/apps/school/migrations/0021_schoolschedule_trial_lesson.py new file mode 100644 index 00000000..293101a3 --- /dev/null +++ b/apps/school/migrations/0021_schoolschedule_trial_lesson.py @@ -0,0 +1,18 @@ +# Generated by Django 2.0.6 on 2018-08-27 21:58 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('school', '0020_auto_20180824_2132'), + ] + + operations = [ + migrations.AddField( + model_name='schoolschedule', + name='trial_lesson', + field=models.URLField(blank=True, default=''), + ), + ] diff --git a/apps/school/models.py b/apps/school/models.py index d1f70e68..a059172f 100644 --- a/apps/school/models.py +++ b/apps/school/models.py @@ -46,6 +46,7 @@ class SchoolSchedule(models.Model): null=True, blank=True, ) + trial_lesson = models.URLField(default='', blank=True) class Meta: ordering = ('weekday',) diff --git a/apps/school/templates/blocks/schedule_item.html b/apps/school/templates/blocks/schedule_item.html index c6be7c14..e4774339 100644 --- a/apps/school/templates/blocks/schedule_item.html +++ b/apps/school/templates/blocks/schedule_item.html @@ -17,6 +17,9 @@ {% else %} {% include './day_pay_btn.html' %} {% endif %} + {% if school_schedule.trial_lesson %} + Пробный урок + {% endif %} {% comment %} diff --git a/project/templates/blocks/popup_buy.html b/project/templates/blocks/popup_buy.html index d3080ec9..8f625f90 100644 --- a/project/templates/blocks/popup_buy.html +++ b/project/templates/blocks/popup_buy.html @@ -37,6 +37,11 @@ {% comment %} dont delete {% endcomment %} {{ school_schedule.title }} + + {% if school_schedule.trial_lesson %} + Пробный урок + {% endif %} + {{school_schedule.month_price}}р в мес. @@ -58,6 +63,11 @@ {% comment %} dont delete {% endcomment %} {{ school_schedule.title }} + + {% if school_schedule.trial_lesson %} + Пробный урок + {% endif %} + {{school_schedule.month_price}}р в мес. diff --git a/project/templates/blocks/teachers.html b/project/templates/blocks/teachers.html index 4cea46f3..492ca66d 100644 --- a/project/templates/blocks/teachers.html +++ b/project/templates/blocks/teachers.html @@ -25,7 +25,7 @@ {% endif %} {% if teacher.trial_lesson %} - ПРОБНЫЙ УРОК + ПРОБНЫЙ УРОК {% endif %}