generated from Code-Institute-Org/gitpod-full-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
profile.html
68 lines (64 loc) · 4.27 KB
/
profile.html
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
66
67
68
{% extends "base.html" %}
{% block content %}
<!-- codes below from materializecss.com and CI tutorials -->
<h3 class="center-align blue-grey-text text-lighten-5">{{ username.capitalize() }}'s Profile</h3>
<div class="row container">
<div class="col s12">
<ul class="collapsible popout">
{% for post in posts|sort(reverse=true, attribute="date_post") %}
{% if session.user|lower == post.posted_by|lower %}
<li>
<div class="collapsible-header blue-grey-text text-lighten-5">
<div class="row valign-wrapper">
<div class="col s12 m3 img-container">
<img src="{{ post.image_link }}" alt="{{ post.image_title }}" class="materialboxed responsive-img">
<span>{{ post.image_title }}</span>
</div>
<div class="col s12 m6">
<h5>{{ post.title_text }}</h5>
<span class="post-date">{{ post.date_post }}</span>
<span class="post-category">{{ post.category_name }}</span>
{% for summaryline in post.summary %}
<p>
{{ summaryline }}
</p>
{% endfor %}
</div>
<div class="col s12 m3">
<a href="{{ url_for('edit_post', post_id=post._id) }}"
class="post-button waves-effect waves-light btn blue-grey-text text-lighten-5 grey darken-2">
Edit
</a>
<!-- Delete button - defensive programming (Ed B_alum - Slack) -->
<!-- Modal Trigger -->
<button data-target="{{ post._id }}" class="post-button modal-trigger waves-effect waves-light btn blue-grey-text text-lighten-5 grey darken-2">
Delete
</button>
<!-- Modal Structure -->
<div id="{{ post._id }}" class="modal blue-grey lighten-5">
<div class="modal-content">
<h4 class="delete-color center-align">Are you sure you want to DELETE your post {{ post.title_text }}?</h4>
</div>
<div class="modal-footer blue-grey lighten-5">
<button class="modal-close btn-flat cancel-btn blue-grey-text text-lighten-5">Cancel</button>
<a href="{{ url_for('delete_userpost', post_id=post._id) }}" class="modal-close btn-flat blue-grey-text text-lighten-5 grey darken-2">Delete</a>
</div>
</div>
</div>
</div>
</div>
<div class="collapsible-body blue-grey-text text-lighten-5">
<!-- iterates through post_body list -->
{% for body in post.post_body %}
<p class="main-p">{{ body }}</p>
{% endfor %}
<p class="user-p">Posted by: <em class="p-italic">{{ post.posted_by }}</em></p>
<p class="email-p">Email: <em class="p-italic">{{ post.email }}</em></p>
</div>
</li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
{% endblock %}