File size: 2,208 Bytes
f710fc8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!-- search_results.html -->
{% extends "layout.html" %}

{% block content %}
    <h1 class="title">Search Results</h1>
    {% if users %}
        <ul class="searchresults_ul">
            {% for user in users %}
                <div class="searchresults_container">
                    <div class="toprow">
                        <img class = "searchresults_img" src="{{ url_for('static', filename='users/uploaded_images/' + user.profile_pic) }}" alt="Profile Picture" class="searchresults_img">
                        <h2 class = "searchresults_h2">{{ user.username }} | {{user.first_name }} {{ user.last_name }}</h2>
                        {% if current_user.is_authenticated and current_user.id != user.id %}
                        {% if current_user.is_following(user) %}
                            <form action="{{ url_for('unfollow', user_id=user.id, page='search') }}" method="post">
                                <input type="hidden" name="csrf_token" value="{{ csrf_token }}">
                                <button class = "follow_button" type="submit"><i class="fa-solid fa-user-minus"></i> Unfollow</button>
                            </form>
                        {% else %}
                            <form action="{{ url_for('follow', user_id=user.id, page='search') }}" method="post">
                                <input type="hidden" name="csrf_token" value="{{ csrf_token }}">
                                <button class = "follow_button" type="submit"><i class="fa-solid fa-user-plus"></i> Follow</button>
                            </form>
                        {% endif %}
                        {% endif %}
                    </div>
                    <div class="bottomrow">
                        <p class = "searchresults_p">Bio: {{ user.bio }}</p>
                        <li class="searchresults_li"><a class = "searchresults_a" href="{{ url_for('view_profile', user_id=user.id) }}"><i class="fa-solid fa-share-from-square"></i> Visit Profile</a></li>
                    </div>
                </div>
            {% endfor %}
        </ul>
    {% else %}
        <center><p style="color:#fff">No results found.</p></center>
    {% endif %}
{% endblock %}