rename main code directory

This commit is contained in:
Mouse Reeve
2020-09-17 13:30:54 -07:00
parent b42faad556
commit f77c156733
199 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,21 @@
{% extends 'layout.html' %}
{% block content %}
<div class="content-container">
<h2>About {{ site_settings.name }}</h2>
<p>
{{ site_settings.instance_description }}
</p>
<p>
<small>
<a href="/login/">Login or Create an Account</a>
</small>
</p>
<h2>Code of Conduct</h2>
<p>
{{ site_settings.code_of_conduct }}
</p>
</div>
{% endblock %}

View File

@ -0,0 +1,28 @@
{% extends 'layout.html' %}
{% load fr_display %}
{% block content %}
<div class="content-container">
<h2>{{ author.display_name }}</h2>
{% if author.bio %}
<p>
{{ author.bio | author_bio }}
</p>
{% endif %}
</div>
<div class="content-container">
<h2>Books by {{ author.display_name }}</h2>
<div class="book-grid row shrink wrap">
{% for book in books %}
<div class="book-preview">
<a href="/book/{{ book.id }}">
{% include 'snippets/book_cover.html' with book=book %}
</a>
{% include 'snippets/shelve_button.html' with book=book %}
</div>
{% endfor %}
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,95 @@
{% extends 'layout.html' %}
{% load fr_display %}
{% block content %}
<div class="content-container">
<h2>
{% include 'snippets/book_titleby.html' with book=book %}
{% if request.user.is_authenticated %}
<a href="{{ book.id }}/edit" class="edit-link">edit
<span class="icon icon-pencil">
<span class="hidden-text">Edit Book</span>
</span>
</a>
{% endif %}
</h2>
<div class="row">
<div class="cover-container">
{% include 'snippets/book_cover.html' with book=book size=large %}
{% include 'snippets/rate_action.html' with user=request.user book=book %}
{% include 'snippets/shelve_button.html' %}
{% if request.user.is_authenticated and not book.cover %}
<form name="add-cover" method="POST" action="/upload_cover/{{ book.id }}" enctype="multipart/form-data">
{% csrf_token %}
{{ cover_form.as_p }}
<button type="submit">Add cover</button>
</form>
{% endif %}
<dl>
{% for field in info_fields %}
{% if field.value %}
<dt>{{ field.name }}:</dt>
<dd>{{ field.value }}</dd>
{% endif %}
{% endfor %}
</dl>
</div>
<div class="column">
<h3>{{ active_tab }} rating: {% include 'snippets/stars.html' with rating=rating %}</h3>
{% include 'snippets/book_description.html' %}
{% if book.parent_work.edition_set.count > 1 %}
<p><a href="/editions/{{ book.parent_work.id }}">{{ book.parent_work.edition_set.count }} editions</a></p>
{% endif %}
{% if request.user.is_authenticated %}
<div class="compose">
{% include 'snippets/create_status.html' with book=book hide_cover=True %}
</div>
<div>
<h3>Tags</h3>
<form name="tag" action="/tag/" method="post">
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}">
<input type="text" name="name">
<button type="submit">Add tag</button>
</form>
</div>
<div class="tag-cloud">
{% for tag in tags %}
{% include 'snippets/tag.html' with book=book tag=tag user_tags=user_tags %}
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>
{% if request.user.is_authenticated %}
<div class="content-container tabs">
{% include 'snippets/tabs.html' with tabs=feed_tabs active_tab=active_tab path=path %}
</div>
{% endif %}
{% if not reviews %}
<div class="content-container">
<p>No reviews yet!</p>
</div>
{% endif %}
{% for review in reviews %}
<div class="content-container">
{% include 'snippets/status.html' with status=review hide_book=True depth=1 %}
</div>
{% endfor %}
{% endblock %}

View File

@ -0,0 +1,27 @@
{% extends 'layout.html' %}
{% block content %}
<div class="content-container">
<h2>Search results</h2>
{% for result_set in results %}
{% if result_set.results %}
<section>
{% if not result_set.connector.local %}
<h3>
Results from <a href="{{ result_set.connector.base_url }}" target="_blank">{% if result_set.connector.name %}{{ result_set.connector.name }}{% else %}{{ result_set.connector.identifier }}{% endif %}</a>
</h3>
{% endif %}
{% for result in result_set.results %}
<div>
<form action="/resolve_book" method="POST">
{% csrf_token %}
<input type="hidden" name="remote_id" value="{{ result.key }}">
<button type="submit">{{ result.title }} by {{ result.author }} ({{ result.year }})</button>
</form>
</div>
{% endfor %}
</section>
{% endif %}
{% endfor %}
</div>
{% endblock %}

View File

