commit 429d04333ce8c34492568327c9077b7a45886a08
parent 0231533b92e53ccbd28b2322c17aa82d23a48542
Author: Friedel Schön <[email protected]>
Date: Wed, 11 May 2022 13:23:37 +0200
remove old stuff & fancy style
Diffstat:
5 files changed, 70 insertions(+), 104 deletions(-)
diff --git a/readme.md b/readme.md
@@ -6,7 +6,7 @@ Dit is een dev-server, dus run je met `debug=True`-flag!
**Deze repository clonen:**
```
-$ git clone https://github.com/friedelschoen/iot-project
+$ git clone https://github.com/friedelschoen/muizenval.io/
```
**Alle afhankelijkheden installeren:**
diff --git a/server/models.py b/server/models.py
@@ -12,7 +12,7 @@ def load_user(user_id):
class User(db.Model, UserMixin):
id = db.Column(db.Integer, primary_key=True)
- type = db.Column(db.String(7), nullable=False, default="client") # client, catcher, admin
+ type = db.Column(db.String(7), nullable=False, default="guest") # guest, client, catcher, admin
email = db.Column(db.String(120), unique=True, nullable=False)
name = db.Column(db.String(20), unique=True, nullable=False)
password = db.Column(db.String(60), nullable=False)
diff --git a/server/site.db b/server/site.db
Binary files differ.
diff --git a/server/static/main.css b/server/static/main.css
@@ -2,29 +2,49 @@ body {
background: #fafafa;
color: #333333;
margin-top: 5rem;
+
+ font-family: 'Source Sans Pro';
+}
+
+code {
+ font-family: 'Source Code Pro';
}
h1, h2, h3, h4, h5, h6 {
color: #444444;
}
-.bg-steel {
- background-color: #33bc85;
+nav {
+/* background-color: #33bc85; */
+background: repeating-linear-gradient(
+ 45deg,
+ #33bc85,
+ #33bc85 10px,
+ #2a825f 10px,
+ #2a825f 20px
+);
+color: #fff;
+font-size: 15pt;
}
-.site-header .navbar-nav .nav-link {
- color: #eeeeee;
+nav code {
+ font-size: 16pt;
}
-.site-header .navbar-nav .nav-link:hover {
- color: #ffffff;
- text-decoration: underline;
+nav a {
+ color: #fff;
}
-.site-header .navbar-nav .nav-link.active {
- font-weight: 500;
+nav a:hover {
+ color: #fff;
+ text-decoration: underline;
}
+/*nav a.active {
+ color: #fff;
+ font-weight: 600;
+}*/
+
.content-section {
background: #ffffff;
padding: 10px 20px;
@@ -78,68 +98,4 @@ a.article-title:hover {
.account-heading {
font-size: 2.5rem;
-}
-
-.calendar {
- background-color: #fafafa;
- width: 100%;
- color: #818182;
- border: #dddddd solid 1px;
-}
-
-.calendar .weekend {
- background-color: #eee;
-}
-
-.calendar th {
- border-bottom: #ddd solid 1px;
-}
-
-.calendar th, td {
- /*border: #333 solid 1px;*/
- text-align: center;
- width: 100px;
- position: relative;
-}
-
-.calendar .course {
- background: rgb(84, 230, 84);
- border: #444 solid 1px;
- color: #444
-}
-
-.calendar td .hover-day {
- visibility: hidden;
- background-color: #444;
- color: #eee;
- text-align: center;
- border-radius: 6px;
- padding: 5px 0;
-
- width: 120px;
- bottom: 100%;
- left: 50%;
- margin-left: -60px; /* Use half of the width (120/2 = 60), to center the tooltip */
- padding: 5px 0;
-
-
- /* Position the tooltip */
- position: absolute;
- z-index: 1;
-}
-
-.calendar td .hover-day::after {
- content: "";
- position: absolute;
- top: 100%;
- left: 50%;
- margin-left: -5px;
- border-width: 5px;
- border-style: solid;
- border-color: #444 transparent transparent transparent;
-}
-
-
-.calendar td:hover .hover-day {
- visibility: visible;
}
\ No newline at end of file
diff --git a/server/templates/layout.html b/server/templates/layout.html
@@ -11,6 +11,12 @@
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='main.css') }}">
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='openmoji/openmoji.css') }}">
+ <!-- Google Font: Source Sans Pro -->
+ <link rel="preconnect" href="https://fonts.googleapis.com">
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
+ <link
+ href="https://fonts.googleapis.com/css2?family=Source+Code+Pro&family=Source+Sans+Pro:ital,wght@0,400;0,600;1,400;1,600&display=swap"
+ rel="stylesheet">
{% if title %}
<title>muizenval.io - {{ title }}</title>
{% else %}
@@ -20,7 +26,7 @@
<body>
<header class="site-header">
- <nav class="navbar navbar-expand-md navbar-dark bg-steel fixed-top">
+ <nav class="navbar navbar-expand-md fixed-top">
<div class="container">
<a class="navbar-brand mr-4" href="/">
<code>muizenval.io</code>
@@ -59,42 +65,46 @@
<div class="col-md-4">
<div class="content-section">
<h3>Welkom <b>{{ current_user.name if current_user.is_authenticated else 'gast' }}</b>!</h3>
- {% if current_user.is_authenticated %}
+ {% if not current_user.is_authenticated %}
+ <p>
+ Hallo! Jij bent nog niet ingelogd. Heb jij al een account moet jij bovenrechts op inloggen
+ klikken.
+ </p>
+ <p>
+ Heb jij al onze producten gekocht maar jij hebt nog geen account? Je kan makkelijk een account
+ registreren en je muizenvallen inschrijven!
+ </p>
+ <p>
+ Jij bent nieuw en wilt ons producten kopen of testen? Ga naar ons shop om onze aanbiedingen in
+ te kunnen zien.
+ </p>
+ {% else %}
<p class='text-muted'>
<ul class="list-group">
- <li class="list-group-item list-group-item-light"><a
- href="{{ url_for('account') }}">Instellingen</a></li>
- {% if current_user.type == 'teacher' or current_user.type == 'admin' %}
- <li class="list-group-item list-group-item-light"><a
- href="{{ url_for('course_overview') }}">Lesoverzicht</a></li>
+ <li class="list-group-item list-group-item-light">
+ <a href="{{ url_for('account') }}">Profielinstellingen</a>
+ </li>
+ {% if current_user.type in [ 'client', 'catcher' ] %}
+ <li class="list-group-item list-group-item-light">
+ <a href="#">Uw muizenvallen</a>
+ </li>
+ {% endif %}
+ {% if current_user.type == 'catcher' %}
+ <li class="list-group-item list-group-item-light">
+ <a href="#">Uw cliënten</a>
+ </li>
{% endif %}
{% if current_user.type == 'admin' %}
- <li class="list-group-item list-group-item-light"><a href="{{ url_for('admin') }}">Profielen
- bewerken</a></li>
+ <li class="list-group-item list-group-item-light">
+ <a href="#">Gebruikers bewerken</a>
+ </li>
+ <li class="list-group-item list-group-item-light">
+ <a href="#">Statusaanvragen</a>
+ </li>
{% endif %}
</ul>
</p>
{% endif %}
- {#
- {% if current_user.is_authenticated %}
- <table class='calendar'>
- <tr>
- {% for d, day in calendar['weekdays'] %}
- <th class="{{ 'weekend' if d >= 5 }}">{{ day }}</th>
- {% endfor %}
- </tr>
- {% for row in calendar['rows'] %}
- <tr>
- {% for d, day, course in row %}
- <td class="{{ 'weekend' if d >= 5 }} {{ 'course' if course and day }}">
- {{ day if day }}
- {% if course %}<span class='hover-day'>{{ course }}</span>{% endif %}
- </td>
- {% endfor %}
- </tr>
- {% endfor %}
- </table>
- {% endif %}#}
</div>
</div>
</div>