Merge branch 'hotfix/LIL-731' into 'master'

Resolve LIL-731 "Hotfix/"

Closes LIL-731

See merge request lilschool/site!248
remotes/origin/hotfix/courses_slug_url_20-01-19
Danil 7 years ago
commit b4edcad736
  1. 5
      apps/content/templates/content/contest.html
  2. 9
      apps/content/templates/content/contest_edit.html
  3. 8
      apps/course/templates/course/course_edit.html
  4. 4
      apps/user/templates/user/bonus-history.html
  5. 4
      apps/user/templates/user/profile-settings.html
  6. 12
      project/templates/blocks/lil_store_js.html
  7. 1
      project/templates/lilcity/edit_index.html
  8. 1
      web/package.json
  9. 4
      web/src/components/ContestRedactor.vue
  10. 29
      web/src/components/ContestWorks.vue
  11. 164
      web/src/components/CourseRedactor.vue
  12. 38
      web/src/components/UploadContestWork.vue
  13. 35
      web/src/components/blocks/ContestWork.vue
  14. 16
      web/src/js/app.js
  15. 4
      web/src/js/contest-redactor.js
  16. 5
      web/src/js/pages/contest-edit.js
  17. 7
      web/src/js/pages/contest.js
  18. 6
      web/src/js/pages/course-edit.js
  19. 6
      web/src/js/pages/profile.js
  20. 5
      web/src/js/pages/user-gallery-edit.js
  21. 2
      web/src/sass/app.sass
  22. 35
      web/src/sass/components/contest-edit.scss
  23. 55
      web/src/sass/components/contest.scss
  24. 166
      web/src/sass/components/course-edit.scss
  25. 166
      web/src/sass/pages/course-edit.scss
  26. 13
      web/webpack.config.js

@ -45,3 +45,8 @@
</div>
</div>
{% endblock content %}
{% block pre_app_js %}
<script type="text/javascript" src="{% static 'contest.js' %}"></script>
<link rel="stylesheet" href="{% static 'contest.css' %}" />
{% endblock pre_app_js %}

@ -12,7 +12,8 @@
{% block content %}
<contest-redactor {% if object and object.id %}:contest-id="{{ object.id }}"{% endif %}></contest-redactor>
{% endblock content %}
{% block foot %}
<script type="text/javascript" src="{% static 'contestRedactor.js' %}"></script>
<link rel="stylesheet" href="{% static 'contestRedactor.css' %}" />
{% endblock foot %}
{% block pre_app_js %}
<script type="text/javascript" src="{% static 'contestEdit.js' %}"></script>
<link rel="stylesheet" href="{% static 'contestEdit.css' %}" />
{% endblock pre_app_js %}

@ -13,7 +13,7 @@
access-token="{{ request.user.auth_token }}"
{% if object and object.id %}:course-id="{{ object.id }}"{% endif %}></course-redactor>
{% endblock content %}
{% block foot %}
<script type="text/javascript" src="{% static 'courseRedactor.js' %}"></script>
<link rel="stylesheet" href="{% static 'courseRedactor.css' %}" />
{% endblock foot %}
{% block pre_app_js %}
<script type="text/javascript" src="{% static 'courseEdit.js' %}"></script>
<link rel="stylesheet" href="{% static 'courseEdit.css' %}" />
{% endblock pre_app_js %}

@ -79,3 +79,7 @@
</div>
</div>
{% endblock content %}
{% block pre_app_js %}
<script type="text/javascript" src="{% static 'profile.js' %}"></script>
{% endblock pre_app_js %}

@ -323,3 +323,7 @@
// (new Inputmask('+7 (999) 999-99-99')).mask(document.querySelector('[name=phone]'));
</script>
{% endblock foot %}
{% block pre_app_js %}
<script type="text/javascript" src="{% static 'profile.js' %}"></script>
{% endblock pre_app_js %}