@ -0,0 +1,17 @@
{% extends 'layout.html' %}
{% load fr_display %}
{% block content %}
<div class="content-container">
<h2>Recently Added Books</h2>
<div class="book-grid row wrap shrink">
{% for book in books %}
<div class="cover-container">
<a href="/book/{{ book.id }}">
{% include 'snippets/book_cover.html' with book=book %}
</a>
{% include 'snippets/shelve_button.html' with book=book %}
</div>
{% endfor %}
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,73 @@
{% extends 'layout.html' %}
{% load humanize %}
{% block content %}
<div class="content-container">
<h2>
Edit "{{ book.title }}"
<a href="/book/{{ book.id }}">
<span class="edit-link icon icon-close">
<span class="hidden-text">Close</span>
</span>
</a>
</h2>
<div class="book-preview row">
<div class="cover-container">
{% include 'snippets/book_cover.html' with book=book size="small" %}
</div>
<div>
<p>Added: {{ book.created_date | naturaltime }}</p>
<p>Updated: {{ book.updated_date | naturaltime }}</p>
</div>
</div>
</div>
<form class="book-form content-container" name="edit-book" action="/edit_book/{{ book.id }}" method="post" enctype="multipart/form-data">
{% csrf_token %}
<h3>Data sync
<small>If sync is enabled, any changes will be over-written</small>
</h3>
<div>
<div class="row">
<p><label for="id_sync">Sync:</label> <input type="checkbox" name="sync" id="id_sync"></p>
<p><label for="id_sync_cover">Sync cover:</label> <input type="checkbox" name="sync_cover" id="id_sync_cover"></p>
</div>
</div>
<h3>Cover</h3>
<div class="image-form">
<p>{{ form.cover }} </p>
</div>
<h3>Book Identifiers</h2>
<div>
<p><label for="id_isbn_13">ISBN 13:</label> {{ form.isbn_13 }} </p>
<p><label for="id_isbn_10">ISBN 10:</label> {{ form.isbn_10 }} </p>
<p><label for="id_openlibrary_key">Openlibrary key:</label> {{ form.openlibrary_key }} </p>
<p><label for="id_librarything_key">Librarything key:</label> {{ form.librarything_key }} </p>
<p><label for="id_goodreads_key">Goodreads key:</label> {{ form.goodreads_key }} </p>
</div>
<h3>Physical Properties</h3>
<div>
<p><label for="id_physical_format">Format:</label> {{ form.physical_format }} </p>
<p><label for="id_pages">Pages:</label> {{ form.pages }} </p>
</div>
<h3>Metadata</h3>
<div>
<p><label for="id_title">Title:</label> {{ form.title }} </p>
<p><label for="id_sort_title">Sort title:</label> {{ form.sort_title }} </p>
<p><label for="id_subtitle">Subtitle:</label> {{ form.subtitle }} </p>
<p><label for="id_description">Description:</label> {{ form.description }} </p>
<p><label for="id_series">Series:</label> {{ form.series }} </p>
<p><label for="id_series_number">Series number:</label> {{ form.series_number }} </p>
<p><label for="id_first_published_date">First published date:</label> {{ form.first_published_date }} </p>
<p><label for="id_published_date">Published date:</label> {{ form.published_date }} </p>
</div>
<div>
<button type="submit">Save</button>
</div>
</form>
{% endblock %}

View File

@ -0,0 +1,16 @@
{% extends 'layout.html' %}
{% block content %}
<div class="content-container">
<div class="user-profile">
<h2>Edit Profile</h2>
<p>{% include 'snippets/avatar.html' with user=user %} {% if user.localname %}{{ user.localname }}{% else %}{{ user.username }}{% endif %}</p>
<form name="avatar" action="/edit_profile/" method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Update profile</button>
</form>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,18 @@
{% extends 'layout.html' %}
{% load fr_display %}
{% block content %}
<div class="content-container">
<h2>Editions of <a href="/book/{{ work.id }}">"{{ work.title }}"</a></h2>
<ol class="book-grid row wrap">
{% for book in editions %}
<li class="book-preview">
<a href="/book/{{ book.id }}">
{% include 'snippets/book_cover.html' with book=book %}
</a>
{% include 'snippets/shelve_button.html' with book=book %}
</li>
{% endfor %}
</ol>
</div>
{% endblock %}

View File

@ -0,0 +1,10 @@
{% extends 'layout.html' %}
{% block content %}
<div class="content-container">
<h2>Server Error</h2>
<p>Something went wrong! Sorry about that.</p>
</div>
{% endblock %}

View File

@ -0,0 +1,40 @@
{% extends 'layout.html' %}
{% load fr_display %}
{% block content %}
{% include 'snippets/covers_shelf.html' with shelves=shelves user=request.user %}
<div id="feed">
<div class="content-container tabs">
{% include 'snippets/tabs.html' with tabs=feed_tabs active_tab=active_tab %}
</div>
{% for activity in activities %}
<div class="content-container">
{% include 'snippets/status.html' with status=activity %}
</div>
{% endfor %}
<div class="content-container pagination row">
{% if prev %}
<p>
<a href="{{ prev }}">
<span class="icon icon-arrow-left"></span>
Previous
</a>
</p>
{% endif %}
{% if next %}
<p class="next">
<a href="{{ next }}">
Next
<span class="icon icon-arrow-right"></span>
</a>
</p>
{% endif %}
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,26 @@
{% extends 'layout.html' %}
{% load fr_display %}
{% block content %}
{% include 'user_header.html' with user=user %}
<div class="content-container">
<h2>Followers</h2>
{% for followers in followers %}
<div class="row shrink">
<div>
{% include 'snippets/avatar.html' with user=followers %}
</div>
<div>
{% include 'snippets/username.html' with user=followers show_full=True %}
</div>
<div>
{% include 'snippets/follow_button.html' with user=followers %}
</div>
</div>
{% endfor %}
{% if not followers.count %}
<div>{{ user|username }} has no followers</div>
{% endif %}
</div>
{% endblock %}

