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))
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(),
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 {
}
});
+ $('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();
</form>
<div id="intro">
- <p id="tags-description">↓ Przeglądaj lektury według wybranych kategorii i motywów ↓</p>
+ <p id="tags-description">↓ Przeglądaj lektury według wybranych kategorii i motywów literackich ↓</p>
<div id="propaganda">
<h2>Twoje półki z lekturami</h2>
{% if user.is_authenticated %}