Merge branch 'feature-ohlhafv' into develop
This commit is contained in:
+10
-20
@@ -155,7 +155,7 @@ def contact_view(request, *args, **kwargs):
|
||||
def ohlhafv_view(request, *args, **kwargs):
|
||||
"""Render Ohlhafv form page."""
|
||||
form = OhlhafvForm()
|
||||
return render(request, 'ohlhafv.html', {'form': form})
|
||||
return render(request, 'ohlhafv/new.html', {'form': form})
|
||||
|
||||
|
||||
@ensure_csrf_cookie
|
||||
@@ -165,10 +165,8 @@ def ohlhafv_submit(request, *args, **kwargs):
|
||||
form = OhlhafvForm(request.POST)
|
||||
if form.is_valid():
|
||||
form.save()
|
||||
# return HttpResponseRedirect('/list/')
|
||||
else:
|
||||
pass
|
||||
# return render(request, 'error.html', {'error': form.errors})
|
||||
return HttpResponseRedirect('/ohlhafv/list/')
|
||||
|
||||
|
||||
@@ -177,20 +175,12 @@ def ohlhafv_submit(request, *args, **kwargs):
|
||||
def ohlhafv_list(request, *args, **kwargs):
|
||||
"""Present Ohlhafv challenges list."""
|
||||
challenges = OhlhafvChallenge.objects.all()
|
||||
|
||||
table = OhlhafvTable(challenges,
|
||||
request=request,
|
||||
exclude=['id', 'challenger_email', 'victim_email'],
|
||||
attrs={'class': 'table table-bordered table-hover'})
|
||||
|
||||
table.paginate(page=request.GET.get('page', 1), per_page=25)
|
||||
table_html = table.as_html(request)
|
||||
|
||||
challenges = challenges.order_by('-id')
|
||||
context = {
|
||||
'table': table_html,
|
||||
'challenges': challenges,
|
||||
'challenge_count': len(challenges),
|
||||
}
|
||||
return render(request, 'ohlhafv_list.html', context)
|
||||
return render(request, 'ohlhafv/list.html', context)
|
||||
|
||||
|
||||
@ensure_csrf_cookie
|
||||
@@ -218,7 +208,7 @@ def kaehmy_list_view(request, *args, **kwargs):
|
||||
'application_count': len(applications),
|
||||
'filter_options': filter_options
|
||||
}
|
||||
return render(request, 'kaehmy_list.html', context)
|
||||
return render(request, 'kaehmy/kaehmy_list.html', context)
|
||||
|
||||
|
||||
@ensure_csrf_cookie
|
||||
@@ -246,7 +236,7 @@ def kaehmy_comment(request, *args, **kwargs):
|
||||
context = {
|
||||
'error': form.errors
|
||||
}
|
||||
return render(request, 'kaehmy_error.html', context)
|
||||
return render(request, 'kaehmy/kaehmy_error.html', context)
|
||||
|
||||
|
||||
@require_http_methods(["GET"])
|
||||
@@ -271,14 +261,14 @@ def kaehmy_statistics_view(request, *args, **kwargs):
|
||||
'application_count': len(applications),
|
||||
'role_list': role_list
|
||||
}
|
||||
return render(request, 'kaehmy_statistics.html', context)
|
||||
return render(request, 'kaehmy/kaehmy_statistics.html', context)
|
||||
|
||||
|
||||
@require_http_methods(["GET"])
|
||||
def kaehmy_view(request, *args, **kwargs):
|
||||
"""Render Kaehmy form page."""
|
||||
form = KaehmyForm_Form()
|
||||
return render(request, 'kaehmy.html', {'form': form})
|
||||
return render(request, 'kaehmy/kaehmy.html', {'form': form})
|
||||
|
||||
|
||||
@ensure_csrf_cookie
|
||||
@@ -324,7 +314,7 @@ def kaehmy_submit(request, *args, **kwargs):
|
||||
context = {
|
||||
'error': form.errors
|
||||
}
|
||||
return render(request, 'kaehmy_error.html', context)
|
||||
return render(request, 'kaehmy/kaehmy_error.html', context)
|
||||
return HttpResponseRedirect('/kaehmy')
|
||||
|
||||
|
||||
@@ -348,4 +338,4 @@ def kaehmy_export_view(request, *args, **kwargs):
|
||||
'non_board_table': make_table(non_board),
|
||||
'board_table': make_table(board),
|
||||
}
|
||||
return render(request, 'kaehmy_export.html', context)
|
||||
return render(request, 'kaehmy/kaehmy_export.html', context)
|
||||
|
||||
Reference in New Issue
Block a user