Skip to content

Commit cba544a

Browse files
author
kadraman
committed
Implement two row navbar (fixes #12)
1 parent ed354d6 commit cba544a

10 files changed

Lines changed: 352 additions & 305 deletions

File tree

iwa/blueprints/auth/templates/auth/login.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ <h2 class="fs-6 fw-normal text-center text-secondary mb-4">Sign in to your accou
6969
</div>
7070
</div>
7171
<div class="col-12">
72-
<p class="m-0 text-secondary text-center">Don't have an account? <a href="#!"
72+
<p class="m-0 text-secondary text-center">Don't have an account? <a href="{{ url_for('auth.register') }}"
7373
class="link-primary text-decoration-none">Sign up</a></p>
7474
</div>
7575
</div>

iwa/blueprints/main/templates/main/index.html

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
<div class="site-blocks-cover" style="background-image: url('/static/img/home_hero_1a.jpg');">
77
<div class="container">
88
<div class="row">
9-
<div class="col-lg-7 mx-auto order-lg-2 py-5">
9+
<div class="col-lg-10 mx-auto order-lg-2 py-5">
1010
<div class="site-block-cover-content text-center">
1111
<h2 class="sub-title">Local Service, Global Reach</h2>
12-
<h1 class="main-title">Welcome To IWA Pharmacy Direct</h1>
12+
<h1 class="main-title">Welcome To <br/>IWA Pharmacy Direct</h1>
1313
</div>
14-
<div class="p-5 text-center bg-body-tertiary rounded-3" style="opacity: 0.9">
15-
{% if session.loggedin %}
16-
<h4>Welcome back</h4>
17-
{% else %}
18-
<h4>Welcome Guest</h4>
19-
{% endif %}
14+
<div class="p-4 text-center bg-body-tertiary rounded-3" style="opacity: 0.9">
15+
<div class="py-2 text-center">
16+
<h4>We are one of the nation’s largest online pharmacies</h4>
17+
<p class="text-secondary">We're here to give you choice and convenience when it comes to everyday healthcare. Find out how our services
18+
can help you today.</p>
19+
</div>
2020
<p class="pt-4">
2121
{% if not session.loggedin %}
2222
<a href="{{ url_for('auth.register') }}" class="btn p-2 btn-outline-info">Register</a>
@@ -30,14 +30,6 @@ <h4>Welcome Guest</h4>
3030
</div>
3131

3232
<div class="site-section bg-light">
33-
<div class="container">
34-
<div class="row py-2 text-center">
35-
<h4>We are one of the nation’s largest online pharmacies</h4>
36-
<p>We're here to give you choice and convenience when it comes to everyday healthcare. Find out how our services
37-
can help you today.</p>
38-
</div>
39-
</div>
40-
4133
<div class="container">
4234
<div class="row align-items-stretch row-cols-1 row-cols-md-3 mb-3 text-center">
4335
<div class="col">

iwa/blueprints/products/templates/products/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
{% block content %}
66
<!-- page title -->
7-
<div class="py-3">
7+
<div class="bg-white py-3">
88
<div class="container">
99
<div class="row">
1010
<div class="col-md-12 mb-0"><a href="{{ url_for('products.index') }}">Shop</a> </div>

iwa/blueprints/products/templates/products/view.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
{% block content %}
66
<!-- page title -->
7-
<div class="py-3">
7+
<div class="bg-white py-3">
88
<div class="container">
99
<div class="row">
1010
<div class="col-md-12 mb-0"><a href="{{ url_for('products.index') }}">Shop</a> <span

iwa/blueprints/users/routes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,9 @@ def load_logged_in_user():
173173
email = session.get("email")
174174
if email is None:
175175
g.user = None
176+
logger.debug("No user is logged in.")
176177
else:
177178
g.user = (
178179
get_db().execute("SELECT * FROM users WHERE email = ?", (email,)).fetchone()
179-
)
180-
logger.debug(f"Loading logged in user {g.user['email']}")
180+
)
181+
logger.debug(f"Loading logged in user {g.user['email']}")

iwa/static/css/app.css

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ a:hover {
6666
color: #fff !important;
6767
}
6868

69+
.btn-nav {
70+
min-width: 75px;
71+
background: transparent;
72+
color: #eee;
73+
text-transform: capitalize;
74+
font-size: 1em;
75+
}
76+
77+
.btn-nav:hover {
78+
text-decoration: underline;
79+
}
80+
6981
.form-control {
7082
height: 43px;
7183
}
@@ -106,7 +118,6 @@ a:hover {
106118
background: #3c3d41;
107119
color: #fff;
108120
position: relative;
109-
z-index: 1000;
110121
}
111122

112123
/* Site Footer */
@@ -203,7 +214,6 @@ a:hover {
203214
.dropdown-submenu:hover .dropdown-menu {
204215
display: block; /* Show the submenu on hover */
205216
}
206-
.navbar{ height: 75px;}
207217

208218
/* Blocks */
209219
.site-blocks-cover {
@@ -243,7 +253,7 @@ a:hover {
243253
}
244254
@media (min-width: 768px) {
245255
.site-blocks-cover h1 {
246-
font-size: 70px;
256+
font-size: 50px;
247257
}
248258
}
249259
.site-blocks-cover p {

iwa/templates/base.html

Lines changed: 315 additions & 278 deletions
Large diffs are not rendered by default.

iwa/templates/includes/sidebar.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,24 @@
44
(url_for('users.security'), 'security', 'bi-lock', 'Security'),
55
(url_for('users.orders'), 'orders', 'bi-bag', 'Orders'),
66
(url_for('users.reviews'), 'reviews', 'bi-chat-square-text', 'Reviews'),
7-
(url_for('users.messages'), 'messages', 'bi-envelope', 'Messages')
7+
(url_for('users.messages'), 'messages', 'bi-envelope', 'Messages'),
8+
(url_for(request.endpoint), 'divider', '', ''),
9+
(url_for('auth.logout'), 'logout', 'bi-box-arrow-right', 'Logout')
810
] -%}
911

1012
<div class="side-menu">
1113
<div class="list-group list-group-flush">
1214
{% for href, id, icon, caption in navigation_bar %}
15+
{% if id == 'divider' %}
16+
<div class="bg-light" style="height: 50px"></div>
17+
{% else %}
1318
<a {% if id == active_page %} class="list-group-item list-group-item-action active" {% else %} class="list-group-item list-group-item-action" {% endif %} href="{{ href|e }}"><i class="bi {{ icon|e }}"></i> {{ caption|e }}
1419
{% if id == 'messages' %}
1520
<span id="unread-message-count" class="badge bg-info">0</span>
1621
<span class="visually-hidden">unread messages</span>
1722
{% endif %}
1823
</a>
24+
{% endif %}
1925
{% endfor %}
2026
</div>
2127
</div>

iwa/utils/view_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ def login_required(view):
3939
"""View decorator that redirects anonymous users to the login page."""
4040
@functools.wraps(view)
4141
def wrapped_view(**kwargs):
42-
if session['email'] is None:
42+
email = session.get("email")
43+
if email is None:
4344
return redirect(url_for("auth.login"))
4445

4546
return view(**kwargs)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ qrcode==8.0
1414
pytest==8.1.1
1515
coverage==7.5.1
1616
openai==1.76.2
17-
tiktoken==0.7.0
17+
tiktoken==0.9.0
1818
cachelib==0.9.0

0 commit comments

Comments
 (0)