Hotfix/lil 706 See merge request lilcity/backend!220remotes/origin/editis_13-01-19
commit
7ed17d4e5a
32 changed files with 441 additions and 254 deletions
@ -0,0 +1,18 @@ |
||||
# Generated by Django 2.0.6 on 2018-11-15 09:52 |
||||
|
||||
from django.db import migrations, models |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
|
||||
dependencies = [ |
||||
('user', '0025_merge_20180927_2353'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.AddField( |
||||
model_name='user', |
||||
name='site', |
||||
field=models.URLField(blank=True, default='', null=True), |
||||
), |
||||
] |
||||
@ -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='Галерея'), |
||||
), |
||||
] |
||||
@ -0,0 +1,35 @@ |
||||
{% extends "templates/lilcity/index.html" %} |
||||
{% load static %} |
||||
|
||||
{% block head %} |
||||
{{ block.super }} |
||||
<style> |
||||
.kit__photo { |
||||
width: 140px; |
||||
height: 140px; |
||||
} |
||||
</style> |
||||
{% endblock head %} |
||||
|
||||
{% block pre_app_js %} |
||||
<script> |
||||
window.LIL_STORE.data.user_gallery_images = [{% for img in user.gallery.gallery_images.reverse %}{ |
||||
id: {{ img.id }}, |
||||
image_thumbnail_url: '{{ img.img.image_thumbnail.url }}', |
||||
image_id: {{ img.img.id }}, |
||||
},{% endfor %}]; |
||||
</script> |
||||
<script src="{% static 'userGalleryEdit.js' %}"></script> |
||||
{% endblock pre_app_js %} |
||||
|
||||
{% block content %} |
||||
<div class="section section_gray"> |
||||
<div class="section__center center center_sm"> |
||||
<div class="title">Редактировать работы</div> |
||||
<div> |
||||
<block-images :images="$root.store.data.user_gallery_images" :access-token="$root.store.accessToken" no-title="1"/> |
||||
</div> |
||||
<a href="#" id="gallery-save" class="btn">Сохранить</a> |
||||
</div> |
||||
</div> |
||||
{% endblock %} |
||||
@ -0,0 +1,14 @@ |
||||
import BlockImages from '../components/blocks/BlockImages.vue'; |
||||
import $ from 'jquery'; |
||||
import {api} from "./modules/api"; |
||||
|
||||
window.LIL_STORE.components['block-images'] = BlockImages; |
||||
|
||||
$(document).ready(function () { |
||||
$('#gallery-save').click(e => { |
||||
e.preventDefault(); |
||||
api.saveUserGallery(window.LIL_STORE._user_gallery_images).then(response => { |
||||
window.location.href = '/user/profile/#works'; |
||||
}); |
||||
}); |
||||
}); |
||||
Loading…
Reference in new issue