@ -21,10 +21,14 @@
components: {},
urls: {
courses: "{% url 'courses' %}",
courseEdit: /\/course\/\d+\/edit/,
courseCreate: "{% url 'course_create' %}",
userProfileEdit: "{% url 'user-edit-profile' %}",
userProfile: "{% url 'user-profile' %}",
userBonuses: "{% url 'user-bonuses' %}",
faq: "{% url 'faq' %}",
contestEdit: /contest\/\w+\/edit/,
userGalleryEdit: "{% url 'user-gallery-edit' %}",
},
flags: {
referrer: '{{ referrer.id|default:'' }}',
@ -33,8 +37,12 @@
isGiftCertificateUrl: {{ is_gift_certificate_url|yesno:"true,false" }},
},
data: {},
urlIs: (urlPatternName) => {
return window.location.pathname.search(window.LIL_STORE.urls[urlPatternName]) > -1;
urlIs: (urlPatternNames) => {
if(! Array.isArray(urlPatternNames)){
urlPatternNames = [urlPatternNames];
}
return urlPatternNames.filter(
urlPatternName => window.location.pathname.search(window.LIL_STORE.urls[urlPatternName]) > -1).length > 0;
},
isIndexPage: window.location.pathname == '/',
};

@ -316,6 +316,7 @@
</div>
</div>
{% include 'templates/blocks/lil_store_js.html' %}
{% block pre_app_js %}{% endblock pre_app_js %}
<script>
var schoolDiscount = parseFloat({{ config.SERVICE_DISCOUNT }});
var schoolAmountForDiscount = parseFloat({{ config.SERVICE_DISCOUNT_MIN_AMOUNT }});

@ -41,6 +41,7 @@
"baguettebox.js": "^1.10.0",
"clipboard": "^2.0.1",
"downscale": "^1.0.4",
"extract-loader": "^3.1.0",
"glob": "^7.1.2",
"history": "^4.7.2",
"ilyabirman-likely": "^2.3.0",

@ -229,7 +229,3 @@
}
};
</script>
<style>
</style>

@ -74,8 +74,8 @@
}
}
}
heights[column] += workHeight;
heights[column] += workHeight;
[first, second, third][column].push(work);
index++;
}
@ -112,28 +112,3 @@
components: {ContestWork},
}
</script>
<style>
.contest-works {
width: 100%;
}
.contest-works__works {
text-align: left;
display: flex;
}
.contest-works__column {
display: flex;
flex-direction: column;
margin-right: 20px;
width: 300px;
}
.contest-works__loader {
width: 100%;
height: 30px;
position: relative;
}
.contest-works__no-works {
text-align: center;
width: 100%;
}
</style>

@ -1074,168 +1074,4 @@
}
</script>
<style lang="scss">
.vdp-datepicker__calendar {
width: 240px;
margin-top: 10px;
padding: 5px;
background: white;
box-shadow: 0 2px 20px 0 rgba(0, 0, 0, 0.1);
z-index: 99 !important;
header {
display: flex;
margin-bottom: 5px;
-ms-flex-align: center;
align-items: center;
}
.prev, .next {
font-size: 0;
cursor: pointer;
order: 1;
width: auto !important;
padding: 10px;
}
.prev {
order: 1;
}
.next {
order: 3;
}
.prev:before, .next:before {
content: '';
display: block;
width: 10px;
height: 10px;
border: solid #E6E6E6;
border-width: 2px 2px 0 0;
}
.prev:after, .next:after {
content: none !important;
}
.prev:before {
transform: rotate(-135deg);
}
.next:before {
transform: rotate(45deg);
}
}
.kit__preview {
img {
width: 140px;
height: 140px;
}
}
.kit__photo {
width: 140px;
height: 140px;
}
.kit__section-remove {
button.sortable__handle {
margin-right: 10px;
cursor: -webkit-grab;
cursor: grab;
svg.icon-hamburger {
width: 1em;
height: 1em;
}
}
}
.sortable-ghost, .sortable-chosen {
background: white;
border-radius: 10px;
}
.course-redactor__preview-button-bg-save {
background-color: #58fffb;
}
.course-redactor__preview-button {
transition: backgroundColor 0.5s ease-in-out;
}
.field_text {
height: 270px;
overflow: scroll;
}
.courses__item {
flex: 0 0 300px;
}
.courses__item .field {
margin-bottom: 0;
}
.courses__content .redactor-box {
overflow-x: visible;
overflow-y: auto;
max-height: 200px;
background: none;
margin-top: 10px;
}
.courses__content .redactor-layer{
background: none;
}
.courses__theme {
flex: 1;
}
.courses__preview {
.upload {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.upload__title {
color: #888888;
font-size: 16px;
margin-top: 100px;
width: 100%;
text-align: center;
}
.upload__file {
width: 100%;
height: 100%;
}
}
.course-delete-cover {
left: 5px;
position: absolute;
bottom: 3px;
}
.field-category .select__head {
font-size: inherit;
line-height: inherit;
height: auto;
}
.datetime-fields {
display: flex;
}
.field-time {
margin-left: 10px;
flex: 50%;
}
</style>

@ -153,41 +153,3 @@
}
}
</script>
<style lang="scss">
.upload-contest-work {
.popup__wrap {
padding: 35px 35px 0;
}
.title {
text-align: center; font-size: 24px;
.text__curve {
right: 55px;
width: 170px;
bottom: -40px;
}
}
.kit__photo {
height: 400px;
}
.kit__photo.has-image {
border: none;
}
.kit__photo-image {
max-height: 400px;
height: auto;
width: auto;
}
.kit__file {
bottom: 0;
}
}
</style>

