Compare commits
No commits in common. "86d72120601fac18b11e045da8cffa88dc9e0aed" and "121b99730d6ba2d9be7ac0d8f33b695ee9e4a5a0" have entirely different histories.
86d7212060
...
121b99730d
@ -100,8 +100,7 @@ body {
|
||||
border: none;
|
||||
padding: 8px 14px;
|
||||
border-radius: 2px;
|
||||
font-weight: bold;
|
||||
cursor: pointer; }
|
||||
font-weight: bold; }
|
||||
.LP-Button:active {
|
||||
background-color: #76323F;
|
||||
color: #f9f9f9; }
|
||||
|
18
lostplaces/lostplaces_app/templates/delete_place.html
Normal file
18
lostplaces/lostplaces_app/templates/delete_place.html
Normal file
@ -0,0 +1,18 @@
|
||||
{% extends 'global.html'%}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}Lost Place Deletion{% endblock %}
|
||||
|
||||
{% block maincontent %}
|
||||
<form class="" method="POST" enctype="multipart/form-data">
|
||||
<fieldset class="">
|
||||
<legend class="">Delete place</legend>
|
||||
{% csrf_token %}
|
||||
<p>Are you sure you want to delete {{place.name}}?</p>
|
||||
{{ form.as_p }}
|
||||
<div class="">
|
||||
<input type="submit" class="LP-Button" value="Delete"/>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
{% endblock maincontent %}
|
@ -35,13 +35,11 @@
|
||||
<section class="LP-Main__Sidebar">
|
||||
<nav class="LP-Menu LP-Menu--sidebar">
|
||||
<ul class="LP-Menu__List">
|
||||
<li class="LP-Menu__Item"><a href="/" class="LP-Link"><span class="LP-Link__Text">Home</span></a></li>
|
||||
<li class="LP-Menu__Item"><a href="" class="LP-Link"><span class="LP-Link__Text">About</span></a></li>
|
||||
<li class="LP-Menu__Item"><a href="" class="LP-Link"><span class="LP-Link__Text">Contact</span></a></li>
|
||||
{% block additional_menu_items %}
|
||||
{% endblock additional_menu_items %}
|
||||
<li class="LP-Menu__Item LP-Menu__Item--additional"><a href="{% url 'place_create'%}" class="LP-Link"><span class="LP-Link__Text">Create place</span></a></li>
|
||||
<li class="LP-Menu__Item LP-Menu__Item--additional"><a href="{% url 'place_list'%}" class="LP-Link"><span class="LP-Link__Text">See all places</span></a></li>
|
||||
<li class="LP-Menu__Item"><a href="/" class="LP-Link"><span class="LP-Link__Text">Home</span></a></li>
|
||||
<li class="LP-Menu__Item"><a href="" class="LP-Link"><span class="LP-Link__Text">About</span></a></li>
|
||||
<li class="LP-Menu__Item"><a href="" class="LP-Link"><span class="LP-Link__Text">Contact</span></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</section>
|
||||
|
@ -1,20 +0,0 @@
|
||||
{% extends 'global.html'%}
|
||||
{% load static %}
|
||||
|
||||
{% block title %}Lost Place Deletion{% endblock %}
|
||||
|
||||
{% block maincontent %}
|
||||
|
||||
<form class="LP-Form" method="POST">
|
||||
<fieldset class="LP-Form__Fieldset">
|
||||
<legend class="LP-Form__Legend">Place löschen</legend>
|
||||
{% csrf_token %}
|
||||
<div class="LP-Form__Composition LP-Form__Composition--breakable">
|
||||
<p class="LP-Paragraph">Are you sure you want to delete "{{place.name}}"?</p>
|
||||
<div class="LP-Form__Composition">
|
||||
<input type="submit" class="LP-Button" value="Löschen"/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
{% endblock maincontent %}
|
@ -4,7 +4,7 @@
|
||||
''' Django views. '''
|
||||
from django.shortcuts import render, redirect, get_object_or_404
|
||||
from django.urls import reverse_lazy
|
||||
from django.views.generic.edit import CreateView, UpdateView, DeleteView
|
||||
from django.views.generic.edit import CreateView, UpdateView
|
||||
from django.views import View
|
||||
from django.http import Http404
|
||||
|
||||
@ -24,10 +24,10 @@ class SignUpView(CreateView):
|
||||
template_name = 'signup.html'
|
||||
|
||||
def place_list_view(request,):
|
||||
return render(request, 'place/place_list.html', {'place_list':Place.objects.all()})
|
||||
return render(request, 'placeList.html', {'place_list':Place.objects.all()})
|
||||
|
||||
def place_detail_view(request, pk):
|
||||
return render(request, 'place/place_detail.html', {'place':Place.objects.get(pk=pk)})
|
||||
return render(request, 'placeOverview.html', {'place':Place.objects.get(pk=pk)})
|
||||
|
||||
def hello_world(request):
|
||||
return render(request, 'hello_world.html', {'text':'Hello World!'})
|
||||
@ -41,7 +41,7 @@ class HomeView(View):
|
||||
return render(request, 'home.html', context)
|
||||
|
||||
class PlaceUpdateView(UpdateView):
|
||||
template_name = 'place/place_update.html'
|
||||
template_name = 'update_place.html'
|
||||
model = Place
|
||||
form_class = PlaceForm
|
||||
|
||||
@ -58,7 +58,7 @@ class PlaceCreateView(View):
|
||||
'place_form': place_form,
|
||||
'place_image_form': place_image_form
|
||||
}
|
||||
return render(request, 'place/place_create.html', context)
|
||||
return render(request, 'create_place.html', context)
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
place_form = PlaceForm(request.POST)
|
||||
@ -85,7 +85,7 @@ class PlaceCreateView(View):
|
||||
context = {
|
||||
'form': form_place
|
||||
}
|
||||
return render(request, 'place/place_create.html', context)
|
||||
return render(request, 'create_place.html', context)
|
||||
|
||||
def _apply_multipart_image_upload(self, files, place, submitter):
|
||||
for image in files:
|
||||
@ -96,10 +96,14 @@ class PlaceCreateView(View):
|
||||
)
|
||||
place_image.save()
|
||||
|
||||
class PlaceDeleteView(DeleteView):
|
||||
template_name = 'place/place_delete.html'
|
||||
model = Place
|
||||
form_class = PlaceDeleteForm
|
||||
class PlaceDeleteView(View):
|
||||
#template_name = 'delete_place.html'
|
||||
#model = Place
|
||||
#form_class = PlaceDeleteForm
|
||||
|
||||
def get_success_url(self):
|
||||
return reverse_lazy('place_list')
|
||||
def get(self, request, pk, *args, **kwargs):
|
||||
place = Place.objects.get(pk=pk)
|
||||
place_delete_form = PlaceDeleteForm()
|
||||
|
||||
context = {'place': place, 'form': place_delete_form}
|
||||
return render(request, 'delete_place.html', context)
|
||||
|
@ -5,24 +5,11 @@
|
||||
|
||||
{% block maincontent %}
|
||||
|
||||
<form class="LP-Form" method="POST" enctype="multipart/form-data">
|
||||
<fieldset class="LP-Form__Fieldset">
|
||||
<legend class="LP-Form__Legend">Login</legend>
|
||||
{% csrf_token %}
|
||||
<div class="LP-Form__Composition LP-Form__Composition--breakable">
|
||||
<div class="LP-Form__Field">
|
||||
{% include 'partials/form/inputField.html' with field=form.username %}
|
||||
</div>
|
||||
<div class="LP-Form__Field">
|
||||
{% include 'partials/form/inputField.html' with field=form.password %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="LP-Form__Composition">
|
||||
<input type="submit" class="LP-Button" value="Login"/>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<h2>Login</h2>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<button type="submit">Login</button>
|
||||
</form>
|
||||
|
||||
{% endblock maincontent %}
|
Loading…
Reference in New Issue
Block a user