View File

@ -0,0 +1,26 @@
{% extends 'layout.html' %}
{% load fr_display %}
{% block content %}
{% include 'user_header.html' %}
<div class="content-container">
<h2>Following</h2>
{% for follower in user.following.all %}
<div class="row shrink">
<div>
{% include 'snippets/avatar.html' with user=follower %}
</div>
<div>
{% include 'snippets/username.html' with user=follower show_full=True %}
</div>
<div>
{% include 'snippets/follow_button.html' with user=follower %}
</div>
</div>
{% endfor %}
{% if not following.count %}
<div>No one is following {{ user|username }}</div>
{% endif %}
</div>
{% endblock %}

View File

@ -0,0 +1,21 @@
{% extends 'layout.html' %}
{% load humanize %}
{% block content %}
<div class="content-container">
<h2>Import Books from GoodReads</h2>
<form name="import" action="/import_data/" method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ import_form.as_p }}
<button type="submit">Import</button>
</form>
<p>
Imports are limited in size, and only the first {{ limit }} items will be imported.
<h2>Recent Imports</h2>
<ul>
{% for job in jobs %}
<li><a href="/import_status/{{ job.id }}">{{ job.created_date | naturaltime }}</a></li>
{% endfor %}
</ul>
</div>
{% endblock %}

View File

@ -0,0 +1,69 @@
{% extends 'layout.html' %}
{% load fr_display %}
{% load humanize %}
{% block content %}
<div id="content">
<div>
<h1>Import Status</h1>
<p>
Import started: {{ job.created_date | naturaltime }}
<p>
{% if task.ready %}
Import completed: {{ task.date_done | naturaltime }}
{% if task.failed %}
<h3><span style="background-color: #ffaaaa;">TASK FAILED</span></h3>
<p>
{{ task.info }}
{% endif %}
{% if job.import_status %}
{% include 'snippets/status.html' with status=job.import_status %}
{% endif %}
{% else %}
Import still in progress.
<p>
(Hit reload to update!)
{% endif %}
<table>
<tr>
<th>
Book
</th>
<th>
Title
</th>
<th>
Author
</th>
<th>
</th>
</tr>
{% for item in items %}
<tr>
<td>
{% if item.book %}
<a href="/book/{{ item.book.id }}">
{% include 'snippets/book_cover.html' with book=item.book size='small' %}
</a>
{% endif %}
</td>
<td>
{{ item.data|dict_key:'Title' }}
</td>
<td>
{{ item.data|dict_key:'Author' }}
</td>
<td>
{% if item.book %}✓
{% elif item.fail_reason %}
{{ item.fail_reason }}
{% endif %}
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,33 @@
{% extends 'layout.html' %}
{% block content %}
<div class="content-container">
<h2>About {{ site_settings.name }}</h2>
<p>
{{ site_settings.instance_description }}
</p>
<p>
<small>
<a href="/about/">More about this site</a>
</small>
</p>
</div>
<div class="content-container login">
<h2>Create an Account</h2>
<p><small>
With a BookWyrm account, you can track and share your reading activity with
friends here and on any other federated server, like Mastodon and PixelFed.
</small></p>
<div>
<form name="register" method="post" action="/register">
{% csrf_token %}
{{ register_form.as_p }}
<input type=hidden name="invite_code" value="{{ invite.code }}">
<button type="submit">Create account</button>
</form>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,86 @@
{% load fr_display %}
<!DOCTYPE html>
<html lang="en">
<head>
<title>BookWyrm</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link type="text/css" rel="stylesheet" href="/static/format.css">
<link type="text/css" rel="stylesheet" href="/static/icons.css">
<link rel="shortcut icon" type="image/x-icon" href="/static/images/favicon.ico">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="BookWyrm">
<meta name="og:title" content="BookWyrm">
<meta name="twitter:description" content="Federated Social Reading">
<meta name="og:description" content="Federated Social Reading">
<meta name="twitter:creator" content="@tripofmice">
<meta name="twitter:site" content="@tripofmice">
</head>
<body>
<div id="top-bar">
<header class="row">
<div id="branding">
<a href="/">
<img id="logo" src="/static/images/logo-small.png" alt="BookWyrm"></img>
</a>
</div>
<ul id="menu">
{% if request.user.is_authenticated %}
<li><a href="/user/{{request.user.localname}}/shelves">Your shelves</a></li>
{% endif %}
<li><a href="/#feed">Updates</a></li>
<li><a href="/books">Discover Books</a></li>
</ul>
<div id="actions">
<div id="search">
<form action="/search/">
<input type="text" name="q" placeholder="Search for a book or user">
<button type="submit">
<span class="icon icon-search">
<span class="hidden-text">search</span>
</span>
</button>
</form>
</div>
{% if request.user.is_authenticated %}
<div id="notifications">
<a href="/notifications">
<span class="icon icon-bell">
<span class="hidden-text">Notitications</span>
</span>
{% if request.user|notification_count %}<span class="count">{{ request.user | notification_count }}</span>{% endif %}
</a>
</div>
<div class="pulldown-container">
{% include 'snippets/avatar.html' with user=request.user %}
<ul class="pulldown">
<li><a href="/user/{{ request.user }}">Your profile</a></li>
<li><a href="/user-edit/">Settings</a></li>
<li><a href="/import">Import Books</a></li>
<li><a href="/manage_invites/">Invites</a></li>
<li><a href="/logout/">Log out</a></li>
</ul>
</p>
{% endif %}
</div>
</header>
</div>
<div id="main">
{% block content %}
{% endblock %}
</div>
<script>
var csrf_token = '{{ csrf_token }}';
</script>
<script src="/static/js/shared.js"></script>
</body>
</html>

