-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
65 lines (61 loc) · 1.95 KB
/
index.html
File metadata and controls
65 lines (61 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{% include "header.html" %}
<!-- Page Header-->
<header
class="masthead"
style="background-image: url('../static/assets/img/home-bg.jpg')"
>
<div class="container position-relative px-4 px-lg-5">
<div class="row gx-4 gx-lg-5 justify-content-center">
<div class="col-md-10 col-lg-8 col-xl-7">
<div class="site-heading">
<h1>Blog</h1>
<span class="subheading">Example Text</span>
</div>
</div>
</div>
</div>
</header>
<!-- Main Content-->
<div class="container px-4 px-lg-5">
<div class="row gx-4 gx-lg-5 justify-content-center">
<div class="col-md-10 col-lg-8 col-xl-7">
<!-- Post preview-->
{% for post in all_posts %}
<div class="post-preview">
<a href="{{ url_for('show_post', post_id=post.id) }}">
<h2 class="post-title">{{ post.title }}</h2>
<h3 class="post-subtitle">{{ post.subtitle }}</h3>
</a>
<p class="post-meta">
Posted by
<!-- post.author.name is now a User object -->
<a href="#">{{post.author.name}}</a>
on {{post.date}}
<!-- Only show delete button if user id is 1 (admin user) -->
{% if current_user.id == 1: %}
<a href="{{url_for('delete_post', post_id=post.id) }}">✘</a>
{% endif %}
</p>
</div>
<!-- Divider-->
<hr class="my-4" />
{% endfor %}
<!-- New Post -->
<!-- Only show Create Post button if user id is 1 (admin user) -->
{% if current_user.id == 1: %}
<div class="d-flex justify-content-end mb-4">
<a
class="btn btn-primary float-right"
href="{{url_for('add_new_post')}}"
>Create New Post</a
>
</div>
{% endif %}
<!-- Pager-->
<div class="d-flex justify-content-end mb-4">
<a class="btn btn-secondary text-uppercase" href="#!">Older Posts →</a>
</div>
</div>
</div>
</div>
{% include "footer.html" %}