@ -25,38 +25,3 @@
components: {Likes},
}
</script>
<style lang="scss">
.contest-work-item {
break-inside: avoid;
border-radius: 8px;
overflow: hidden;
margin-bottom: 20px;
transition: opacity .4s ease-in-out;
text-transform: uppercase;
font-weight: bold;
color: black;
border: 1px solid #ececec;
display: block;
}
.contest-work-item__img {
width: 100%;
height: auto;
}
.contest-work-item__info {
display: flex;
padding: 5px 10px;
}
.contest-work-item__age {
color: #919191;
}
.contest-work-item__bio {
flex: calc(100% - 70px);
}
@media only screen and (min-width: 1023px) {
.contest-works:hover .contest-work-item:not(:hover) {
opacity: 0.4;
}
}
</style>

@ -13,7 +13,6 @@ import "./modules/tabs";
import "./modules/popup";
import "./modules/courses";
import "./modules/comments";
import "./modules/comments";
import "./modules/password-show";
import "./modules/notification";
import "./modules/mixpanel";
@ -25,9 +24,8 @@ import Vue from 'vue';
import Vuelidate from 'vuelidate';
import VueAutosize from '../components/directives/autosize'
import Comments from '../components/Comments';
import UploadContestWork from '../components/UploadContestWork.vue';
import ContestWorks from '../components/ContestWorks.vue';
import Likes from '../components/blocks/Likes.vue';
import FAQ from '../components/FAQ.vue';
Vue.use(Vuelidate);
Vue.use(VueAutosize);
@ -38,23 +36,13 @@ if (process.env.NODE_ENV === 'development') {
}
const components = {
UploadContestWork,
ContestWorks,
Likes,
Comments,
FAQ,
};
Object.assign(components, window.LIL_STORE.components);
if(window.LIL_STORE.urlIs('faq')){
const FAQ = require('../components/FAQ.vue');
components['faq'] = FAQ.default;
}
if(window.LIL_STORE.urlIs('userProfileEdit') || window.LIL_STORE.urlIs('userBonuses')){
const profile = require("./modules/profile");
profile.main();
}
const app = new Vue({
el: '#lilcity-vue-app',
data() {

@ -1,4 +0,0 @@
import ContestRedactor from '../components/ContestRedactor.vue'
window.LIL_STORE.components['contest-redactor'] = ContestRedactor;

@ -0,0 +1,5 @@
import '../../sass/components/contest-edit.scss';
import ContestRedactor from '../../components/ContestRedactor.vue';
window.LIL_STORE.components['contest-redactor'] = ContestRedactor;

@ -0,0 +1,7 @@
import '../../sass/components/contest.scss';
import UploadContestWork from '../../components/UploadContestWork.vue';
import ContestWorks from '../../components/ContestWorks.vue';
window.LIL_STORE.components['upload-contest-work'] = UploadContestWork;
window.LIL_STORE.components['contest-works'] = ContestWorks;

@ -1,5 +1,7 @@
import 'babel-polyfill'
import CourseRedactor from '../components/CourseRedactor.vue'
import '../../sass/components/course-edit.scss';
import 'babel-polyfill';
import CourseRedactor from '../../components/CourseRedactor.vue';
import $ from 'jquery';
window.LIL_STORE.components['course-redactor'] = CourseRedactor;

@ -1,9 +1,9 @@
import $ from 'jquery';
import slugify from 'slugify';
import ClipboardJS from 'clipboard';
import {showNotification} from './notification';
import {showNotification} from '../modules/notification';
export const main = () => {
$(document).ready(function () {
if(window.LIL_STORE.urlIs('userBonuses')){
$('#referrer-url').select().click(function(){
$(this).select();
@ -53,4 +53,4 @@ export const main = () => {
});
changeSlug();
}
}
});

@ -1,6 +1,7 @@
import BlockImages from '../components/blocks/BlockImages.vue';
import BlockImages from '../../components/blocks/BlockImages.vue';
import $ from 'jquery';
import {api} from "./modules/api";
import {api} from "../modules/api";
window.LIL_STORE.components['block-images'] = BlockImages;

@ -2,4 +2,4 @@
@import helpers/all
@import generated/sprite-svg
@import common
@import '~baguettebox.js/dist/baguetteBox.min.css';
@import '~baguettebox.js/dist/baguetteBox.min.css';

@ -0,0 +1,35 @@
.upload-contest-work {
.popup__wrap {
padding: 35px 35px 0;
}
.title {
text-align: center; font-size: 24px;
.text__curve {
right: 55px;
width: 170px;
bottom: -40px;
}
}
.kit__photo {
height: 400px;
}
.kit__photo.has-image {
border: none;
}
.kit__photo-image {
max-height: 400px;
height: auto;
width: auto;
}
.kit__file {
bottom: 0;
}
}

@ -0,0 +1,55 @@
.contest-works {
width: 100%;
}
.contest-works__works {
text-align: left;
display: flex;
}
.contest-works__column {
display: flex;
flex-direction: column;
margin-right: 20px;
width: 300px;
}
.contest-works__loader {
width: 100%;
height: 30px;
position: relative;
}
.contest-works__no-works {
text-align: center;
width: 100%;
}
.contest-work-item {
break-inside: avoid;
border-radius: 8px;
overflow: hidden;
margin-bottom: 20px;
transition: opacity .4s ease-in-out;
text-transform: uppercase;
font-weight: bold;
color: black;
border: 1px solid #ececec;
display: block;
}
.contest-work-item__img {
width: 100%;
height: auto;
}
.contest-work-item__info {
display: flex;
padding: 5px 10px;
}
.contest-work-item__age {
color: #919191;
}
.contest-work-item__bio {
flex: calc(100% - 70px);
}
@media only screen and (min-width: 1023px) {
.contest-works:hover .contest-work-item:not(:hover) {
opacity: 0.4;
}
}

@ -0,0 +1,166 @@
.vdp-datepicker__calendar {
width: 240px;
margin-top: 10px;
padding: 5px;
background: white;
box-shadow: 0 2px 20px 0 rgba(0, 0, 0, 0.1);
z-index: 99 !important;
header {
display: flex;
margin-bottom: 5px;
-ms-flex-align: center;
align-items: center;
}
.prev, .next {
font-size: 0;
cursor: pointer;
order: 1;
width: auto !important;
padding: 10px;
}
.prev {
order: 1;
}
.next {
order: 3;
}
.prev:before, .next:before {
content: '';
display: block;
width: 10px;
height: 10px;
border: solid #E6E6E6;
border-width: 2px 2px 0 0;
}
.prev:after, .next:after {
content: none !important;
}
.prev:before {
transform: rotate(-135deg);
}
.next:before {
transform: rotate(45deg);
}
}
.kit__preview {
img {
width: 140px;
height: 140px;
}
}
.kit__photo {
width: 140px;
height: 140px;
}
.kit__section-remove {
button.sortable__handle {
margin-right: 10px;
cursor: -webkit-grab;
cursor: grab;
svg.icon-hamburger {
width: 1em;
height: 1em;
}
}
}
.sortable-ghost, .sortable-chosen {
background: white;
border-radius: 10px;
}
.course-redactor__preview-button-bg-save {
background-color: #58fffb;
}
.course-redactor__preview-button {
transition: backgroundColor 0.5s ease-in-out;
}
.field_text {
height: 270px;
overflow: scroll;
}
.courses__item {
flex: 0 0 300px;
}
.courses__item .field {
margin-bottom: 0;
}
.courses__content .redactor-box {
overflow-x: visible;
overflow-y: auto;
max-height: 200px;
background: none;
margin-top: 10px;
}
.courses__content .redactor-layer{
background: none;
}
.courses__theme {
flex: 1;
}
.courses__price {
margin-left: 20px;
}
.courses__preview {
.upload {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.upload__title {
color: #888888;
font-size: 16px;
margin-top: 100px;
width: 100%;
text-align: center;
}
.upload__file {
width: 100%;
height: 100%;
}
}
.course-delete-cover {
left: 5px;
position: absolute;
bottom: 3px;
}
.field-category .select__head {
font-size: inherit;
line-height: inherit;
height: auto;
}
.datetime-fields {
display: flex;
}
.field-time {
margin-left: 10px;
flex: 50%;
}

@ -0,0 +1,166 @@
.vdp-datepicker__calendar {
width: 240px;
margin-top: 10px;
padding: 5px;
background: white;
box-shadow: 0 2px 20px 0 rgba(0, 0, 0, 0.1);
z-index: 99 !important;
header {
display: flex;
margin-bottom: 5px;
-ms-flex-align: center;
align-items: center;
}
.prev, .next {
font-size: 0;
cursor: pointer;
order: 1;
width: auto !important;
padding: 10px;
}
.prev {
order: 1;
}
.next {
order: 3;
}
.prev:before, .next:before {
content: '';
display: block;
width: 10px;
height: 10px;
border: solid #E6E6E6;
border-width: 2px 2px 0 0;
}
.prev:after, .next:after {
content: none !important;
}
.prev:before {
transform: rotate(-135deg);
}
.next:before {
transform: rotate(45deg);
}
}
.kit__preview {
img {
width: 140px;
height: 140px;
}
}
.kit__photo {
width: 140px;
height: 140px;
}
.kit__section-remove {
button.sortable__handle {
margin-right: 10px;
cursor: -webkit-grab;
cursor: grab;
svg.icon-hamburger {
width: 1em;
height: 1em;
}
}
}
.sortable-ghost, .sortable-chosen {
background: white;
border-radius: 10px;
}
.course-redactor__preview-button-bg-save {
background-color: #58fffb;
}
.course-redactor__preview-button {
transition: backgroundColor 0.5s ease-in-out;
}
.field_text {
height: 270px;
overflow: scroll;
}
.courses__item {
flex: 0 0 300px;
}
.courses__item .field {
margin-bottom: 0;
}
.courses__content .redactor-box {
overflow-x: visible;
overflow-y: auto;
max-height: 200px;
background: none;
margin-top: 10px;
}
.courses__content .redactor-layer{
background: none;
}
.courses__theme {
flex: 1;
}
.courses__price {
margin-left: 20px;
}
.courses__preview {
.upload {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.upload__title {
color: #888888;
font-size: 16px;
margin-top: 100px;
width: 100%;
text-align: center;
}
.upload__file {
width: 100%;
height: 100%;
}
}
.course-delete-cover {
left: 5px;
position: absolute;
bottom: 3px;
}
.field-category .select__head {
font-size: inherit;
line-height: inherit;
height: auto;
}
.datetime-fields {
display: flex;
}
.field-time {
margin-left: 10px;
flex: 50%;
}

@ -5,26 +5,27 @@ const NODE_ENV = process.env.NODE_ENV || 'development';
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const SpriteLoaderPlugin = require('svg-sprite-loader/plugin');
module.exports = {
entry: {
app: "./src/js/app.js",
courseRedactor: "./src/js/course-redactor.js",
contestRedactor: "./src/js/contest-redactor.js",
userGalleryEdit: "./src/js/user-gallery-edit.js",
courseEdit: "./src/js/pages/course-edit.js",
contest: "./src/js/pages/contest.js",
contestEdit: "./src/js/pages/contest-edit.js",
profile: "./src/js/pages/profile.js",
userGalleryEdit: "./src/js/pages/user-gallery-edit.js",
mixpanel: "./src/js/third_party/mixpanel-2-latest.js",
sprite: glob('./src/icons/*.svg'),
images: glob('./src/img/*.*'),
imagesCertificates: glob('./src/img/user-certificates/*'),
imagesGiftCertificates: glob('./src/img/gift-certificates/*'),
imagesReviews: glob('./src/img/reviews/*'),
fonts: glob('./src/fonts/*')
fonts: glob('./src/fonts/*'),
},
output: {
path: path.join(__dirname, "build"),
filename: NODE_ENV === 'development' ? '[name].js' : '[name].js',
library: '[name]',
//filename: NODE_ENV === 'development' ? '[name].js' : '[name].[id].[chunkhash].js',
//library: '[name]',
publicPath: '/static/',
},
module: {

Loading…
Cancel
Save