View File

@ -0,0 +1,54 @@
{% extends 'layout.html' %}
{% block content %}
<div class="content-container">
<h2>About {{ site_settings.name }}</h2>
<p>
{{ site_settings.instance_description }}
</p>
<p>
<small>
<a href="/about/">More about this site</a>
</small>
</p>
</div>
<div class="row">
<div class="content-container login">
<h2>Create an Account</h2>
<p><small>
With a BookWyrm account, you can track and share your reading activity with
friends here and on any other federated server, like Mastodon and PixelFed.
</small></p>
{% if site_settings.allow_registration %}
<div>
<form name="register" method="post" action="/register">
{% csrf_token %}
{{ register_form.as_p }}
<button type="submit">Create account</button>
</form>
</div>
{% else %}
<small>
This instance is not open for registration.
</small>
{% endif %}
</div>
<div class="content-container login">
<h2>Log in</h2>
<div>
<form name="login" method="post" action="/user-login">
{% csrf_token %}
{{ login_form.as_p }}
<button type="submit">Log in</button>
</form>
<p><small><a href="/reset-password">Forgot your password?</a></small></p>
</div>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,32 @@
{% extends 'layout.html' %}
{% load humanize %}
{% block content %}
<div class="content-container">
<div class="manage-invites">
<h2>Invites</h2>
<table>
<tr>
<th>Link</th>
<th>Expires</th>
<th>Max uses</th>
<th>Times used</th>
</tr>
{% for invite in invites %}
<tr>
<td><a href="{{ invite.link }}">{{ invite.link }}</td>
<td>{{ invite.expiry|naturaltime }}</td>
<td>{{ invite.use_limit }}</td>
<td>{{ invite.times_used }}</td>
</tr>
{% endfor %}
</table>
<h2>Generate New Invite</h2>
<form name="avatar" action="/create_invite/" method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Create Invite</button>
</form>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,9 @@
{% extends 'layout.html' %}
{% block content %}
<div class="content-container">
<h2>Not Found</h2>
<p>The page your requested doesn't seem to exist!</p>
</div>
{% endblock %}

View File

@ -0,0 +1,52 @@
{% extends 'layout.html' %}
{% load humanize %}l
{% block content %}
<div class="content-container">
<h2>Notifications</h2>
<form name="clear" action="/clear-notifications" method="POST">
{% csrf_token %}
<button type="submit" class="secondary">Delete notifications</button>
</form>
</div>
<div class="content-container">
{% for notification in notifications %}
<div class="notification{% if notification.id in unread %} unread{% endif %}">
<small class="time-ago">{{ notification.created_date | naturaltime }}</small>
{% if notification.related_user %}
{% include 'snippets/username.html' with user=notification.related_user %}
{% if notification.notification_type == 'FAVORITE' %}
favorited your
<a href="{{ notification.related_status.remote_id}}">status</a>
{% elif notification.notification_type == 'REPLY' %}
<a href="{{ notification.related_status.remote_id}}">replied</a>
to your
<a href="{{ notification.related_status.reply_parent.remote_id}}">status</a>
{% elif notification.notification_type == 'FOLLOW' %}
followed you
{% elif notification.notification_type == 'FOLLOW_REQUEST' %}
sent you a follow request
<div class="row shrink">
{% include 'snippets/follow_request_buttons.html' with user=notification.related_user %}
</div>
{% elif notification.notification_type == 'BOOST' %}
boosted your <a href="{{ notification.related_status.remote_id}}">status</a>
{% endif %}
{% else %}
your <a href="/import_status/{{ notification.related_import.id }}">import</a> completed.
{% endif %}
</div>
{% endfor %}
{% if not notifications %}
<p>You're all caught up!</p>
{% endif %}
</div>
{% endblock %}

View File

@ -0,0 +1,10 @@
{% extends 'layout.html' %}
{% block content %}
<div id="content">
<div>
<h2>{% include 'snippets/username.html' with user=user %} > {{ shelf.name }}</h2>
{% include 'snippets/shelf.html' with shelf=shelf ratings=ratings %}
</div>
</div>
{% endblock %}

View File

@ -0,0 +1 @@
<a href="/author/{{ book.authors.first.id }}" class="author">{{ book.authors.first.display_name }}</a>

View File

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

View File

@ -0,0 +1,12 @@
{% load fr_display %}
{% if book.cover %}
<img class="book-cover {{ size }}" src="/images/{{ book.cover }}" alt="{% include 'snippets/cover_alt.html' with book=book %}">
{% else %}
<div class="no-cover book-cover {{ size }}">
<img class="book-cover {{ size }}" src="/static/images/no_cover.jpg" alt="No cover">
<div>
<p class="title">{{ book.title }}</p>
<p>({{ book|edition_info }})</p>
</div>
</div>
{% endif %}

