From: Marek Stępniowski Date: Thu, 11 Sep 2008 15:13:18 +0000 (+0200) Subject: Various style fixes. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/25881fff0322a55a8c0869557e966afb9c02beb9 Various style fixes. --- diff --git a/apps/catalogue/forms.py b/apps/catalogue/forms.py index e20adbadc..523b1d636 100644 --- a/apps/catalogue/forms.py +++ b/apps/catalogue/forms.py @@ -13,7 +13,7 @@ class SearchForm(forms.Form): def __init__(self, *args, **kwargs): tags = kwargs.pop('tags', []) super(SearchForm, self).__init__(*args, **kwargs) - self.fields['q'].widget.attrs['title'] = u'tytuł utworu, motyw lub kategoria' + self.fields['q'].widget.attrs['title'] = u'tytuł utworu, kategoria lub motyw literacki' self.fields['tags'].initial = '/'.join(tag.slug for tag in Tag.get_tag_list(tags)) diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index 3b9f31d16..607b4d2c1 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -73,14 +73,15 @@ def main_page(request): if request.user.is_authenticated(): shelves = models.Tag.objects.filter(category='set', user=request.user) new_set_form = forms.NewSetForm() - extra_where = '((NOT catalogue_tag.category = "set" AND catalogue_tag.main_page = 1) OR catalogue_tag.user_id = %d)' % request.user.id + extra_where = '(NOT catalogue_tag.category = "set" OR catalogue_tag.user_id = %d)' % request.user.id else: - extra_where = 'NOT catalogue_tag.category = "set" AND catalogue_tag.main_page = 1' + extra_where = 'NOT catalogue_tag.category = "set"' tags = models.Tag.objects.usage_for_model(models.Book, counts=True, extra={'where': [extra_where]}) fragment_tags = models.Tag.objects.usage_for_model(models.Fragment, counts=True, extra={'where': ['catalogue_tag.category = "theme"'] + [extra_where]}) categories = split_tags(tags) + print categories form = forms.SearchForm() return render_to_response('catalogue/main_page.html', locals(), diff --git a/wolnelektury/media/css/master.css b/wolnelektury/media/css/master.css index d2fc0fc16..aa16cb70a 100644 --- a/wolnelektury/media/css/master.css +++ b/wolnelektury/media/css/master.css @@ -470,9 +470,16 @@ p .ac_input { padding: 0; } +.shelf-list li { + padding: 0.25em; + margin: 0 -0.25em; +} + .shelf-list a.delete-shelf { color: #900; float: right; + padding: 0.25em 0.25em 0.25em 1em; + margin: -0.25em; } .shelf-list a.delete-shelf:active, .shelf-list a.delete-shelf:hover { diff --git a/wolnelektury/media/js/catalogue.js b/wolnelektury/media/js/catalogue.js index 1d631e3cc..c9d5457d2 100644 --- a/wolnelektury/media/js/catalogue.js +++ b/wolnelektury/media/js/catalogue.js @@ -89,6 +89,14 @@ } }); + $('ul.shelf-list li').hover(function() { + $(this).css({background: '#EEE', cursor: 'pointer'}); + }, function() { + $(this).css({background: 'transparent'}); + }).click(function() { + location.href = $('a.visit-shelf', this).attr('href'); + }); + $('.delete-shelf').click(function() { var link = $(this); var shelf_name = $('.visit-shelf', link.parent()).text(); diff --git a/wolnelektury/templates/catalogue/main_page.html b/wolnelektury/templates/catalogue/main_page.html index a1418ce96..6af8d69d8 100644 --- a/wolnelektury/templates/catalogue/main_page.html +++ b/wolnelektury/templates/catalogue/main_page.html @@ -13,7 +13,7 @@
-

↓ Przeglądaj lektury według wybranych kategorii i motywów ↓

+

↓ Przeglądaj lektury według wybranych kategorii i motywów literackich ↓

Twoje półki z lekturami

{% if user.is_authenticated %}