LIL-715 Не работает галерея работ

remotes/origin/editis_13-01-19
gzbender 7 years ago
parent 7ed17d4e5a
commit 71a583df7c
  1. 4
      apps/user/templates/user/edit-gallery.html
  2. 4
      project/templates/blocks/lil_store_js.html
  3. 11
      web/src/js/app.js
  4. 5
      web/src/js/modules/common.js
  5. 2
      web/src/js/modules/profile.js
  6. 2
      web/src/js/user-gallery-edit.js

@ -13,7 +13,7 @@
{% block pre_app_js %}
<script>
window.LIL_STORE.data.user_gallery_images = [{% for img in user.gallery.gallery_images.reverse %}{
window.LIL_STORE.data.userGalleryImages = [{% for img in user.gallery.gallery_images.reverse %}{
id: {{ img.id }},
image_thumbnail_url: '{{ img.img.image_thumbnail.url }}',
image_id: {{ img.img.id }},
@ -27,7 +27,7 @@
<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"/>
<block-images :images="$root.store.data.userGalleryImages" :access-token="$root.store.accessToken" no-title="1"/>
</div>
<a href="#" id="gallery-save" class="btn">Сохранить</a>
</div>

@ -33,5 +33,9 @@
isGiftCertificateUrl: {{ is_gift_certificate_url|yesno:"true,false" }},
},
data: {},
urlIs: (urlPatternName) => {
return window.location.pathname.search(window.LIL_STORE.urls[urlPatternName]) > -1;
},
isIndexPage: window.location.pathname == '/',
};
</script>

@ -37,10 +37,6 @@ if (process.env.NODE_ENV === 'development') {
Vue.config.devtools = true;
}
window.urlIs = (urlPatternName) => {
return window.location.pathname.search(window.LIL_STORE.urls[urlPatternName]) > -1;
};
const components = {
UploadContestWork,
ContestWorks,
@ -50,11 +46,11 @@ const components = {
Object.assign(components, window.LIL_STORE.components);
if(urlIs('faq')){
if(window.LIL_STORE.urlIs('faq')){
const FAQ = require('../components/FAQ.vue');
components['faq'] = FAQ.default;
}
if(urlIs('userProfileEdit') || urlIs('userBonuses')){
if(window.LIL_STORE.urlIs('userProfileEdit') || window.LIL_STORE.urlIs('userBonuses')){
const profile = require("./modules/profile");
profile.main();
}
@ -64,6 +60,7 @@ const app = new Vue({
data() {
return {
store: window.LIL_STORE,
} },
}
},
components: components
});

@ -44,6 +44,7 @@ $(document).ready(function () {
});
//===========REVIEWS===============
if(window.LIL_STORE.isIndexPage){
const $reviews = $('.reviews');
const $reviewsWrap = $('.reviews__wrap');
const reviewImages = $reviews.data('review-images').split(',');
@ -83,7 +84,8 @@ $(document).ready(function () {
};
}
}
}
};
const checkScroll = e => {
const scrollTop = window.pageYOffset;
@ -102,6 +104,7 @@ $(document).ready(function () {
$(window).scroll(checkScroll);
checkScroll();
}
if(window.LIL_STORE.flags.isReferralUrl){
if(window.LIL_STORE.user.id){

@ -4,7 +4,7 @@ import ClipboardJS from 'clipboard';
import {showNotification} from './notification';
export const main = () => {
if(urlIs('userBonuses')){
if(window.LIL_STORE.urlIs('userBonuses')){
$('#referrer-url').select().click(function(){
$(this).select();
});

@ -7,7 +7,7 @@ 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 => {
api.saveUserGallery(window.LIL_STORE.data.userGalleryImages).then(response => {
window.location.href = '/user/profile/#works';
});
});

Loading…
Cancel
Save