View File

@ -0,0 +1,7 @@
{% load fr_display %}
{% if book.description %}
<blockquote>{{ book.description | description }}</blockquote>
{% elif book.parent_work.description %}
<blockquote>{{ book.parent_work.description | description }}</blockquote>
{% endif %}

View File

@ -0,0 +1,9 @@
<span class="title">
<a href="/book/{{ book.id }}">{{ book.title }}</a>
</span>
{% if book.authors %}
<span class="author">
by {% include 'snippets/authors.html' with book=book %}
</span>
{% endif %}

View File

@ -0,0 +1,2 @@
{% load fr_display %}
'{{ book.title }}' Cover ({{ book|edition_info }})

View File

@ -0,0 +1,49 @@
{% load fr_display %}
<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="cover-container">
<label for="book-{{ book.id }}-radio">
{% include 'snippets/book_cover.html' with book=book %}
</label>
{% include 'snippets/shelve_button.html' with book=book hide_pulldown=True %}
</div>
{% endfor %}
</div>
</div>
{% endif %}
{% endfor %}
</div>
{% for shelf in shelves %}
{% for book in shelf.books %}
<div class="compose-popout">
<input name="book-popout" type="radio" id="book-{{ book.id }}-radio">
<div class="compose compose-suggestion" id="compose-book-{{ book.id }}">
<label class="close icon icon-close" for="book-{{ book.id }}-radio-close" onclick="hide_element(this)">
<span class="hidden-text">Close</span>
</label>
<input name="book-popout" type="radio" id="book-{{ book.id }}-radio-close">
<div class="content-container">
<h2>
{% include 'snippets/avatar.html' with user=user %}
Your thoughts on
a <a href="/book/{{ book.id }}">{{ book.title }}</a>
by {% include 'snippets/authors.html' with book=book %}
</h2>
{% include 'snippets/create_status.html' with book=book user=request.user %}
</div>
</div>
</div>
{% endfor %}
{% endfor %}

View File

@ -0,0 +1,43 @@
{% load humanize %}
{% load fr_display %}
<div class="tabs secondary">
<div class="tab active" data-id="tab-review-{{ book.id }}" data-category="tab-option-{{ book.id }}">
<a href="/book/{{ book.id }}/review" onclick="tabChange(event)">Review</a>
</div>
<div class="tab" data-id="tab-comment-{{ book.id }}" data-category="tab-option-{{ book.id }}">
<a href="/book/{{ book.id }}/comment" onclick="tabChange(event)">Comment</a>
</div>
<div class="tab" data-id="tab-quotation-{{ book.id }}" data-category="tab-option-{{ book.id }}">
<a href="/book/{{ book.id }}/quotation" onclick="tabChange(event)">Quote</a>
</div>
</div>
<div class="book-preview row">
{% if not hide_cover %}
<div class="cover-container">
{% include 'snippets/book_cover.html' with book=book %}
</div>
{% endif %}
<form class="tab-option-{{ book.id }} review-form" name="review" action="/review/" method="post" id="tab-review-{{ book.id }}">
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}">
{% include 'snippets/rate_form.html' with book=book %}
{{ review_form.as_p }}
<button type="submit">post review</button>
</form>
<form class="hidden tab-option-{{ book.id }} review-form" name="comment" action="/comment/" method="post" id="tab-comment-{{ book.id }}">
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}">
{{ comment_form.as_p }}
<button type="submit">post comment</button>
</form>
<form class="hidden tab-option-{{ book.id }} review-form quote-form" name="quotation" action="/quotate/" method="post" id="tab-quotation-{{ book.id }}">
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}">
{{ quotation_form.as_p }}
<button typr="submit">post quote</button>
</form>
</div>

View File

@ -0,0 +1,24 @@
{% if request.user == user or not request.user.is_authenticated %}
{% elif request.user in user.follower_requests.all %}
<div>
Follow request already sent.
</div>
{% else %}
<form action="/follow/" method="POST" onsubmit="interact(event)" class="follow-{{ user.id }} {% if request.user in user.followers.all %}hidden{%endif %}" data-id="follow-{{ user.id }}">
{% csrf_token %}
<input type="hidden" name="user" value="{{ user.username }}">
{% if user.manually_approves_followers %}
<button type="submit">Send follow request</button>
{% else %}
<button type="submit">Follow</button>
{% endif %}
</form>
<form action="/unfollow/" method="POST" onsubmit="interact(event)" class="follow-{{ user.id }} {% if not request.user in user.followers.all %}hidden{%endif %}" data-id="follow-{{ user.id }}">
{% csrf_token %}
<input type="hidden" name="user" value="{{ user.username }}">
<button type="submit">Unfollow</button>
</form>
{% endif %}

View File

@ -0,0 +1,13 @@
{% load fr_display %}
{% if request.user|follow_request_exists:user %}
<form action="/accept_follow_request/" method="POST">
{% csrf_token %}
<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 }}">
<button type="submit" class="warning">Delete</button>
</form>
{% endif %}

View File

