fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
f421853
)
Fixed complex books (books with hasPart).
author
Marek Stępniowski
<marek@stepniowski.com>
Tue, 16 Sep 2008 18:59:34 +0000
(20:59 +0200)
committer
Marek Stępniowski
<marek@stepniowski.com>
Tue, 16 Sep 2008 18:59:34 +0000
(20:59 +0200)
apps/catalogue/models.py
patch
|
blob
|
history
apps/catalogue/views.py
patch
|
blob
|
history
wolnelektury/media/css/master.css
patch
|
blob
|
history
wolnelektury/templates/catalogue/book_detail.html
patch
|
blob
|
history
wolnelektury/templates/catalogue/book_short.html
patch
|
blob
|
history
diff --git
a/apps/catalogue/models.py
b/apps/catalogue/models.py
index
f31dbe6
..
2a93873
100644
(file)
--- a/
apps/catalogue/models.py
+++ b/
apps/catalogue/models.py
@@
-166,7
+166,7
@@
class Book(models.Model):
book.tags = book_tags
if hasattr(book_info, 'parts'):
book.tags = book_tags
if hasattr(book_info, 'parts'):
- for
part_url, n
in enumerate(book_info.parts):
+ for
n, part_url
in enumerate(book_info.parts):
base, slug = part_url.rsplit('/', 1)
child_book = Book.objects.get(slug=slug)
child_book.parent = book
base, slug = part_url.rsplit('/', 1)
child_book = Book.objects.get(slug=slug)
child_book.parent = book
diff --git
a/apps/catalogue/views.py
b/apps/catalogue/views.py
index
acf2ea2
..
f07f9ab
100644
(file)
--- a/
apps/catalogue/views.py
+++ b/
apps/catalogue/views.py
@@
-130,6
+130,7
@@
def book_detail(request, slug):
book = get_object_or_404(models.Book, slug=slug)
tags = list(book.tags.filter(~Q(category='set')))
categories = split_tags(tags)
book = get_object_or_404(models.Book, slug=slug)
tags = list(book.tags.filter(~Q(category='set')))
categories = split_tags(tags)
+ book_children = book.children.all().order_by('parent_number')
form = forms.SearchForm()
return render_to_response('catalogue/book_detail.html', locals(),
form = forms.SearchForm()
return render_to_response('catalogue/book_detail.html', locals(),
diff --git
a/wolnelektury/media/css/master.css
b/wolnelektury/media/css/master.css
index
82d55a8
..
fae4417
100644
(file)
--- a/
wolnelektury/media/css/master.css
+++ b/
wolnelektury/media/css/master.css
@@
-383,13
+383,18
@@
div.shown-tags p {
margin-left: 3.5em;
}
margin-left: 3.5em;
}
-.book-thumbnail {
+.book-thumbnail
, .book-parent-thumbnail
{
background: transparent url(/media/img/book.png) no-repeat 0 0;
width: 3em;
height: 3em;
float: left;
}
background: transparent url(/media/img/book.png) no-repeat 0 0;
width: 3em;
height: 3em;
float: left;
}
+.book-parent-thumbnail {
+ background: transparent url(/media/img/book-parent.png) no-repeat 0 0;
+}
+
+
/* =============== */
/* = Simple form = */
/* =============== */
/* =============== */
/* = Simple form = */
/* =============== */
diff --git
a/wolnelektury/templates/catalogue/book_detail.html
b/wolnelektury/templates/catalogue/book_detail.html
index
e6b5eb0
..
b567596
100644
(file)
--- a/
wolnelektury/templates/catalogue/book_detail.html
+++ b/
wolnelektury/templates/catalogue/book_detail.html
@@
-54,12
+54,14
@@
</ul>
</div>
</ul>
</div>
- {% if book
.children.all
%}
+ {% if book
_children
%}
<div id="book-children">
<h2>Utwory składające się na ten utwór:</h2>
<div id="book-children">
<h2>Utwory składające się na ten utwór:</h2>
- {% for book in book.children.all %}
- <li><a href="{{ book.get_absolute_url }}">{{ book.title }}</a></li>
+ <ol>
+ {% for book in book_children %}
+ <li>{{ book.short_html }}</li>
{% endfor %}
{% endfor %}
+ </ol>
</div>
{% endif %}
</div>
{% endif %}
diff --git
a/wolnelektury/templates/catalogue/book_short.html
b/wolnelektury/templates/catalogue/book_short.html
index
7f93a59
..
368126d
100644
(file)
--- a/
wolnelektury/templates/catalogue/book_short.html
+++ b/
wolnelektury/templates/catalogue/book_short.html
@@
-2,7
+2,7
@@
<div class="change-sets">
<a href="{% url catalogue.views.book_sets book.slug %}" class="jqm-trigger">Na półkę!</a>
</div>
<div class="change-sets">
<a href="{% url catalogue.views.book_sets book.slug %}" class="jqm-trigger">Na półkę!</a>
</div>
- {% if book.children %}
+ {% if book.children
.all|length
%}
<div class="book-parent-thumbnail"></div>
{% else %}
<div class="book-thumbnail"></div>
<div class="book-parent-thumbnail"></div>
{% else %}
<div class="book-thumbnail"></div>