LIL-639 При оплате дб выделен только тот день(урок), на который пользователь нажал

remotes/origin/hotfix/LIL-661
gzbender 8 years ago
parent 909d9ab0d0
commit ef434f50d1
  1. 1
      apps/school/templates/blocks/day_pay_btn.html
  2. 2
      apps/school/templates/blocks/schedule.html
  3. 15
      web/src/js/modules/popup.js

@ -1,5 +1,6 @@
<a <a
data-popup=".js-popup-buy" data-popup=".js-popup-buy"
class="timing__btn btn" class="timing__btn btn"
data-day="{{ school_schedule.weekday }}"
href="{% url 'school-checkout' %}?weekdays={{ school_schedule.weekday }}&add_days=true" href="{% url 'school-checkout' %}?weekdays={{ school_schedule.weekday }}&add_days=true"
>купить</a> >купить</a>

@ -10,7 +10,7 @@
{% endfor %} {% endfor %}
</div> </div>
<div class="timing__foot"> <div class="timing__foot">
<!--{% include './pay_btn.html' %}--> {# include './pay_btn.html' #}
<a target="_blank" class="timing__print" href="{% url 'school:school_schedules-print' %}">Распечатать расписание <a target="_blank" class="timing__print" href="{% url 'school:school_schedules-print' %}">Распечатать расписание
<span class="bold">чтобы не забыть</span> <span class="bold">чтобы не забыть</span>
<svg class="icon icon-print"> <svg class="icon icon-print">

@ -34,7 +34,8 @@ $(document).ready(function () {
popup; popup;
body.on('click', '[data-popup]', function(e){ body.on('click', '[data-popup]', function(e){
let data = $(this).data('popup'); const $this = $(this);
let data = $this.data('popup');
if(! data) { if(! data) {
return true; return true;
} }
@ -50,7 +51,7 @@ $(document).ready(function () {
console.log('reset selected'); console.log('reset selected');
$('[data-day]').prop('checked', false); $('[data-day]').prop('checked', false);
if ($(this).text() === 'продлить') { if ($this.text() === 'продлить') {
//data-purchased //data-purchased
//restore purchased selection //restore purchased selection
console.log('restore purchased'); console.log('restore purchased');
@ -72,19 +73,19 @@ $(document).ready(function () {
} }
} }
if( data === '.js-popup-auth') { if( data === '.js-popup-auth') {
let nextUrl = $(this).data('auth-next-url'); let nextUrl = $this.data('auth-next-url');
if(nextUrl === 'href') { if(nextUrl === 'href') {
nextUrl = $(this).attr('href'); nextUrl = $this.attr('href');
} }
popup.data('next-url', nextUrl); popup.data('next-url', nextUrl);
} }
if($(this).data('day')) { if($this.data('day')) {
let day = $(this).data('day'); let day = $this.data('day');
$('[data-day='+day+']').prop('checked', true); $('[data-day='+day+']').prop('checked', true);
} }
if(!is_extend && !$(this).data('day')) { if(!is_extend && !$this.data('day')) {
console.log('check all'); console.log('check all');
$('[data-day]').each(function(){ $('[data-day]').each(function(){
$(this).prop('checked', true); $(this).prop('checked', true);

Loading…
Cancel
Save