mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-20 08:31:07 +00:00
Tags and tables
This commit is contained in:
parent
37a0ec0ba3
commit
0bea615b82
8 changed files with 45 additions and 37 deletions
|
@ -82,8 +82,11 @@ input.toggle-control:checked ~ .toggle-content {
|
||||||
.cover-container {
|
.cover-container {
|
||||||
height: 250px;
|
height: 250px;
|
||||||
}
|
}
|
||||||
|
.cover-container.is-small {
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
.book-cover {
|
.book-cover {
|
||||||
height: 100%
|
height: 100%;
|
||||||
object-fit: scale-down;
|
object-fit: scale-down;
|
||||||
}
|
}
|
||||||
.no-cover {
|
.no-cover {
|
||||||
|
@ -97,9 +100,9 @@ input.toggle-control:checked ~ .toggle-content {
|
||||||
left: 0;
|
left: 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.no-cover .title {
|
.is-small .no-cover div {
|
||||||
text-transform: uppercase;
|
font-size: 0.7em;
|
||||||
margin-bottom: 1em;
|
padding: 0.1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -71,9 +71,11 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="block">
|
<div class="block">
|
||||||
|
<div class="field is-grouped is-grouped-multiline">
|
||||||
{% for tag in tags %}
|
{% for tag in tags %}
|
||||||
{% include 'snippets/tag.html' with book=book tag=tag user_tags=user_tags %}
|
{% include 'snippets/tag.html' with book=book tag=tag user_tags=user_tags %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -59,10 +59,10 @@
|
||||||
<div class="navbar-end">
|
<div class="navbar-end">
|
||||||
{% if request.user.is_authenticated %}
|
{% if request.user.is_authenticated %}
|
||||||
<div class="navbar-item has-dropdown is-hoverable">
|
<div class="navbar-item has-dropdown is-hoverable">
|
||||||
<div class="navbar-link">
|
<div class="navbar-link"><p>
|
||||||
{% include 'snippets/avatar.html' with user=user %}
|
{% include 'snippets/avatar.html' with user=user %}
|
||||||
{% include 'snippets/username.html' with user=request.user %}
|
{% include 'snippets/username.html' with user=request.user %}
|
||||||
</div>
|
</p></div>
|
||||||
<div class="navbar-dropdown">
|
<div class="navbar-dropdown">
|
||||||
<a href="/user/{{request.user.localname}}" class="navbar-item">
|
<a href="/user/{{request.user.localname}}" class="navbar-item">
|
||||||
Profile
|
Profile
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
{% extends 'layout.html' %}
|
{% extends 'layout.html' %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<div id="content">
|
<div class="block">
|
||||||
<div>
|
<div>
|
||||||
<h2>{% include 'snippets/username.html' with user=user %} > {{ shelf.name }}</h2>
|
<h2 class="title">{% include 'snippets/username.html' with user=user %} > {{ shelf.name }}</h2>
|
||||||
{% include 'snippets/shelf.html' with shelf=shelf ratings=ratings %}
|
{% include 'snippets/shelf.html' with shelf=shelf ratings=ratings %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,16 +1,14 @@
|
||||||
{% load fr_display %}
|
{% load fr_display %}
|
||||||
|
<div class="cover-container is-{{ size }}">
|
||||||
{% if book.cover %}
|
{% if book.cover %}
|
||||||
<div class="cover-container">
|
<img class="book-cover" src="/images/{{ book.cover }}" alt="{% include 'snippets/cover_alt.html' with book=book %}">
|
||||||
<img class="book-cover {{ size }}" src="/images/{{ book.cover }}" alt="{% include 'snippets/cover_alt.html' with book=book %}">
|
|
||||||
</div>
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="cover-container">
|
<div class="no-cover book-cover">
|
||||||
<div class="no-cover book-cover {{ size }}">
|
<img class="book-cover" src="/static/images/no_cover.jpg" alt="No cover">
|
||||||
<img class="book-cover {{ size }}" src="/static/images/no_cover.jpg" alt="No cover">
|
|
||||||
<div>
|
<div>
|
||||||
<p>{{ book.title }}</p>
|
<p>{{ book.title }}</p>
|
||||||
<p>({{ book|edition_info }})</p>
|
<p>({{ book|edition_info }})</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{% load humanize %}
|
{% load humanize %}
|
||||||
{% load fr_display %}
|
{% load fr_display %}
|
||||||
{% if shelf.books %}
|
{% if shelf.books %}
|
||||||
<table class="table">
|
<table class="table is-striped is-fullwidth">
|
||||||
|
|
||||||
<tr class="book-preview">
|
<tr class="book-preview">
|
||||||
<th>
|
<th>
|
||||||
Cover
|
Cover
|
||||||
|
|
|
@ -1,20 +1,24 @@
|
||||||
<div class="tag">
|
<div class="control">
|
||||||
<a href="/tag/{{ tag.identifier|urlencode }}">{{ tag.name }}</a>
|
<div class="tags has-addons">
|
||||||
{% if tag.identifier in user_tags %}
|
<a class="tag is-link" href="/tag/{{ tag.identifier|urlencode }}">
|
||||||
<form class="tag-form" name="tag" action="/untag/" method="post">
|
{{ tag.name }}
|
||||||
{% csrf_token %}
|
</a>
|
||||||
<input type="hidden" name="book" value="{{ book.id }}">
|
<div class="tag">
|
||||||
<input type="hidden" name="name" value="{{ tag.name }}">
|
{% if tag.identifier in user_tags %}
|
||||||
<button type="submit">x</button>
|
<form name="tag" action="/untag/" method="post">
|
||||||
</form>
|
{% csrf_token %}
|
||||||
{% else %}
|
<input type="hidden" name="book" value="{{ book.id }}">
|
||||||
<form class="tag-form" name="tag" action="/tag/" method="post">
|
<input type="hidden" name="name" value="{{ tag.name }}">
|
||||||
{% csrf_token %}
|
<button type="submit">x<span class="hidden-text"> remove tag</span></button>
|
||||||
<input type="hidden" name="book" value="{{ book.id }}">
|
</form>
|
||||||
<input type="hidden" name="name" value="{{ tag.name }}">
|
{% else %}
|
||||||
<button type="submit">+</button>
|
<form name="tag" action="/tag/" method="post">
|
||||||
</form>
|
{% csrf_token %}
|
||||||
{% endif %}
|
<input type="hidden" name="book" value="{{ book.id }}">
|
||||||
|
<input type="hidden" name="name" value="{{ tag.name }}">
|
||||||
|
<button type="submit">+<span class="hidden-text"> add tag</span></button>
|
||||||
|
</form>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
{% include 'user_header.html' with user=user %}
|
{% include 'user_header.html' with user=user %}
|
||||||
|
|
||||||
{% for shelf in shelves %}
|
{% for shelf in shelves %}
|
||||||
<div class="content-container">
|
<div class="block">
|
||||||
<h2>{{ shelf.name }}</h2>
|
<h2 class="title">{{ shelf.name }}</h2>
|
||||||
{% include 'snippets/shelf.html' with shelf=shelf ratings=ratings %}
|
{% include 'snippets/shelf.html' with shelf=shelf ratings=ratings %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Loading…
Reference in a new issue