remotes/origin/editis_13-01-19
gzbender 7 years ago
parent a4fe58f74a
commit fd989bcb86
  1. 4
      apps/school/templates/blocks/schedule.html
  2. 2
      apps/school/templates/school/livelessons_list.html
  3. 3
      apps/school/templates/summer/schedule_purchased.html
  4. 20
      apps/user/migrations/0027_user_gallery.py
  5. 4
      apps/user/models.py
  6. 8
      apps/user/templates/user/edit_gallery.html
  7. 7
      apps/user/templates/user/profile.html
  8. 5
      apps/user/views.py
  9. 4
      project/templates/lilcity/index.html
  10. 3
      project/urls.py
  11. 15
      web/src/components/blocks/BlockImages.vue
  12. 6
      web/src/js/app.js
  13. 5
      web/src/sass/_common.sass

@ -10,7 +10,9 @@
{% endfor %}
</div>
<div class="timing__foot">
{# include './pay_btn.html' #}
{% if not is_purchased and not is_purchased_future %}
<a data-popup=".js-popup-buy" class="btn" href="#">Получить доступ на месяц</a>
{% endif %}
<a target="_blank" class="timing__print" href="{% url 'school:school_schedules-print' %}">Распечатать расписание
<span class="bold">чтобы не забыть</span>
<svg class="icon icon-print">

@ -1,4 +1,4 @@
{% extends "templates/lilcity/index.html" %} {% load jsonify from jsonify_queryset %} {% load static %} {% block content %}
{% extends "templates/lilcity/index.html" %}{% load static %} {% block content %}
<div class="main" style="background-image: url({% static 'img/bg-1.jpg' %});">
<div class="main__center center">
<div class="main__title">Уроки онлайн-школы LilCity</div>

@ -22,11 +22,12 @@
<div class="casing__col">
<div class="casing__timing timing js-timing">
<div class="timing__week">
<div class="subtitle2">Новые уроки</div>
{% for school_schedule in school_schedules_sorted %}
{% include 'blocks/schedule_item.html' with school_schedule=school_schedule live_lesson=school_schedule.current_live_lesson %}
{% endfor %}
{% if prev_live_lessons_exists %}
<hr>
<div class="subtitle2">Прошедшие уроки</div>
{% for live_lesson in prev_live_lessons %}
{% if live_lesson.school_schedule and live_lesson.title %}
{% include 'blocks/schedule_item.html' with school_schedule=live_lesson.school_schedule live_lesson=live_lesson %}

@ -0,0 +1,20 @@
# Generated by Django 2.0.6 on 2018-11-16 16:36
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('content', '0022_auto_20180815_2129'),
('user', '0026_user_site'),
]
operations = [
migrations.AddField(
model_name='user',
name='gallery',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='content.Gallery', verbose_name='Галерея'),
),
]

@ -83,6 +83,10 @@ class User(AbstractUser):
allow_unicode=True, null=True, blank=True,
max_length=100, unique=True, db_index=True,
)
gallery = models.ForeignKey(
'content.Gallery', on_delete=models.CASCADE,
verbose_name='Галерея', null=True, blank=True,
)
objects = UserManager()

@ -0,0 +1,8 @@
{% block pre_app_js %}
window.LIL_STORE.components['block-images'] = '../components/BlockImages';
{% endblock pre_app_js %}
{% block content %}
{% endblock %}

@ -73,6 +73,7 @@
<span class="mobile-hide">КУРСЫ</span>
</button>
{% endif %}
<button class="tabs__btn js-tabs-btn">МОИ РАБОТЫ</button>
</div>
<div class="tabs__container">
<div class="tabs__item js-tabs-item" style="display: block;">
@ -138,6 +139,12 @@
</div>
</div>
{% endif %}
<div class="tabs__item js-tabs-item">
<a class="btn btn_md btn_stroke" href="{% url 'user-gallery-edit' %}">Редактировать</a>
<div>
{% include 'content/blocks/gallery.html' with content=user.gallery %}
</div>
</div>
</div>
</div>
</div>

@ -314,3 +314,8 @@ class BonusHistoryView(TemplateView):
'Перейдите по ссылке и получите скидку %d%% на первую покупку' \
% (request.user.get_full_name(), config.REFERRAL_BONUS)
return self.render_to_response(context)
@method_decorator(login_required, name='dispatch')
class UserGalleryEditView(TemplateView):
template_name = 'user/edit_gallery.html'