@ -0,0 +1,64 @@
{% load fr_display %}
<div class="interaction">
{% if request.user.is_authenticated %}
<form name="reply" action="/reply" method="post" onsubmit="return reply(event)">
{% csrf_token %}
<input type="hidden" name="parent" value="{{ activity.id }}">
<textarea name="content" placeholder="Leave a comment..." id="id_content" required="true"></textarea>
<button type="submit">
<span class="icon icon-comment">
<span class="hidden-text">Comment</span>
</span>
</button>
</form>
<form name="boost" action="/boost/{{ activity.id }}" method="post" onsubmit="return interact(event)" class="boost-{{ status.id }} {% if request.user|boosted:status %}hidden{% endif %}" data-id="boost-{{ status.id }}">
{% csrf_token %}
<button type="submit">
<span class="icon icon-boost">
<span class="hidden-text">Boost status</span>
</span>
</button>
</form>
<form name="unboost" action="/unboost/{{ activity.id }}" method="post" onsubmit="return interact(event)" class="boost-{{ status.id }} active {% if not request.user|boosted:status %}hidden{% endif %}" data-id="boost-{{ status.id }}">
{% csrf_token %}
<button type="submit">
<span class="icon icon-boost">
<span class="hidden-text">Un-boost status</span>
</span>
</button>
</form>
<form name="favorite" action="/favorite/{{ activity.id }}" method="POST" onsubmit="return interact(event)" class="fav-{{ status.id }} {% if request.user|liked:status %}hidden{% endif %}" data-id="fav-{{ status.id }}">
{% csrf_token %}
<button type="submit">
<span class="icon icon-heart">
<span class="hidden-text">Like status</span>
</span>
</button>
</form>
<form name="unfavorite" action="/unfavorite/{{ activity.id }}" method="POST" onsubmit="return interact(event)" class="fav-{{ status.id }} active {% if not request.user|liked:status %}hidden{% endif %}" data-id="fav-{{ status.id }}">
{% csrf_token %}
<button type="submit">
<span class="icon icon-heart">
<span class="hidden-text">Un-like status</span>
</span>
</button>
</form>
{% else %}
<a href="/login">
<span class="icon icon-comment">
<span class="hidden-text">Comment</span>
</span>
<span class="icon icon-boost">
<span class="hidden-text">Boost status</span>
</span>
<span class="icon icon-heart">
<span class="hidden-text">Like status</span>
</span>
</a>
{% endif %}
</div>

View File

@ -0,0 +1,14 @@
{% load fr_display %}
<span class="hidden-text">Leave a rating</span>
<div class="stars rate-stars">
{% for i in '12345'|make_list %}
<form name="rate" action="/rate/" method="POST" onsubmit="return rate_stars(event)">
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}">
<input type="hidden" name="rating" value="{{ forloop.counter }}">
<button type="submit" class="icon icon-star-{% if book|rating:user < forloop.counter %}empty{% else %}full{% endif %}">
<span class="hidden-text">{{ forloop.counter }} star{{ forloop.counter | pluralize }}</span>
</button>
</form>
{% endfor %}
</div>

View File

@ -0,0 +1,12 @@
{% load fr_display %}
<span class="hidden-text">Rating</span>
<div class="stars rate-stars">
<input type="radio" name="rating" value="" checked>
{% for i in '12345'|make_list %}
<input id="book{{book.id}}-star-{{ forloop.counter }}" type="radio" name="rating" value="{{ forloop.counter }}">
<label class="icon icon-star-empty" for="book{{book.id}}-star-{{ forloop.counter }}">
<span class="hidden-text">{{ forloop.counter }} star{{ forloop.counter | pluralize }}</span>
</label>
{% endfor %}
</div>

View File

@ -0,0 +1,74 @@
{% load humanize %}
{% load fr_display %}
{% if shelf.books %}
<table>
<tr class="book-preview">
<th>
Cover
</th>
<th>
Title
</th>
<th>
Author
</th>
<th>
Published
</th>
<th>
Shelved
</th>
<th>
Started
</th>
<th>
Finished
</th>
<th>
External links
</th>
{% if ratings %}
<th>
Rating
</th>
{% endif %}
</tr>
{% for book in shelf.books.all %}
<tr class="book-preview">
<td>
{% include 'snippets/book_cover.html' with book=book size="small" %}
</td>
<td>
<a href="/book/{{ book.id }}">{{ book.title }}</a>
</td>
<td>
{{ book.authors.first.display_name }}
</td>
<td>
{% if book.first_published_date %}{{ book.first_published_date }}{% endif %}
</td>
<td>
{{ book.created_date | naturalday }}
</td>
{% latest_read_through book user as read_through %}
<td>
{{ read_through.start_date | naturalday |default_if_none:""}}
</td>
<td>
{{ read_through.finish_date | naturalday |default_if_none:""}}
</td>
<td>
<a href="https://openlibrary.org/book/{{ book.openlibrary_key }}" target="_blank">OpenLibrary</a>
</td>
{% if ratings %}
<td>
{% include 'snippets/stars.html' with rating=ratings|dict_key:book.id %}
</td>
{% endif %}
</tr>
{% endfor %}
</table>
{% else %}
<p>This shelf is empty.</p>
{% endif %}

