1
0
Fork 0

User page

This commit is contained in:
Mouse Reeve 2020-03-16 16:10:59 -07:00
parent d28efe54dd
commit c41b53bdbe
7 changed files with 180 additions and 108 deletions

View file

@ -3,25 +3,7 @@
{% block content %}
<div class="all-shelves content-container">
{% for shelf in shelves %}
{% if shelf.books %}
<div>
<h2>{{ shelf.name }}
{% if shelf.size > shelf.books|length %}
<small>(<a href="/shelf/{{ user | username }}/{{ shelf.identifier }}">See all {{ shelf.size }}</a>)</small>
{% endif %}
</h2>
<div class="covers-shelf {{ shelf.identifier }}">
{% for book in shelf.books %}
<div class="book-preview" onclick="show_compose(this)" id="book-{{ book.id }}">
{% include 'snippets/book_cover.html' with book=book %}
{% include 'snippets/shelve_button.html' with book=book %}
</div>
{% endfor %}
</div>
</div>
{% endif %}
{% endfor %}
{% include 'snippets/covers_shelf.html' with shelves=shelves user=request.user %}
</div>
{% for shelf in shelves %}

View file

@ -1,2 +1,2 @@
<img class="user-pic" src="{% if user.avatar %}/images/{{ user.avatar }}{% else %}/static/images/default_avi.jpg{% endif %}">
<img class="user-pic{% if large %} large{% endif %}" src="{% if user.avatar %}/images/{{ user.avatar }}{% else %}/static/images/default_avi.jpg{% endif %}">

View file

@ -1,6 +1,20 @@
{% load fr_display %}
{% for book in books %}
<div class="book-preview">
{% include 'snippets/book.html' with rating=rating %}
{% for shelf in shelves %}
{% if shelf.books %}
<div>
<h2>{{ shelf.name }}
{% if shelf.size > shelf.books|length %}
<small>(<a href="/shelf/{{ user | username }}/{{ shelf.identifier }}">See all {{ shelf.size }}</a>)</small>
{% endif %}
</h2>
<div class="covers-shelf {{ shelf.identifier }}">
{% for book in shelf.books %}
<div class="book-preview" onclick="show_compose(this)" id="book-{{ book.id }}">
{% include 'snippets/book_cover.html' with book=book %}
{% include 'snippets/shelve_button.html' with book=book %}
</div>
{% endfor %}
</div>
</div>
{% endif %}
{% endfor %}

View file

@ -1,10 +1,10 @@
<form action="/accept_follow_request/" method="POST">
{% csrf_token %}
<input type=hidden name="user" value="{{ user.username }}">
<input type=submit value="Accept">
<input type="hidden" name="user" value="{{ user.username }}">
<button type="submit">Accept</button>
</form>
<form action="/delete_follow_request/" method="POST">
{% csrf_token %}
<input type=hidden name="user" value="{{ user.username }}">
<input type=submit value="Delete">
<input type="hidden" name="user" value="{{ user.username }}">
<button type="submit" class="warning">Delete</button>
</form>

View file

@ -1,64 +1,61 @@
{% extends 'layout.html' %}
{% load humanize %}
{% block content %}
<div id="sidebar">
<div class="user-profile">
<h2>
{% include 'snippets/avatar.html' with user=user %}
{% if user.name %}{{ user.name }}{% endif %}
<small>{{ user.username }}</small>
</h2>
{% if user.summary %}
<blockquote>{{ user.summary | safe }}</blockquote>
{% endif %}
{% if not is_self %}
{% include 'snippets/follow_button.html' with user=user %}
{% endif %}
<div class="content-container user-profile">
<h2>User Profile
{% if is_self %}
<div class="interaction">
<a href="/user-edit/">Edit profile</a>
<a href="/user-edit/">edit
<span class="icon icon-pencil">
<span class="hidden-text">Edit profile</span>
</span>
</a>
{% endif %}
</h2>
<div class="row">
<div class="pic-container">
{% include 'snippets/avatar.html' with user=user large=True %}
</div>
<div>
<p>{% if user.name %}{{ user.name }}{% else %}{{ user.localname }}{% endif %}</p>
<p>{{ user.username }}</p>
<p>Joined {{ user.created_date | naturaltime }}</p>
</div>
{% if user.summary %}
<blockquote><span class="icon icon-quote-open"></span>{{ user.summary | safe }}</blockquote>
{% endif %}
</div>
{% if not is_self %}
{% include 'snippets/follow_button.html' with user=user %}
{% endif %}
{% if is_self and user.follower_requests.all %}
<div>
<div class="follow-requests">
<h2>Follow Requests</h2>
{% for requester in user.follower_requests.all %}
<div>
{% include 'snippets/username.html' with user=requester show_full=True %}
<div class="row shrink">
<p>
{% include 'snippets/username.html' with user=requester show_full=True %}
</p>
{% include 'snippets/follow_request_buttons.html' with user=requester %}
</div>
{% endfor %}
</div>
{% endif %}
<div>
<h2>Followers</h2>
{% for follower in user.followers.all %}
<div>
{% include 'snippets/username.html' with user=follower show_full=True %}
{% include 'snippets/follow_button.html' with user=follower %}
</div>
{% endfor %}
</div>
<div>
<h2>Following</h2>
{% for following in user.following.all %}
<div>
{% include 'snippets/username.html' with user=following show_full=True %}
{% include 'snippets/follow_button.html' with user=following %}
</div>
{% endfor %}
</div>
</div>
<div id="content">
{% for shelf in shelves %}
<div>
<h2>{{ shelf.name }}</h2>
{% include 'snippets/shelf.html' with shelf=shelf ratings=ratings %}
<div class="all-shelves content-container">
{% include 'snippets/covers_shelf.html' with shelves=shelves user=user %}
</div>
<div>
<div class="content-container"><h2>User Activity</h2></div>
{% for activity in activities %}
<div class="content-container">
{% include 'snippets/status.html' with status=activity %}
</div>
{% endfor %}
</div>