-
Notifications
You must be signed in to change notification settings - Fork 53
/
dashboard.html
153 lines (83 loc) · 2.85 KB
/
dashboard.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
{% extends 'base.html' %}
{% block content %}
{% for message in get_flashed_messages() %}
<div class="alert alert-warning alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endfor %}
<h2>Dashboard</h2>
<br/>
<div class="card">
<div class="card-header">
{{ current_user.name }}
</div>
<div class="card-body">
<p class="card-text">
<div class="container">
<div class="row">
<div class="col-8">
<strong>Name:</strong>
{{ current_user.name }}<br/>
<strong>Username:</strong>
{{ current_user.username }}<br/>
<strong>User Id:</strong>
{{ current_user.id }}<br/>
<strong>Email:</strong>
{{ current_user.email }}<br/>
<strong>Favorite Color:</strong>
{{ current_user.favorite_color }}<br/>
<strong>About Author:</strong>
{{ current_user.about_author }}<br/>
<strong>Profile Pic:</strong>
{{ current_user.profile_pic }}<br/>
<strong>Date Joined:</strong>
{{ current_user.date_added }}<br/>
</p>
<a href="{{ url_for('logout')}}" class="btn btn-secondary btn-sm">Logout</a>
<a href="{{ url_for('update', id=current_user.id)}}" class="btn btn-secondary btn-sm">Update Profile</a>
<a href="{{ url_for('delete', id=current_user.id)}}" class="btn btn-danger btn-sm">Delete</a>
<br/><br/>
</div>
<div class="col-4">
{% if current_user.profile_pic %}
<img src="{{ url_for('static', filename='images/' + current_user.profile_pic)}}" width="200" align="right">
{% else %}
<img src="{{ url_for('static', filename='images/default_profile_pic.png')}}" width="200" align="right">
{% endif %}
</div>
</div>
</div>
</div>
</div>
<br/>
<div class="card">
<div class="card-header">
Update Profile
</div>
<div class="card-body">
<form action="/dashboard" method="POST" enctype="multipart/form-data">
{{ form.hidden_tag() }}
{{ form.name.label(class="form-label") }}
{{ form.name(class="form-control", value=name_to_update.name) }}
<br/>
{{ form.username.label(class="form-label") }}
{{ form.username(class="form-control", value=name_to_update.username) }}
<br/>
{{ form.email.label(class="form-label") }}
{{ form.email(class="form-control", value=name_to_update.email) }}
<br/>
{{ form.favorite_color.label(class="form-label") }}
{{ form.favorite_color(class="form-control", value=name_to_update.favorite_color) }}
<br/>
{{ form.about_author.label(class="form-label") }}
<textarea name="about_author" class="form-control">{{ name_to_update.about_author }}</textarea>
<br/>
{{ form.profile_pic.label(class="form-label") }}
{{ form.profile_pic(class="form-control", value=name_to_update.profile_pic) }}
<br/>
{{ form.submit(class="btn btn-secondary btn-sm") }}
</form>
</div>
</div>
{% endblock %}