View File

@ -0,0 +1,31 @@
{% load fr_display %}
{% if request.user.is_authenticated %}
<div class="pulldown-button">
<form name="shelve" action="/shelve/" method="post">
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}">
<input type="hidden" name="shelf" value="{% shelve_button_identifier book %}">
<button type="submit" style="">{% shelve_button_text book %}</button>
</form>
{% if not hide_pulldown %}
<div class="pulldown-container">
<button class="pulldown-toggle">
<span class="icon icon-arrow-down"><span class="hidden-text">More shelves</span></span>
</button>
<ul class="pulldown">
<form name="shelve" action="/shelve/" method="post">
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}">
{% for shelf in request.user.shelf_set.all %}
<li>
<button name="shelf" type="submit" value="{{ shelf.identifier }}" {% if shelf in book.shelf_set.all %} disabled {% endif %}>{{ shelf.name }} {% if shelf in book.shelf_set.all %} ✓ {% endif %}</button>
</li>
{% endfor %}
</form>
</ul>
</div>
{% endif %}
</div>
{% endif %}

View File

@ -0,0 +1,8 @@
<div class="stars">
<span class="hidden-text">{{ rating|floatformat }} star{{ rating|floatformat | pluralize }}</span>
{% for i in '12345'|make_list %}
<span class="icon icon-star-{% if rating >= forloop.counter %}full{% elif rating|floatformat:0 >= forloop.counter|floatformat:0 %}half{% else %}empty{% endif %}">
</span>
{% endfor %}
</div>

View File

@ -0,0 +1,24 @@
{% load fr_display %}
<div class="post {{ status.status_type | lower }} depth-{{ depth }} {% if main %}main{% else %}reply{% endif %}">
<h2>
{% if status.boosted_status %}
{% include 'snippets/status_header.html' with status=status.boosted_status %}
<small class="subhead">{% include 'snippets/status_header.html' with status=status %}</small>
{% else %}
{% include 'snippets/status_header.html' with status=status %}
{% endif %}
</h2>
<div class="status-content">
{% include 'snippets/status_content.html' with status=status %}
</div>
</div>
{% if status.status_type == 'Boost' %}
{% include 'snippets/interaction.html' with activity=status|boosted_status %}
{% else %}
{% include 'snippets/interaction.html' with activity=status %}
{% endif %}

View File

@ -0,0 +1,66 @@
{% load fr_display %}
{% if not hide_book and status.mention_books.count %}
<div class="row">
{% for book in status.mention_books.all|slice:"0:4" %}
<div class="row">
<div class="cover-container">
{% include 'snippets/book_cover.html' with book=book %}
{% if status.mention_books.count > 1 %}
<p>{% include 'snippets/book_titleby.html' with book=book %}</p>
{% endif %}
{% include 'snippets/rate_action.html' with book=book user=request.user %}
{% include 'snippets/shelve_button.html' with book=book %}
</div>
{% if status.mention_books.count == 1 %}
<div>
<p>{% include 'snippets/book_titleby.html' with book=book %}</p>
{% include 'snippets/book_description.html' with book=book %}
</div>
{% endif %}
</div>
{% endfor %}
</div>
{% endif %}
<div class="row">
{% if not hide_book and status.book %}
<div class="cover-container">
{% include 'snippets/book_cover.html' with book=status.book %}
{% include 'snippets/rate_action.html' with book=status.book user=request.user %}
{% include 'snippets/shelve_button.html' with book=status.book %}
</div>
{% endif %}
<div>
{% if status.status_type == 'Review' %}
<h3>
{% if status.name %}{{ status.name }}<br>{% endif %}
{% include 'snippets/stars.html' with rating=status.rating %}
</h3>
{% endif %}
{% if status.quote %}
<div class="quote">
<blockquote>{{ status.quote }}</blockquote>
<p> &mdash; {% include 'snippets/book_titleby.html' with book=status.book %}</p>
</div>
{% endif %}
{% if status.content and status.status_type != 'Update' and status.status_type != 'Boost' %}
<blockquote>{{ status.content | safe }}</blockquote>
{% endif %}
{% if not status.content and status.book and not hide_book and status.status_type != 'Boost' %}
{% include 'snippets/book_description.html' with book=status.book %}
{% endif %}
{% if status.status_type == 'Boost' %}
{% include 'snippets/status_content.html' with status=status|boosted_status %}
{% endif %}
{% if not max_depth and status.reply_parent or status|replies %}<p><a href="{{ status.remote_id }}">Thread</a>{% endif %}
</div>
</div>

View File

@ -0,0 +1,25 @@
{% load humanize %}
{% load fr_display %}
{% include 'snippets/avatar.html' with user=status.user %}
{% include 'snippets/username.html' with user=status.user %}
{% if status.status_type == 'Update' %}
{{ status.content | safe }}
{% elif status.status_type == 'Review' and not status.name and not status.content%}
rated <a href="/book/{{ status.book.id }}">{{ status.book.title }}</a>
{% elif status.status_type == 'Review' %}
reviewed <a href="/book/{{ status.book.id }}">{{ status.book.title }}</a>
{% elif status.status_type == 'Comment' %}
commented on <a href="/book/{{ status.book.id }}">{{ status.book.title }}</a>
{% elif status.status_type == 'Quotation' %}
quoted <a href="/book/{{ status.book.id }}">{{ status.book.title }}</a>
{% elif status.status_type == 'Boost' %}
boosted
{% elif status.reply_parent %}
{% with parent_status=status|parent %}
replied to {% include 'snippets/username.html' with user=parent_status.user possessive=True %} <a href="{{parent_status.remote_id }}">{{ parent_status.status_type | lower }}</a>
{% endwith %}
{% endif %}
<span class="time-ago">
<a href="{{ status.remote_id }}">{{ status.published_date | naturaltime }}</a>
</span>

