whyareyouemailingme

user.html - for help 20230325

Mar 25th, 2023 (edited)
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.20 KB | Help | 0 0
  1. {% extends "base.html" %}
  2.  
  3. {% block content %}
  4.     <table>
  5.         <tr valign="top">
  6.             <td><img src="{{ user.avatar(128) }}"></td>
  7.             <td>
  8.                 <h1>User: {{ user.username }}</h1>
  9.                 {% if user.about_me %}<p>{{ user.about_me }}</p>{% endif %}
  10.                 {% if user.last_seen %}<p>Last seen on: {{ user.last_seen }}</p>{% endif %}
  11.                 <p>{{ user.followers.count() }} followers, {{ user.followed.count() }} following.</p>
  12.                 {% if user == current_user %}
  13.                     <p><a href="{{ url_for('edit_profile') }}">Edit your profile</a></p>
  14.                 {% elif not current_user.is_following(user) %}
  15.                 <p>
  16.                     <form action="{{ url_for('follow', user=user.username) }}" method="post"> <!-- user=user.username should be username=user.username -->
  17.                         {{ form.hidden_tag() }}
  18.                         {{ form.submit(value='Follow') }}
  19.                     </form>
  20.                 </p>
  21.                 {% else %}
  22.                 <p>
  23.                     <form action="{{ url_for('unfollow', user=user.username) }}" method="post"> <!-- user=user.username should be username=user.username -->
  24.                         {{ form.hidden_tag() }}
  25.                         {{ form.submit(value='Unfollow') }}
  26.                     </form>
  27.                 </p>
  28.                 {% endif %}
  29.             </td>
  30.         </tr>
  31.     </table>
  32.     <hr>
  33.     {% for post in posts %}
  34.         {% include '_post.html' %}
  35.     {% endfor %}
  36. {% endblock %}
Tags: html
Advertisement
Add Comment
Please, Sign In to add comment