Fix few kaehmy problems
- Fix variable naming in statistics - Add scope for html files to fix rendering of errors - Fix footer.css path and remove duplicate
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@ import django_tables2 as tables
|
||||
from django.db.models import Count, Q
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from webapp.models import Application
|
||||
from kaehmy.models import Application
|
||||
|
||||
|
||||
class ExportTable(tables.Table):
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
{% load staticfiles %}
|
||||
<link rel="stylesheet" href="/static/css/kaehmy_footer.css">
|
||||
|
||||
<footer style="text-align: center">
|
||||
<div>
|
||||
|
||||
+8
-7
@@ -15,6 +15,7 @@ from dealer.git import git
|
||||
from members.views.utils import *
|
||||
from kaehmy.models import Application, CustomRole, PresetRole, TelegramChannel
|
||||
from kaehmy.forms import ApplicationForm, CommentForm
|
||||
from kaehmy.tables import ExportTable
|
||||
from webapp.utils import send_email
|
||||
|
||||
|
||||
@@ -44,7 +45,7 @@ def list_view(request, *args, **kwargs):
|
||||
'filter_options': filter_options
|
||||
}
|
||||
|
||||
return render(request, 'list.html', context)
|
||||
return render(request, 'kaehmy:list.html', context)
|
||||
|
||||
|
||||
@ensure_csrf_cookie
|
||||
@@ -71,7 +72,7 @@ def comment(request, *args, **kwargs):
|
||||
context = {
|
||||
'error': form.errors
|
||||
}
|
||||
return render(request, 'error.html', context)
|
||||
return render(request, 'kaehmy:error.html', context)
|
||||
|
||||
|
||||
@require_http_methods(["GET"])
|
||||
@@ -96,14 +97,14 @@ def statistics_view(request, *args, **kwargs):
|
||||
'application_count': len(applications),
|
||||
'role_list': role_list
|
||||
}
|
||||
return render(request, 'statistics.html', context)
|
||||
return render(request, 'kaehmy:statistics.html', context)
|
||||
|
||||
|
||||
@require_http_methods(["GET"])
|
||||
def view(request, *args, **kwargs):
|
||||
"""Render Kaehmy form page."""
|
||||
form = ApplicationForm()
|
||||
return render(request, 'kaehmy.html', {'form': form})
|
||||
return render(request, 'kaehmy:kaehmy.html', {'form': form})
|
||||
|
||||
|
||||
@ensure_csrf_cookie
|
||||
@@ -149,14 +150,14 @@ def submit(request, *args, **kwargs):
|
||||
context = {
|
||||
'error': form.errors
|
||||
}
|
||||
return render(request, 'error.html', context)
|
||||
return render(request, 'kaehmy:error.html', context)
|
||||
return HttpResponseRedirect('/kaehmy')
|
||||
|
||||
|
||||
@require_http_methods(['GET'])
|
||||
def export_view(request, *args, **kwargs):
|
||||
def make_table(queryset):
|
||||
table = KaehmyExportTable(queryset,
|
||||
table = ExportTable(queryset,
|
||||
request=request,
|
||||
exclude=['id'],
|
||||
attrs={'class': 'table table-bordered table-hover'})
|
||||
@@ -173,4 +174,4 @@ def export_view(request, *args, **kwargs):
|
||||
'non_board_table': make_table(non_board),
|
||||
'board_table': make_table(board),
|
||||
}
|
||||
return render(request, 'export.html', context)
|
||||
return render(request, 'kaehmy:export.html', context)
|
||||
|
||||
Reference in New Issue
Block a user