-
Notifications
You must be signed in to change notification settings - Fork 0
/
friends.html
65 lines (58 loc) · 1.48 KB
/
friends.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
<!-- author ben lawson (balawson@bu.edu) -->
<!doctype html>
{% if message %}
<h4>{{message}}!</h4>
{% endif %}
<title>Photoshare</title>
{% if name %}
<h1>Hello {{ name }}!</h1>
{% endif %}
<h2>Search users by user information</h2>
<form method="POST" action="/friends/search">
<label for="search-user">Search:</label>
<input type="text" id="search-user" name="search_user">
<button type="submit">Search</button>
</form>
{% if result %}
<h3>Result</h3>
<h4>{{ result }}</h4>
{% endif %}
{% if not result %}
<h2>Here are your friends</h2>
<ul>
{% for friend in friends %}
<li>{{friend[2]}}</li>
{% endfor %}
</ul>
<h2>Add friends</h2>
<ul>
{% for user in users %}
<li><a href='/friends/add/{{user[0]}}'>{{user[1]}}</a></li>
{% endfor %}
</ul>
<h2>Recommend friends</h2>
{% if recommend_friend %}
<ul>
<li><a href='/friends/add/{{recommend_friend[0]}}'>{{recommend_friend[1]}}</a></li>
</ul>
{% endif %}
{% if albums %}
<h2>Here are your albums</h2>
<ul>
{% for album in albums %}
<a href='/album/{{album}}'>{{album}}</a>
{% endfor %}
</ul>
{% endif %}
{% endif %}
{% if message is none %}
<p>You should <a href='/login'>login!</a></p>
{% else %}
<p> Go to <a href='/profile'>profile?</a></p>
{% endif %}
<ul>
<li><a href='/logout'>Logout</a></li>
<li><a href='/'>Home</a></li>
<li><a href='/albums'>Add an album</a></li>
<li><a href='/friends'>Friends</a></li>
</ul>