Prześlij pliki do 'templates'

This commit is contained in:
Sławomir Łopata 2023-02-01 20:00:08 +01:00
parent e56e1cbd3d
commit a2a69f9058
5 changed files with 252 additions and 0 deletions

22
templates/add.html Normal file
View File

@ -0,0 +1,22 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Admin</title>
</head>
<body>
<h2>Dodaj Produkt</h2>
<form action="/addItem" method="POST" enctype="multipart/form-data">
Nazwa: <input type="text" name="name"><br>
Cena: <input type="text" name="price"><br>
Description: <textarea name="description" rows=3 cols="40"></textarea><br>
Zdiecie: <input type="file" name="image"><br>
Zbiór: <input type="text" name="stock"><br>
Kategorie: <select name="category">
{% for row in categories %}
<option value="{{row[0]}}">{{row[1]}}</option>
{% endfor %}
</select><br>
<input type="submit">
</form>
</body>
</html>

View File

@ -0,0 +1,17 @@
<html>
<head>
<title>Zmień hasło</title>
<script src={{ url_for('static', filename='js/changePassword.js') }}></script>
</head>
<body>
<h1>Zmień hasło</h1>
<p>{{ msg }}</p>
<form action={{ url_for('changePassword') }} method="POST" onsubmit="return validate()">
<p>stare hasło: <input type="password" name="oldpassword"></p>
<p>nowe hasło: <input type="password" name="newpassword" id="newpassword"></p>
<p>powtórz hasło: <input type="password" name="cpassword" id="cpassword"></p>
<input type="submit" value="Save">
</form>
<a href="{{ url_for('profileHome') }}">Idż do Profilu</a>
</body>
</html>

View File

@ -0,0 +1,72 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Kategorie: {{categoryName}}</title>
<link rel="stylesheet" href={{ url_for('static', filename='css/home.css') }} />
<link rel="stylesheet" href={{ url_for('static', filename='css/topStyle.css') }} />
</head>
<body>
<div id="title">
<a href="/">
<img id="logo" src= {{ url_for('static', filename='images/logo.png') }} />
</a>
<form>
<input id="searchBox" type="text" name="searchQuery">
<input id="searchButton" type="submit" value="Search">
</form>
<div id="kart">
<a class="link" href="/koszyk">
<img src={{url_for('static', filename='images/koszyk_zakupowy.png')}} id="koszykIcon" />
{{noOfItems}}
</a>
</div>
{% if not loggedIn %}
<div id="signInButton">
<a class="link" href="/loginForm">Zaloguj się</a>
</div>
{% else %}
<div class="dropdown">
<button class="dropbtn">Cześć, <br>{{firstName}}</button>
<div class="dropdown-content">
<a href="/account/orders">Twoje zamówienie</a>
<a href="/account/profile">Twój Profil</a>
<hr>
<a href="/logout">Wyloguj się</a>
</div>
</div>
{% endif %}
</div>
<div>
<h2>Produkty z Kategorii {{categoryName}}:</h2>
{% for itemData in data %}
<table>
<tr id="productName">
{% for row in itemData %}
<td>
{{row[1]}}
</td>
{% endfor %}
</tr>
<tr id="productImage">
{% for row in itemData %}
<td>
<a href="/productDescription?productId={{row[0]}}">
<img src={{ url_for('static', filename='uploads/' + row[3]) }} id="itemImage" />
</a>
</td>
{% endfor %}
</tr>
<tr id="productPrice">
{% for row in itemData %}
<td>
${{row[2]}}
</td>
{% endfor %}
</tr>
</table>
{% endfor %}
</div>
</body>
</html>

View File

