From cd6bc0b850c09070ab58ba5875181833aa398a04 Mon Sep 17 00:00:00 2001 From: Alexander Zolotarev Date: Tue, 1 Aug 2017 22:12:00 +0300 Subject: [PATCH] fix to flows --- templates/course.html | 39 ++++++++++++++++++++++++++++++++++++--- templates/index.html | 3 +++ 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/templates/course.html b/templates/course.html index aaaaed5..7f08e18 100755 --- a/templates/course.html +++ b/templates/course.html @@ -118,7 +118,7 @@
{% if i.head.lessons_length > 0 %} {% if i.head.button %} - + {% else %} {% endif %} @@ -143,10 +143,14 @@ {% if i.head.lessons_length > 0 %} {% if i.head.button %} + {% if flow or flow == None %} + {% else %} + + {% endif %} {% else %} {% endif %} @@ -163,7 +167,7 @@ {{ i.head.title|safe }} - {% if i.head.status.flag != 'N' %} + {% if i.head.status.flag != 'N' and flow or flow == None %} {{ i.head.status.title }} @@ -192,12 +196,17 @@ @@ -280,7 +289,7 @@ {% if i.head.button %}
{% if flow or flow == None %} - + + {% endif %}
{% endif %} @@ -332,6 +348,23 @@ }); $('[data-toggle="tooltip"]').tooltip() + // Проверка доступности уроков(старт потока) + // если поток открыт редирект на урок + $('.flow').on('click', function(e){ + e.preventDefault(); + var path = document.location.pathname; + $.get(path, function(data){ + _flow = $(data).find('.flow').attr('href'); + if (_flow === '#'){ + $('#flowAccess').modal('show'); + } + else { + document.location.href = _flow; + } + //console.log(_flow); + }); + }); + if(flow == 'False'){ $('#flowAccess').modal('show'); } diff --git a/templates/index.html b/templates/index.html index 372174e..2f2fe73 100755 --- a/templates/index.html +++ b/templates/index.html @@ -58,7 +58,10 @@ {% for i in courses %}