hanze/muizenval

first merge (27651e2a198cfb7141f59eab3a18b8b7124cfef9)
Repositories

commit 27651e2a198cfb7141f59eab3a18b8b7124cfef9
parent 9f26274c0c34c492978eb28c059104d83c1f2365
Author: Friedel Schön <[email protected]>
Date:   Tue, 28 Jun 2022 15:32:17 +0200

first merge

Diffstat:
Mserver/routes.py10+++++++++-
Mserver/site.db0
Mserver/static/main.css101+++++++++++++++++++++++++++++++------------------------------------------------
Mserver/templates/contact.html2++
Aserver/templates/home.html0
Mserver/templates/layout.html156+++++++++++++++++++++++++++-----------------------------------------------------
6 files changed, 103 insertions(+), 166 deletions(-)

diff --git a/server/routes.py b/server/routes.py @@ -36,6 +36,14 @@ def about(): return render_template('about.html', title='Over ons') +""" home.html route """ + + [email protected]("/home") +def home(): + return render_template('home.html', title='Home') + + """ register.html route """ @@ -219,7 +227,7 @@ def trap_delete(trap_id): @app.route('/contact') @login_required def contact(): - return render_template('contact.html') + return render_template('contact.html', contact=current_user.contact_class()) """ admin.html route """ 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 @@ -1,85 +1,58 @@ -body { - background: #fafafa; - color: #333333; - margin-top: 5rem; - font-family: 'Source Sans Pro'; +body{ + background: #eee; } -code { - font-family: 'Source Code Pro'; - color: inherit; +#side_nav{ + background: #000; + width: 250px; + min-height: 1024px; } -h1, h2, h3, h4, h5, h6 { - color: #444444; -} +nav{ + margin-bottom: 10px; -nav { } -nav code { - font-size: 16pt; +.content{ + min-height: 100vh; + width: 100%; } +hr.h-color{ + background:#eee -nav a { - color: rgb(0, 0, 0); } -nav a:hover { - color: rgb(0, 0, 0); - text-decoration: underline; -} +.col-7 { -/*nav a.active { - color: #fff; - font-weight: 600; -}*/ + padding-top: 15px; -.content-section { - background: #ffffff; - padding: 10px 20px; - border: 1px solid #dddddd; - border-radius: 3px; - margin-bottom: 20px; } +.sidebar li.active{ + background:#eee; + border-radius: 8px; -.article-title { - color: #444444; } -a.article-title:hover { - color: #428bca; - text-decoration: none; +.sidebar li.active a, .sidebar li.active a:hover { +color:#000 } -.article-content { - white-space: pre-line; +.sidebar li a{ +color:#fff; } -.article-img { - height: 65px; - width: 65px; - margin-right: 16px; -} -.article-metadata { - padding-bottom: 1px; - margin-bottom: 4px; - border-bottom: 1px solid #e3e3e3 +.content-section { + background: #ffffff; + padding: 10px 20px; + border: 1px solid #dddddd; + border-radius: 3px; + margin-bottom: 20px; } -.article-metadata a:hover { - color: #333; - text-decoration: none; -} -.article-svg { - width: 25px; - height: 25px; - vertical-align: middle; -} .account-img { height: 125px; @@ -101,8 +74,15 @@ a.article-title:hover { border: #aaa solid 1px; } -#sidebar { - min-width: 250px; - max-width: 250px; - min-height: 100vh; -} -\ No newline at end of file +@media(max-width: 767px){ + #side_nav{ + margin-left: -250px; + position: fixed; + min-height: 100vh; + z-index: 1; + } + #side_nav.active{ + margin-left: 0; + } + } + diff --git a/server/templates/contact.html b/server/templates/contact.html @@ -4,6 +4,7 @@ <article class="media content-section"> <div class="media-body"> <h2>Uw contactgegevens</h2> + {% if contact %} <p> <b>{{ contact.name }}</b> </p> @@ -16,6 +17,7 @@ <p> {{ contact.address.replace('\n', '<br>') | safe }} </p> + {% endif %} </div> </article> {% endwith %} diff --git a/server/templates/home.html b/server/templates/home.html diff --git a/server/templates/layout.html b/server/templates/layout.html @@ -61,116 +61,64 @@ </head> <body> - <nav class="navbar fixed-top bg-light"> - <div class="container"> - <a class="navbar-brand" href="{{ url_for('index') }}"> - <img src="/static/logo.svg" alt="" width="50%" height="50%"> - </a> - <ul class="nav nav-pills"> - {% if not current_user.is_authenticated %} - <li class="nav-item"> - <a class="nav-link active" href="{{ url_for('login') }}">Login</a> - </li> - - <li class="nav-item"> - <a class="nav-link" href="{{ url_for('register') }}">Registeren</a> - </li> + + + <div class="main-container d-flex"> + <div class="sidebar" id="side_nav"> + <div class="header-box px-2 pt-3 pb-4"> + <h1 class="fs-4"><span class="bg-white text-dark rounded shadow px-2 me-2">B</span> <span + class="text-white">BENNI</span></h1> + + </div> + + <ul class="list-unstyled px-2"> + <li class=""><a href="{{ url_for('index') }}" class="text-decoration-none px-3 py-2 d-block"><i + class="far fa-map-marker-question"></i>Home</a></li> + <li class=""><a href="{{ url_for('about') }}" class="text-decoration-none px-3 py-2 d-block"><i + class="far fa-map-marker-question"></i>Over ons</a></li> + + {% if current_user.is_authenticated %} + <li class=""><a href="{{ url_for('traps') }}" class="text-decoration-none px-3 py-2 d-block"><i + class="far fa-tachometer-alt"></i>Dashboard</a></li> + <li class=""><a href="#" class="text-decoration-none px-3 py-2 d-block"><i + class="far fa-plug"></i>Koppel een val</a></li> + <li class=""><a href="{{ url_for('contact') }}" class="text-decoration-none px-3 py-2 d-block"><i + class="far fa-address-book"></i>Contact opnemen</a></li> + {% endif %} + </ul> + <hr class="h-color mx-2"> + + <ul class="list-unstyled px-2"> + {% if current_user.is_authenticated %} + <li class=""><a href="{{ url_for('account') }}" class="text-decoration-none px-3 py-2 d-block"><i + class="far fa-cogs"></i>Instellingen</a></li> + <li class=""><a href="{{ url_for('logout') }}" class="text-decoration-none px-3 py-2 d-block"><i + class="fas fa-sign-out"></i>Uitloggen</a></li> {% else %} - <li class="nav-item"> - <a class="nav-link active" href="{{ url_for('logout') }}">Logout</a> - </li> + <li class=""><a href="{{ url_for('login') }}" class="text-decoration-none px-3 py-2 d-block"><i + class="fas fa-sign-out"></i>Inloggen</a></li> + <li class=""><a href="{{ url_for('register') }}" class="text-decoration-none px-3 py-2 d-block"><i + class="fas fa-sign-out"></i>Registeren</a></li> {% endif %} </ul> + <hr class="h-color mx-2"> + </div> - </nav> - - <div class="container" style="padding-top:20px;"> - <div class="row"> - <!-- sidebar --> - <div class="col-3"> - <ul class="nav nav-pills flex-column nav-justified"> - {% if current_user.is_authenticated %} - <!--<li class="nav-item"> - <a class="nav-link" href="{{ url_for('account') }}"><b>{{current_user.name}}</b></a> - </li>--> - <li class="nav-item"> - <a class="nav-link" href="{{ url_for('traps') }}">Dashboard</a> - </li> - <li class="nav-item"> - <a class="nav-link" href="#">Koppel een val</a> - </li> - {% if current_user.contact %} - <li class="nav-item"> - <a class="nav-link" href="{{ url_for('contact') }}">Contact opnemen</a> - </li> - {% endif %} - {% if current_user.admin %} - <li class="nav-item"> - <a class="nav-link" href="{{ url_for('admin') }}">Gebruikers beheerden</a> - </li> - {% endif %} - {% endif %} - <li class="nav-item"> - <a class="nav-link" href="{{ url_for('about') }}">Over ons</a> - </li> - {% if current_user.is_authenticated %} - <div class="dropdown-divider"></div> - <div class="dropdown"> - <li class="nav-item"> - <a class="nav-link dropdown-toggle" href="#" role="button" id="account-dropdown" - data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> - <b>{{current_user.name}}</b> - </a> - - <div class="dropdown-menu" aria-labelledby="account-dropdown"> - <a class="dropdown-item" href="{{ url_for('account') }}">Instellingen</a> - <div class="dropdown-divider"></div> - <a class="dropdown-item" href="{{ url_for('logout') }}">Uitloggen</a> - </div> - </li> - </div> - {% endif %} - </ul> - </div> - <!-- - <ul class="nav nav-pills flex-column" id="myTab" role="tablist"> - <li class="nav-item"> - <a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="true">Home</a> - </li> - <li class="nav-item"> - <a class="nav-link" id="profile-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile" aria-selected="false">Profile</a> - </li> - <li class="nav-item"> - <a class="nav-link" id="messages-tab" data-toggle="tab" href="#messages" role="tab" aria-controls="messages" aria-selected="false">Messages</a> - </li> - <li class="nav-item"> - <a class="nav-link" id="settings-tab" data-toggle="tab" href="#settings" role="tab" aria-controls="settings" aria-selected="false">Settings</a> - </li> - </ul> - - <div class="tab-content"> - <div class="tab-pane active" id="home" role="tabpanel" aria-labelledby="home-tab">...1</div> - <div class="tab-pane" id="profile" role="tabpanel" aria-labelledby="profile-tab">..2.</div> - <div class="tab-pane" id="messages" role="tabpanel" aria-labelledby="messages-tab">.4..</div> - <div class="tab-pane" id="settings" role="tabpanel" aria-labelledby="settings-tab">.3..</div> - </div> - --> - <script> - $(function () { - $('#myTab li:last-child a').tab('show') - }) - </script> - <!-- content--> - <div class="col-7"> - {% for category, message in get_flashed_messages(with_categories=true) %} - <div class="alert alert-{{ category }}"> - {{ message }} - </div> - {% endfor %} - {% block content %}{% endblock %} + <!-- content--> + <div class="col-7"> + {% for category, message in get_flashed_messages(with_categories=true) %} + <div class="alert alert-{{ category }}"> + {{ message }} </div> + {% endfor %} + {% block content %}{% endblock %} </div> - </div> + + + <script> src = "https:://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"</script> + <script> src = "https://ajax/googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"</script> + + </body> </html> \ No newline at end of file