@ -0,0 +1,59 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Edytuj Profil </title>
<link rel="stylesheet" href={{ url_for('static', filename='css/editProfile.css') }} />
<link rel="stylesheet" href={{ url_for('static', filename='css/topStyle.css') }} />
</head>
<body>
<div id="title">
<a href="/">
<img id="logo" src= {{ url_for('static', filename='images/logo.png') }} />
</a>
<form>
<input id="searchBox" type="text" name="searchQuery">
<input id="searchButton" type="submit" value="Search">
</form>
<div id="kart">
<a class="link" href="/koszyk">
<img src={{url_for('static', filename='images/koszyk_zakupowy.png')}} id="koszykIcon" />
{{noOfItems}}
</a>
</div>
{% if not loggedIn %}
<div id="signInButton">
<a class="link" href="/loginForm">Zaloguj się</a>
</div>
{% else %}
<div class="dropdown">
<button class="dropbtn">Cześć, <br>{{firstName}}</button>
<div class="dropdown-content">
<a href="/account/orders">Twoje zamówienie</a>
<a href="/account/profile">Twój Profil</a>
<hr>
<a href="/logout">Wyloguj się</a>
</div>
</div>
{% endif %}
</div>
<div class="display">
<h2>Edytuj Profil</h2>
<form action="/updateProfile" method="POST">
<p>Email:<input type="email" name="email" value={{profileData[1]}} readonly="readonly"></p>
<p>imie:<input type="text" name="firstName" value={{profileData[2]}}></p>
<p>nazwisko: <input type="text" name="lastName" value={{profileData[3]}}></p>
<p>Adres 1: <input type="text" name="address1" value={{profileData[4]}}></p>
<p>Adres 2: <input type="text" name="address2" value={{profileData[5]}}></p>
<p>Kod pocztowy: <input type="text" name="zipcode" value={{profileData[6]}}></p>
<p>Miasto: <input type="text" name="city" value={{profileData[7]}}></p>
<p>Ulica: <input type="text" name="state" value={{profileData[8]}}></p>
<p>Kraj: <input type="text" name="country" value={{profileData[9]}}></p>
<p>Numer telefonu: <input type="text" name="phone" value={{profileData[10]}}></p>
<input type="submit" value="Save">
</form>
</div>
</body>
</html>

82
templates/home.html Normal file
View File

@ -0,0 +1,82 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Witaj</title>
<link rel="stylesheet" href={{ url_for('static', filename='css/home.css') }} />
<link rel="stylesheet" href={{ url_for('static', filename='css/topStyle.css') }} />
</head>
<body>
<div id="title">
<a href="/">
<img id="logo" src= {{ url_for('static', filename='images/logo.png') }} />
</a>
<form>
<input id="searchBox" type="text" name="searchQuery">
<input id="searchButton" type="submit" value="Search">
</form>
<div id="kart">
<a class="link" href="/koszyk">
<img src={{url_for('static', filename='images/koszyk_zakupowy.png')}} id="koszykIcon" />
{{noOfItems}}
</a>
</div>
{% if not loggedIn %}
<div id="signInButton">
<a class="link" href="/loginForm">Zaloguj się</a>
</div>
{% else %}
<div class="dropdown">
<button class="dropbtn">Cześć, <br>{{firstName}}</button>
<div class="dropdown-content">
<a href="/account/orders">Twoje zamówienie</a>
<a href="/account/profile">Twój Profil</a>
<hr>
<a href="/logout">Wyloguj się</a>
</div>
</div>
{% endif %}
</div>
<div class="display">
<div class="displayCategory">
<h2>Kupuj według kategorii: </h2>
<ul>
{% for row in categoryData %}
<li><a href="/displayCategory?categoryId={{row[0]}}">{{row[1]}}</a></li>
{% endfor %}
</ul>
</div>
<div>
<h2>Przedmioty</h2>
{% for data in itemData %}
<table>
<tr id="productName">
{% for row in data %}
<td>
{{row[1]}}
</td>
{% endfor %}
</tr>
<tr id="productImage">
{% for row in data %}
<td>
<a href="/productDescription?productId={{row[0]}}">
<img src={{ url_for('static', filename='uploads/' + row[4]) }} id="itemImage" />
</a>
</td>
{% endfor %}
</tr>
<tr id="productPrice">
{% for row in data %}
<td>
${{row[2]}}
</td>
{% endfor %}
</tr>
</table>
{% endfor %}
</div>
</div>
</body>
</html>