add some colors

This commit is contained in:
Norbert 2020-06-20 07:48:31 +02:00
parent 680c586bb3
commit eeb9febc96
11 changed files with 358 additions and 21 deletions

View File

@ -6,13 +6,76 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Search Photos</title>
</head>
<style>
body {
margin: 0;
font-family: sans-serif;
}
form {
padding: 20px;
margin: 30px;
border: 1px solid #dedede;
border-radius: 10px;
display: flex;
flex-direction: column;
}
form label {
margin: 20px 0 5px 0;
color: #2e2e2e;
font-size: 16px;
font-family: sans-serif;
}
form input[type=submit] {
margin: 25px 0 0 0;
color: white;
background-color: #0077ff;
padding: 10px;
font-size: 16px;
font-weight: bold;
border: none;
border-radius: 5px;
}
ul{
padding: 0;
list-style: none;
margin: 30px;
}
li{
display: flex;
padding: 20px;
border: 1px solid #dedede;
border-radius: 5px;
margin-bottom: 15px;
align-items: flex-start;
}
li img{
max-width: 250px;
}
li div{
margin-left: 20px;
display: flex;
flex-direction: column;
}
li div a{
padding: 7px 14px;
background-color: #0083ff;
color: white;
font-family: sans-serif;
text-decoration: none;
border-radius: 5px;
}
</style>
<body>
{% if form %}
<form action="/change" method="post">
{% csrf_token %}
{{ form }}
<input type="submit" value="Submit">
<input type="submit" value="Wybierz">
</form>
{% endif %}
{% if meta %}
@ -23,6 +86,8 @@
{% for nr in n.1 %}
<p>{{ nr }}</p>
{% endfor %}
<a href="change/{{n.2}}">Zmień</a>
</div>
</li>
{% endfor %}

View File

@ -6,24 +6,108 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Search Photos</title>
</head>
<style>
body {
margin: 0;
font-family: sans-serif;
}
.wrapper {
padding: 20px;
margin: 30px;
border: 1px solid #dedede;
border-radius: 10px;
display: flex;
flex-direction: column;
align-items: flex-start;
}
form{
display: flex;
flex-direction: column;
align-items: flex-start;
}
span{
display: block;
padding: 10px;
border-radius: 5px;
border: 1px solid #009aff;
background-color: #97ccff;
}
form label {
margin: 20px 0 5px 0;
color: #2e2e2e;
font-size: 16px;
font-family: sans-serif;
}
form input[type=submit] {
margin: 25px 0 0 0;
color: white;
background-color: #0077ff;
padding: 10px;
font-size: 16px;
font-weight: bold;
border: none;
border-radius: 5px;
}
ul {
padding: 0;
list-style: none;
margin: 30px;
}
li {
display: flex;
padding: 20px;
border: 1px solid #dedede;
border-radius: 5px;
margin-bottom: 15px;
}
li img {
max-width: 250px;
}
li div {
margin-left: 20px;
display: flex;
flex-direction: column;
}
li div a {
padding: 7px 14px;
background-color: #0083ff;
color: white;
font-family: sans-serif;
text-decoration: none;
border-radius: 5px;
}
</style>
<body>
{% if foto %}
<img src="{{ foto }}" />
<p>Znalezione wartości:</p>
<span>
{% for n in numery %}
{{ n }},
{% endfor %}
<p>Nowe wartości (po przecinku): </p>
<form action="/change/{{ photoid }}" method="post">
{% csrf_token %}
{{ form }}
<input type="submit" value="Submit">
</form>
<div class="wrapper">
<img src="{{ foto }}" />
<p>Znalezione wartości:</p>
<span>
{% for n in numery %}
{{ n }},
{% endfor %}
</span>
<p>Nowe wartości (po przecinku): </p>
<form action="/change/{{ photoid }}" method="post">
{% csrf_token %}
{{ form }}
<input type="submit" value="Zamień">
</form>
</div>
</span>
{% endif %}
</body>

View File

