From 3a211e1f4ba324fb56a24d3fa49808ea7b2108c1 Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 18 Oct 2017 10:38:54 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BB=20=D1=86=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lms/urls.py | 1 - lms/views.py | 42 ----------- templates/index_menu.html | 5 -- templates/price.html | 145 -------------------------------------- 4 files changed, 193 deletions(-) delete mode 100755 templates/price.html diff --git a/lms/urls.py b/lms/urls.py index 2424496..8d6616d 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -9,7 +9,6 @@ from access.views import profile_view urlpatterns = [ url(r'^$', views.index), - url(r'^price/$', views.price), url(r'^oferta/', views.show_oferta), url(r'^test/$', views.test), url(r'^all_comments/$', views.all_comments), diff --git a/lms/views.py b/lms/views.py index b38c0b4..e403538 100644 --- a/lms/views.py +++ b/lms/views.py @@ -31,48 +31,6 @@ def access_error(request): return {} -@response_decor(template='price.html', without_auth=True) -def price(request): - if request.user.is_authenticated() and request.user.in_role in ['M', 'S']: - return {'redirect': '/access/profile'} - journals = [] - for course in Course.objects.all() if request.user.is_authenticated() and request.user.is_admin else Course.objects.filter(public=True): - do = True - if course.hidden: - if not request.user.is_authenticated(): - do = False - else: - if not request.user.is_admin: - try: - Bill.objects.get(service__course=course, user=request.user, status='F') - except Bill.DoesNotExist: - do = False - if do: - journal, created = TeacherJ.objects.get_or_create(course=course, student=user_fabric(request.user)) - if not journal.full and Bill.objects.filter(user=user_fabric(request.user), service__course=course, status='F').exists(): - if not journal.start_date: - journal.start_date = datetime.datetime.now() - journal.save() - check_journal(journal) - journals.append(journal.get_head_face()) - - with open(STATIC_ROOT+'/prices.csv', mode='r') as infile: - reader = csv.reader(infile) - prices = {} - - for rows in reader: - prices[int(rows[0])] = rows[1] - - @register.filter - def get_item(dictionary, key): - return dictionary.get(key) - - return {'courses': journals, - 'prices': prices, - 'directions': ({'count': i.count(), 'title': i.title, 'color': i.color} for i in MaterialDirection.objects.all() if i.count() != 0), - 'bought': Bill.objects.filter(user=request.user, status='F').exists() if request.user.is_authenticated() else False} - - @response_decor(template='index.html', without_auth=True) def index(request): if request.user.is_authenticated() and request.user.in_role in ['M', 'S']: diff --git a/templates/index_menu.html b/templates/index_menu.html index 59d11b7..b326dfd 100755 --- a/templates/index_menu.html +++ b/templates/index_menu.html @@ -122,11 +122,6 @@ Контакты - {% if request.user.is_anonymous %} -
  • - Цены -
  • - {% endif %}
  • Помощь
  • diff --git a/templates/price.html b/templates/price.html deleted file mode 100755 index 76b299b..0000000 --- a/templates/price.html +++ /dev/null @@ -1,145 +0,0 @@ -{% extends 'base_index.html' %} -{% load static %} -{% block page_title %}Доступные курсы «{{ NAME }}»{% endblock %} -{% block title %}Доступные курсы «{{ NAME }}»{% endblock %} -{% block head %} - - {% if bought %} - - {% endif %} -{% endblock %} -{% block content %} -
    - -
    - {% include 'right_site.html' %} - - - - - - - - - - -{% endblock %} - -{% block js %} - -{% endblock %}