View File

@ -0,0 +1,6 @@
{% for tab in tabs %}
<div class="tab {% if tab.id == active_tab %}active{% endif %}">
<a href="{{ path }}/{{ tab.id }}">{{ tab.display }}</a>
</div>
{% endfor %}

View File

@ -0,0 +1,20 @@
<div class="tag">
<a href="/tag/{{ tag.identifier|urlencode }}">{{ tag.name }}</a>
{% if tag.identifier in user_tags %}
<form class="tag-form" name="tag" action="/untag/" method="post">
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}">
<input type="hidden" name="name" value="{{ tag.name }}">
<button type="submit">x</button>
</form>
{% else %}
<form class="tag-form" name="tag" action="/tag/" method="post">
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}">
<input type="hidden" name="name" value="{{ tag.name }}">
<button type="submit">+</button>
</form>
{% endif %}
</div>

View File

@ -0,0 +1,18 @@
{% load fr_display %}
{% with depth=depth|add:1 %}
{% if depth <= max_depth and status.reply_parent and direction <= 0 %}
{% with direction=-1 %}
{% include 'snippets/thread.html' with status=status|parent is_root=False %}
{% endwith %}
{% endif %}
{% include 'snippets/status.html' with status=status main=is_root %}
{% if depth <= max_depth and direction >= 0 %}
{% for reply in status|replies %}
{% with direction=1 %}
{% include 'snippets/thread.html' with status=reply is_root=False %}
{% endwith %}
{% endfor %}
{% endif %}
{% endwith %}

View File

@ -0,0 +1,11 @@
<div>
<div>
{% include 'snippets/avatar.html' with user=user %}
{% include 'snippets/username.html' with user=user %}
<small>{{ user.username }}</small>
</div>
{% if not is_self %}
{% include 'snippets/follow_button.html' with user=user %}
{% endif %}
</div>

View File

@ -0,0 +1,2 @@
{% load fr_display %}
<a href="/user/{{ user | username }}" class="user">{% if user.name %}{{ user.name }}{% else %}{{ user | username }}{% endif %}</a>{% if possessive %}'s{% endif %}{% if show_full and user.name or show_full and user.localname %} ({{ user.username }}){% endif %}

View File

@ -0,0 +1,11 @@
{% extends 'layout.html' %}
{% block content %}
<div id="content">
<div class="comment-thread">
{% include 'snippets/thread.html' with status=status depth=0 max_depth=6 is_root=True direction=0 %}
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,20 @@
{% extends 'layout.html' %}
{% load fr_display %}
{% block content %}
<div class="content-container">
<h2>Books tagged "{{ tag.name }}"</h2>
<div class="book-grid row wrap shrink">
{% for book in books.all %}
<div class="cover-container">
<a href="/book/{{ book.id }}">
{% include 'snippets/book_cover.html' with book=book %}
</a>
{% include 'snippets/rate_action.html' with user=request.user book=book %}
{% include 'snippets/shelve_button.html' with book=book %}
</div>
{% endfor %}
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,21 @@
{% extends 'layout.html' %}
{% block content %}
{% include 'user_header.html' with user=user %}
{% include 'snippets/covers_shelf.html' with shelves=shelves user=user %}
<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 %}
{% if not activities %}
<div class="content-container">
<p>No activities yet!</a>
</div>
{% endif %}
</div>
{% endblock %}

View File

@ -0,0 +1,50 @@
{% load humanize %}
{% load fr_display %}
<div class="content-container user-profile">
<h2>User Profile
{% if is_self %}
<a href="/user-edit/" class="edit-link">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>
<p>
<a href="/user/{{ user|username }}/followers">{{ user.followers.count }} follower{{ user.followers.count | pluralize }}</a>,
<a href="/user/{{ user|username }}/following">{{ user.following.count }} following</a></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 class="follow-requests">
<h2>Follow Requests</h2>
{% for requester in user.follower_requests.all %}
<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>

View File

@ -0,0 +1,12 @@
{% extends 'layout.html' %}
{% block content %}
<div class="content-container">
{% for result in results %}
<div>
<h2>{{ result.username }}</h2>
{% include 'snippets/follow_button.html' with user=result %}
</div>
{% endfor %}
</div>
{% endblock %}

View File

@ -0,0 +1,14 @@
{% extends 'layout.html' %}
{% load fr_display %}
{% block content %}
{% include 'user_header.html' with user=user %}
{% for shelf in shelves %}
<div class="content-container">
<h2>{{ shelf.name }}</h2>
{% include 'snippets/shelf.html' with shelf=shelf ratings=ratings %}
</div>
{% endfor %}
{% endblock %}