@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Search Photos</title>
</head>
<style>
body {
margin: 0;
font-family: sans-serif;
}
.wrapper {
height: 100vh;
width: 100vw;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
p {
font-size: 88px;
font-weight: bold;
;
}
a {
padding: 7px 14px;
background-color: #0083ff;
color: white;
font-family: sans-serif;
text-decoration: none;
border-radius: 5px;
}
</style>
<body>
<div class="wrapper">
<p>Bład</p>
<a href="/">Wróć do głównej</a>
</div>
</body>
</html>

View File

@ -5,12 +5,27 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RunPhoto</title>
</head>
<body>
<style>
div a{
padding: 5px 0;
display: inline-block;
color: #2e2e2e;
text-decoration: none;
font-family: sans-serif;
font-size: 16px;
}
</style>
<body style="margin: 0px;">
{% if user.is_authenticated %}
Zalogowany 😎 <br />
<a href="{% url 'upload' %}">Załaduj zdjęcia</a><br />
<a href="{% url 'search' %}">Przeszukaj bazę</a><br />
<a href="{% url 'change' %}">Koryguj</a>
<p style="width: 100%; background-color: #008eff; color: white; padding: 15px 20px; margin: 0;font-family: sans-serif;">Zalogowany 😎 </p><br />
<div style="padding: 20px;border: 1px solid #dedede;
border-radius: 10px;
margin: 0 30px 0 30px;">
<a href="{% url 'upload' %}">Załaduj zdjęcia</a><br />
<a href="{% url 'search' %}">Przeszukaj bazę</a><br />
<a href="{% url 'change' %}">Koryguj</a>
</div>
{% else %}
Gość 🏃‍♀️<br />
<a href="{% url 'search' %}">Przeszukaj bazę</a>

View File

@ -6,13 +6,43 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Search Photos</title>
</head>
<style>
body{
margin: 0;
}
form{
padding: 20px;
margin: 30px;
border: 1px solid #dedede;
border-radius: 10px;
display: flex;
flex-direction: column;
}
form label{
margin: 20px 0 5px 0;
color: #2e2e2e;
font-size: 16px;
font-family: sans-serif;
}
form input[type=submit]{
margin: 25px 0 0 0;
color: white;
background-color: #0077ff;
padding: 10px;
font-size: 16px;
font-weight: bold;
border: none;
border-radius: 5px;
}
</style>
<body>
{% if form %}
<form action="/search" method="post" >
{% csrf_token %}
{{ form }}
<input type="submit" value="Submit">
<input type="submit" value="Szukaj">
</form>
{% endif %}
{% if foto %}

View File

@ -0,0 +1,49 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Search Photos</title>
</head>
<style>
body {
margin: 0;
font-family: sans-serif;
}
.wrapper {
height: 100vh;
width: 100vw;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
p{
font-size: 88px;
font-weight: bold;;
}
a {
padding: 7px 14px;
background-color: #0083ff;
color: white;
font-family: sans-serif;
text-decoration: none;
border-radius: 5px;
}
</style>
<body>
<div class="wrapper">
<p>Sukces</p>
<a href="/">Wróć do głównej</a>
</div>
</body>
</html>

View File

@ -5,11 +5,42 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Upload Photos</title>
</head>
<style>
body{
margin: 0;
}
form{
padding: 20px;
margin: 30px;
border: 1px solid #dedede;
border-radius: 10px;
display: flex;
flex-direction: column;
}
form label{
margin: 20px 0 5px 0;
color: #2e2e2e;
font-size: 16px;
font-family: sans-serif;
}
form input[type=submit]{
margin: 25px 0 0 0;
color: white;
background-color: #0077ff;
padding: 10px;
font-size: 16px;
font-weight: bold;
border: none;
border-radius: 5px;
}
</style>
<body>
<form action="/upload" method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form }}
<input type="submit" value="Submit">
<input type="submit" value="Dodaj">
</form>
</body>
</html>

View File

@ -10,6 +10,8 @@ urlpatterns = [
path('search', views.searchPhotos, name="search"),
path('change', views.changePhotos, name="change"),
path('change/<int:photo>', views.changePhotoID, name="changeid"),
path('success/', views.ss, name="ss"),
path('failed/', views.ff, name="ff"),

View File

@ -112,6 +112,7 @@ def changePhotos(request):
for numer in pm:
numery.append(numer.meta_value)
meta.append(numery)
meta.append(zdjecie.id)
imgMeta.append(meta)
return render(request, 'change.html', {'meta': imgMeta})
@ -160,3 +161,12 @@ def changePhotoID(request, photo):
return HttpResponseRedirect('/failed/')
return render(request, 'changeid.html', {'photoid':photo,'foto': foto, 'numery': numery, 'form': form})
def ss(request):
return render(request, 'sukces.html')
def ff(request):
return render(request, 'failed.html')