Redesign (front page, login page)

This commit is contained in:
Mouse Reeve
2020-03-15 14:15:36 -07:00
parent 67e7eaaf85
commit 3efc8d45c3
30 changed files with 769 additions and 249 deletions

View File

@ -1,10 +0,0 @@
{% load humanize %}
<h2>
{% include 'snippets/avatar.html' with user=activity.user %}
{% include 'snippets/username.html' with user=activity.user %}
{{ content | safe }}
<span class="time-ago">
<a href="{{ activity.absolute_id }}">{{ activity.published_date | naturaltime }}</a>
</span>
</h2>

View File

@ -15,4 +15,4 @@
<blockquote>{{ book.description | description }}</blockquote>
{% endif %}
{% include 'snippets/shelve-button.html' with book=book pulldown=shelf_pulldown %}
{% include 'snippets/shelve_button.html' with book=book pulldown=shelf_pulldown %}

View File

@ -0,0 +1,6 @@
{% load fr_display %}
{% for book in books %}
<div class="book-preview">
{% include 'snippets/book.html' with rating=rating %}
</div>
{% endfor %}

View File

@ -0,0 +1,32 @@
{% load humanize %}
{% load fr_display %}
<h2>
{% include 'snippets/avatar.html' with user=user %}
Your thoughts on
<a href="/book/{{ book.openlibrary_key }}">{{ book.title }}</a>
by {% include 'snippets/authors.html' with book=book %}
</h2>
<div class="tabs secondary">
<div class="tab active">
Review
</div>
<div class="tab">
Comment
</div>
<div class="tab">
Quote
</div>
</div>
<div class="book-preview">
{% include 'snippets/book_cover.html' with book=book %}
<form class="review-form" name="review" action="/review/" method="post">
{% csrf_token %}
{# TODO: this shouldn't use the openlibrary key #}
<input type="hidden" name="book" value="{{ book.openlibrary_key }}"></input>
{{ review_form.as_p }}
<button type="submit">Post review</button>
</form>
</div>

View File

@ -5,7 +5,7 @@
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}"></input>
<input type="hidden" name="shelf" value="{% shelve_button_identifier book %}"></input>
<button type="submit">{% shelve_button_text book %}</button>
<button class="secondary" type="submit">{% shelve_button_text book %}</button>
</form>
{% else %}
@ -21,7 +21,7 @@
</option>
{% endfor %}
</select>
<button type="submit">Shelve</button>
<button class="secondary" type="submit">Shelve</button>
</form>
{% endif %}

View File

@ -1,21 +1,48 @@
{% load humanize %}
{% load fr_display %}
<div class="post {{ status.status_type|lower }} depth-{{ depth }} {% if main %}main{% else %}reply{% endif %}">
{% include 'snippets/activity_banner.html' with activity=status %}
<h2>
{% 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' %}
reviewed {{ status.book.title }}
{% 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.absolute_id }}">{{ parent_status.status_type|lower }}</a>
{% endwith %}
{% endif %}
<span class="time-ago">
<a href="{{ status.absolute_id }}">{{ status.published_date | naturaltime }}</a>
</span>
</h2>
{% if not hide_book and status.mention_books.count %}
<div class="book-preview">
{% include 'snippets/book.html' with book=status.mention_books.first %}
{% if status.status_type == 'Review' %}
{% include 'snippets/book.html' with book=status.mention_books.first %}
{% else %}
{% include 'snippets/book.html' with book=status.mention_books.first description=True %}
{% endif %}
</div>
{% endif %}
{% if not hide_book and status.book%}
<div class="book-preview">
{% include 'snippets/book.html' with book=status.book %}
{% if status.status_type == 'Review' %}
{% include 'snippets/book.html' with book=status.book %}
{% else %}
{% include 'snippets/book.html' with book=status.book description=True %}
{% endif %}
</div>
{% endif %}
{% if status.status_type == 'Review' %}<h4>{{ status.name }}
<small>{{ status.rating | stars }} stars, by {% include 'snippets/username.html' with user=status.user %}</small>
</h4>{% endif %}
{% if status.status_type != 'Update' %}
<blockquote>{{ status.content | safe }}</blockquote>
{% endif %}
{% if not max_depth and status.reply_parent or status|replies %}<p><a href="{{ status.absolute_id }}">Thread</a>{% endif %}
{% include 'snippets/interaction.html' with activity=status %}
</div>
{% include 'snippets/interaction.html' with activity=status %}

View File

@ -1,8 +1,6 @@
<div class="tabs">
{% for tab in tabs %}
<div class="tab {% if tab == active_tab %}active{% endif %}">
<a href="{{ path }}/{{ tab }}">{{ tab }}</a>
</div>
{% endfor %}
{% 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

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