@ -154,7 +154,7 @@
{% include "templates/blocks/popup_capture_email.html" %}
</div>
{% include 'templates/blocks/lil_store_js.html' %}
{% block pre_app_js %}{% endblock pre_app_js %}
<script type="text/javascript" src={% static "app.js" %}></script>
<script>
var schoolDiscount = parseFloat({{ config.SERVICE_DISCOUNT }});
@ -165,6 +165,6 @@
(function(w, d, s, h, id) { w.roistatProjectId = id; w.roistatHost = h; var p = d.location.protocol == "https:" ? "https://" : "http://"; var u = /^.*roistat_visit=[^;]+(.*)?$/.test(d.cookie) ? "/dist/module.js" : "/api/site/1.0/"+id+"/init"; var js = d.createElement(s); js.charset="UTF-8"; js.async = 1; js.src = p+h+u; var js2 = d.getElementsByTagName(s)[0]; js2.parentNode.insertBefore(js, js2);})(window, document, 'script', 'cloud.roistat.com', '{% setting "ROISTAT_COUNTER_ID" %}');
</script>
{% block foot %}{% endblock foot %}
{% block body_js %}{% endblock body_js %}
{% block foot_js %}{% endblock foot_js %}
</body>
</html>

@ -30,7 +30,7 @@ from apps.user.views import (
ProfileEditView, NotificationEditView,
PaymentHistoryView, resend_email_verify,
SubscribeView, ProfileView,
BonusHistoryView)
BonusHistoryView, UserGalleryEditView)
from apps.payment.views import (
CourseBuySuccessView, CourseBuyView,
PaymentwallCallbackView, SchoolBuySuccessView,
@ -75,6 +75,7 @@ urlpatterns = [
path('user/notifications', NotificationEditView.as_view(), name='user-edit-notifications'),
path('user/payments', PaymentHistoryView.as_view(), name='user-edit-payments'),
path('user/bonuses', BonusHistoryView.as_view(), name='user-bonuses'),
path('user/gallery-edit', UserGalleryEditView.as_view(), name='user-gallery-edit'),
path('user/resend-email-verify', resend_email_verify, name='resend-email-verify'),
path('subscribe', SubscribeView.as_view(), name='subscribe'),
path('subscribe/success', TemplateView.as_view(template_name='templates/lilcity/subscribe_success.html'), name='subscribe-success'),

@ -33,36 +33,41 @@
export default {
name: "block-images",
props: ["index", "title", "images", "accessToken", "readOnly"],
props: ["index", "title", "images", "accessToken", "readOnly", "longSide"],
methods: {
onTitleChange(event) {
this.$emit('update:title', event.target.value);
},
onImageAdded(event) {
const longSide = +this.longSide || 1600;
Array.from(event.target.files).forEach((file) => {
let reader = new FileReader();
reader.onload = () => {
let images = this.images;
console.log('images before before', JSON.stringify(images));
images.push({
src: reader.result,
loading: true,
});
this.$emit('update:images', images);
const index = images.length - 1;
api.uploadImage(reader.result, this.accessToken)
.then((response) => {
let images = this.images;
images.forEach((image, index) => {
images[index].image_id = response.data.id;
images[index].loading = false;
images[index].image_url = response.data.image;
images[index].image_thumbnail_url = response.data.image_thumbnail;
/* images.forEach((image, index) => {
if (image.src === reader.result) {
images[index].image_id = response.data.id;
images[index].loading = false;
images[index].image_url = response.data.image;
images[index].image_thumbnail_url = response.data.image_thumbnail;
}
});
console.log('images after', JSON.stringify(images));
}); */
this.$emit('update:images', images);
})
.catch((error) => {

@ -46,6 +46,12 @@ const components = {
Object.assign(components, window.LIL_STORE.components);
for(let k in components){
if(typeof components[k] === 'string'){
components[k] = await import(components[k]);
}
}
const app = new Vue({
el: '#lilcity-vue-app',
data() {

@ -4075,6 +4075,11 @@ a.grey-link
letter-spacing: 1px
+m
margin-right: 0
&__item a.timing__btn
opacity: 0;
transition: 0.5s ease;
&__item:hover a.timing__btn
opacity: 1;
&__pic
display: block
width: 100%

Loading…
Cancel
Save