fix to flows

remotes/origin/pm_task_31703
Alexander Zolotarev 9 years ago
parent 8e86868543
commit cd6bc0b850
  1. 39
      templates/course.html
  2. 3
      templates/index.html

@ -118,7 +118,7 @@
<div class="tl-wrap b-{{ i.head.status.color }}">
{% if i.head.lessons_length > 0 %}
{% if i.head.button %}
<a href="{{ i.head.button.link }}{{ i.head.button.id }}" by_type="{{ i.head.button.by_type }}" self_id="{{ i.head.button.id }}" course_id="{{ i.head.button.course }}">
<a {% if flow or flow == None %}href="{{ i.head.button.link }}{{ i.head.button.id }}" by_type="{{ i.head.button.by_type }}" self_id="{{ i.head.button.id }}" course_id="{{ i.head.button.course }}"{% else %}style="cursor: default;border-bottom: 0;"{% endif %}>
{% else %}
<a href="#">
{% endif %}
@ -143,10 +143,14 @@
<span style="float: left; margin: 5px 7px 0 0;">
{% if i.head.lessons_length > 0 %}
{% if i.head.button %}
{% if flow or flow == None %}
<a name="theme{{ i.head.mid }}" href="{{ i.head.button.link }}{{ i.head.button.id }}"
by_type="{{ i.head.button.by_type }}"
self_id="{{ i.head.button.id }}"
course_id="{{ i.head.button.course }}">
{% else %}
<a style="cursor: default;border-bottom: 0;">
{% endif %}
{% else %}
<a style="cursor: default;border-bottom: 0;">
{% endif %}
@ -163,7 +167,7 @@
{{ i.head.title|safe }}
</a>
{% if i.head.status.flag != 'N' %}
{% if i.head.status.flag != 'N' and flow or flow == None %}
<span class="label font-normal text-white bg-{{ i.head.status.color }}" style="margin-left: 10px;">
{{ i.head.status.title }}<i class="{{ i.head.status.icon }}" style="margin-right: 5px; margin-left: 10px;"></i>
</span>
@ -192,12 +196,17 @@
<ul style="padding: 0 0 0 15px;">
{% for lesson in i.lessons %}
<li style=" padding-bottom: 3px;">
{% if flow or flow == None %}
<a href="{{ lesson.button.link }}{{ lesson.button.id }}" by_type="{{ lesson.button.by_type }}"
self_id="{{ lesson.button.id }}" course_id="{{ lesson.button.course }}"
style="border-bottom: 1px dotted #333;color: #333;">
{{ lesson.title|safe }}
<span class="label font-normal text-white bg-{{ lesson.status.color }}"><i class="{{ lesson.status.icon }}"></i></span>
</a>
{% else %}
{{ lesson.title|safe }}
<span class="label font-normal text-white bg-{{ lesson.status.color }}"><i class="{{ lesson.status.icon }}"></i></span>
{% endif %}
</li>
{% endfor %}
</ul>
@ -280,7 +289,7 @@
{% if i.head.button %}
<div style="clear: both; width: 100%; margin-top: 10px;">
{% if flow or flow == None %}
<a type="button" href="{{ i.head.button.link }}{{ i.head.button.id }}">
<a type="button" class="flow" href="{{ i.head.button.link }}{{ i.head.button.id }}">
<button class="btn pull-right btn-lg m-b-xs m-r-xs m-t-lg course_button"
style="background: {{ i.head.button.background }}; color: {{ i.head.button.color }}"
by_type="{{ i.head.button.by_type }}"
@ -289,6 +298,13 @@
{{ i.head.button.title }}
</button>
</a>
{% else %}
<a type="button" class="flow" href="#">
<button class="btn pull-right btn-lg m-b-xs m-r-xs m-t-lg course_button"
style="background: {{ i.head.button.background }}; color: {{ i.head.button.color }}">
{{ i.head.button.title }}
</button>
</a>
{% endif %}
</div>
{% 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');
}

@ -58,7 +58,10 @@
{% for i in courses %}
<div class="col-lg-4 {% if i.by %}bought{% else %}no_bought{% endif %}">
{% comment %}
<a {% if i.by_flow or i.by_flow == None %}href="/courses/{{ i.slug }}"{% else %}class="flow" href="#" data-toggle="modal" data-target="#flowAccess"{% endif %}>
{% endcomment %}
<a href="/courses/{{ i.slug }}">
<div class="panel b-a course_cart " style="overflow: hidden;">
<div class="panel-heading no-border index" style="background: {{ i.level.background }};color:{{ i.level.color }};">
<span class="text-lt ">{{ i.level.title }}</span>

Loading…
Cancel
Save