fmartingr
/
shelfzilla
Archived
1
0
Fork 0

Unified volume includes into one so the own/wishlist functionality works around all the site. Fixes #33

This commit is contained in:
Felipe Martín 2014-08-26 19:18:25 +02:00
parent ca8ddaf748
commit c460351674
7 changed files with 88 additions and 90 deletions

View File

@ -20,13 +20,13 @@
}
.volume-item {
min-height: 150px !important;
min-height: 150px;
&.slim {
min-height: 150px;
&.volume-slim {
min-height: 100px;
.volume-content {
padding-left: 130px;
padding-left: 86px;
.volume-number {
font-weight: bold;
@ -35,26 +35,24 @@
}
}
&:hover .badge {
display: block !important;
}
// Badges
&:not(.user-have-it) {
&:hover .badges .badge {
display: block;
}
}
&.user-wishlisted-it .badge-wishlist-it {
display: block !important;
}
&.user-have-it .badge-have-it {
display: block !important;
}
.badges {
position: absolute;
left: 10px;
top: -10px;
&.user-wishlisted-it .badge-wishlist-it {
display: block !important;
}
&.user-have-it .badge-have-it {
display: block !important;
}
.badge {
@size: 34px;

View File

@ -13,7 +13,7 @@
<div class="row">
{% for volume in FUTURE_RELEASES %}
<div class="col-sm-6 latest-manga">
{% include "manga/series/includes/volume_slim.html" with volume=volume user=user %}
{% include "manga/series/includes/volume.html" with volume=volume user=user show_publisher=True type='slim' %}
</div>
{% if forloop.counter|divisibleby:2 %}
</div><div class="row">
@ -28,7 +28,7 @@
<div class="row">
{% for volume in LATEST_MANGA_ADDED %}
<div class="col-sm-6 latest-manga">
{% include "manga/series/includes/volume_slim.html" with volume=volume user=user %}
{% include "manga/series/includes/volume.html" with volume=volume user=user show_publisher=True type='slim' %}
</div>
{% if forloop.counter|divisibleby:2 %}
</div><div class="row">

View File

@ -147,8 +147,8 @@
</div>
<div class="row">
{% for volume in item_volumes %}
<div class="col-sm-4" data-pjax-container="v{{ volume.pk }}">
{% include "manga/series/includes/volume.html" with volume=volume user=user show_publisher=True show_details=True %}
<div class="col-sm-4">
{% include "manga/series/includes/volume.html" with volume=volume user=user show_publisher=True show_details=True show_language=True %}
</div>
{% if forloop.counter|divisibleby:3 %}
</div>

View File

@ -0,0 +1,20 @@
<div class="badges {% if volume.pk in user_have_volumes %}user-have-it{% endif %} {% if volume.pk in user_wishlisted_volumes %}user-wishlisted-it{% endif %}">
{% if volume.pk in user_have_volumes %}
<a href="{% url "volume.have_it" volume.pk %}" data-pjax="v{{ volume.pk }}" pjax-nopush pjax-messages>
<span class="badge badge-success badge-have-it">
<i class="glyphicon glyphicon-ok"></i>
</span>
</a>
{% else %}
<a href="{% url "volume.have_it" volume.pk %}" data-pjax="v{{ volume.pk }}" pjax-nopush pjax-messages>
<span class="badge badge-have-it">
<i class="glyphicon glyphicon-ok"></i>
</span>
</a>
<a href="{% url "volume.wishlist" volume.pk %}" data-pjax="v{{ volume.pk }}" pjax-messages pjax-nopush>
<span class="badge badge-wishlist-it {% if volume.pk in user_wishlisted_volumes %}badge-warning{% endif %}">
<i class="glyphicon glyphicon-star"></i>
</span>
</a>
{% endif %}
</div>

View File

@ -1,55 +1,51 @@
{% load i18n thumbnail staticfiles %}
<div class="well text-center volume-item {% if volume.pk in user_have_volumes %}user-have-it{% endif %} {% if volume.pk in user_wishlisted_volumes %}user-wishlisted-it{% endif %} {{ css_class }}" style="background: white url({% thumbnail volume.cover 120x150 %}) center left no-repeat;">
<div class="badges">
{% if volume.pk in user_have_volumes %}
<a href="{% url "volume.have_it" volume.pk %}" data-pjax="v{{ volume.pk }}" pjax-nopush pjax-messages>
<span class="badge badge-success badge-have-it">
<i class="glyphicon glyphicon-ok"></i>
</span>
</a>
{% else %}
<a href="{% url "volume.have_it" volume.pk %}" data-pjax="v{{ volume.pk }}" pjax-nopush pjax-messages>
<span class="badge badge-have-it">
<i class="glyphicon glyphicon-ok"></i>
</span>
</a>
<a href="{% url "volume.wishlist" volume.pk %}" data-pjax="v{{ volume.pk }}" pjax-messages pjax-nopush>
<span class="badge badge-wishlist-it {% if volume.pk in user_wishlisted_volumes %}badge-warning{% endif %}">
<i class="glyphicon glyphicon-star"></i>
</span>
</a>
{% if type == 'slim' %}
{% thumbnail volume.cover 80x110 crop as volume_thumb %}
{% else %}
{% thumbnail volume.cover 120x150 as volume_thumb %}
{% endif %}
<div>
<div class="well text-center volume-item volume-{{ type }}" style="background: white url({{ volume_thumb.url }}) center left no-repeat;">
<div data-pjax-container="v{{ volume.pk }}">
{% include "manga/series/includes/volume-badges.html" %}
</div>
<div class="text-center volume-content">
{% if type == 'slim' %}
<a href="{{ volume.series.get_absolute_url }}" data-pjax>
<h4 class="media-heading">{{ volume }}</h4>
</a>
{% else %}
<div class="volume-number">
{% if show_language and volume.language %}
<img src="{% static "images/flags/"|add:volume.language.code|add:'.gif' code %}" />
{% endif %}
{% if volume.number %}#{{ volume.number }}{% endif %}
{% if volume.name %}{{ volume.name }}{% endif %}
</div>
{% endif %}
{% if volume.collection and not volume.collection.default %}
<div><span class="label label-primary">{{ volume.collection.name }}</span></div>
{% endif %}
{% if show_publisher %}
<div><a href="{{ volume.publisher.get_absolute_url }}" data-pjax>{{ volume.publisher }}</a></div>
{% endif %}
{% if volume.release_date %}
<div>{{ volume.release_date|date:"F Y" }}</div>
{% endif %}
{% if show_details %}
{% if volume.pages %}
<div>{% blocktrans with pages=volume.pages %}{{ pages }} pages{% endblocktrans %}</div>
{% endif %}
{% endif %}
</div>
{% if USER_IS_STAFF and USER_CONFIG.show_admin_links %}
<div class="admin">
<a class="btn btn-info btn-xs"
href="{% url 'admin:manga_volume_change' volume.pk %}">
{% trans "Edit in admin" %}</a>
</div>
{% endif %}
</div>
<div class="text-center volume-content">
<div class="volume-number">
{% if volume.language %}
<img src="{% static "images/flags/"|add:volume.language.code|add:'.gif' code %}" />
{% endif %}
{% if volume.number %}#{{ volume.number }}{% endif %}
{% if volume.name %}{{ volume.name }}{% endif %}
</div>
{% if volume.collection and not volume.collection.default %}
<div><span class="label label-primary">{{ volume.collection.name }}</span></div>
{% endif %}
{% if show_publisher %}
<div><a href="{{ volume.publisher.get_absolute_url }}" data-pjax>{{ volume.publisher }}</a></div>
{% endif %}
{% if volume.release_date %}
<div>{{ volume.release_date|date:"F Y" }}</div>
{% endif %}
{% if show_details %}
{% if volume.pages %}
<div>{% blocktrans with pages=volume.pages %}{{ pages }} pages{% endblocktrans %}</div>
{% endif %}
{% endif %}
{% if volume.for_review and user.is_staff %}
{% endif %}
</div>
{% if USER_IS_STAFF and USER_CONFIG.show_admin_links %}
<div class="admin">
<a class="btn btn-info btn-xs"
href="{% url 'admin:manga_volume_change' volume.pk %}">
{% trans "Edit in admin" %}</a>
</div>
{% endif %}
</div>

View File

@ -1,16 +0,0 @@
{% load thumbnail %}
<div class="well text-right item" style="background: white url({% thumbnail volume.cover 80x120 crop %}) top left no-repeat;">
<div class="content">
<a href="{{ volume.series.get_absolute_url }}" data-pjax>
<h4 class="media-heading">{{ volume }}</h4>
</a>
<p>
<a href="{{ volume.publisher.get_absolute_url }}" data-pjax>{{ volume.publisher }}</a><br />
{% if volume.collection and not volume.collection.default %}
<span class="label label-primary">{{ volume.collection.name }}</span><br />
{% endif %}
{{ volume.release_date|date:'F Y' }}
</p>
</div>
<div class="clearfix"></div>
</div>

View File

@ -3,5 +3,5 @@
{% block page_title %}{{ block.super }} | {{ volume.series.name }}{% endblock %}
{% block main_content %}
{% include "manga/series/includes/volume.html" %}
{% include "manga/series/includes/volume-badges.html" %}
{% endblock %}