From e224f0bea768179cf44886dfbabbd296767d79dd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20St=C4=99pniowski?= Date: Fri, 22 Aug 2008 15:40:15 +0200 Subject: [PATCH 1/1] Renamed module catalogue.templatetags.catalogue to catalogue.templatetags.catalogue_tags. --- catalogue/forms.py | 3 ++- .../{catalogue.py => catalogue_tags.py} | 2 +- templates/admin/base_site.html | 1 - templates/base.html | 2 +- templates/catalogue/book_detail.html | 2 +- templates/catalogue/book_list.html | 2 +- templates/catalogue/book_sets.html | 18 ++++++++++-------- templates/catalogue/tagged_book_list.html | 2 +- 8 files changed, 17 insertions(+), 15 deletions(-) rename catalogue/templatetags/{catalogue.py => catalogue_tags.py} (99%) diff --git a/catalogue/forms.py b/catalogue/forms.py index 5708d897b..7472eb420 100644 --- a/catalogue/forms.py +++ b/catalogue/forms.py @@ -8,7 +8,8 @@ from catalogue.lib.slughifi import slughifi class SearchForm(forms.Form): q = JQueryAutoCompleteField('/katalog/tags/', {'minChars': 2, 'selectFirst': True, 'cacheLength': 50}) - + tags = forms.CharField(widget=forms.HiddenInput) + def __init__(self, *args, **kwargs): super(SearchForm, self).__init__(*args, **kwargs) self.fields['q'].widget.attrs['title'] = u'tytuł utworu, motyw lub kategoria' diff --git a/catalogue/templatetags/catalogue.py b/catalogue/templatetags/catalogue_tags.py similarity index 99% rename from catalogue/templatetags/catalogue.py rename to catalogue/templatetags/catalogue_tags.py index 6b06f3802..43713ce0d 100644 --- a/catalogue/templatetags/catalogue.py +++ b/catalogue/templatetags/catalogue_tags.py @@ -4,7 +4,7 @@ from django.template import Node, Variable from django.utils.encoding import smart_str from django.core.urlresolvers import reverse from django.contrib.auth.forms import UserCreationForm, AuthenticationForm - + register = template.Library() diff --git a/templates/admin/base_site.html b/templates/admin/base_site.html index 8a4e1b0ea..d0ca937a0 100644 --- a/templates/admin/base_site.html +++ b/templates/admin/base_site.html @@ -1,5 +1,4 @@ {% extends "admin/base.html" %} -{% load i18n %} {% block title %}{{ title }} | Administracja stroną WolneLektury.pl{% endblock %} diff --git a/templates/base.html b/templates/base.html index 84cfd36b7..69f5dd2f9 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,4 +1,4 @@ -{% load chunks compressed catalogue %} +{% load chunks compressed catalogue_tags %} diff --git a/templates/catalogue/book_detail.html b/templates/catalogue/book_detail.html index 8746edbb5..a23e6315e 100644 --- a/templates/catalogue/book_detail.html +++ b/templates/catalogue/book_detail.html @@ -1,5 +1,5 @@ {% extends "base.html" %} -{% load catalogue %} +{% load catalogue_tags %} {% block title %}Lektura {{ book.title }} w WolneLektury.pl{% endblock %} diff --git a/templates/catalogue/book_list.html b/templates/catalogue/book_list.html index dc2ebf960..f6c3b75fa 100644 --- a/templates/catalogue/book_list.html +++ b/templates/catalogue/book_list.html @@ -1,5 +1,5 @@ {% extends "base.html" %} -{% load catalogue chunks %} +{% load catalogue_tags chunks %} {% block bodyid %}book-a-list{% endblock %} diff --git a/templates/catalogue/book_sets.html b/templates/catalogue/book_sets.html index 1b87c12af..1ae34c3cd 100644 --- a/templates/catalogue/book_sets.html +++ b/templates/catalogue/book_sets.html @@ -1,15 +1,17 @@ -{% if book %}

Zestawy zawierające utwór {{ book.title }}

-
-
    -
  1. {{ form.set_ids }}
  2. -
  3. -
-
+{% if not user.tag_set.count %} +

Nie posiadasz żadnych zestawów. Jeśli chcesz, możesz utworzyć nowy zestaw poniżej.

+{% else %} +
+
    +
  1. {{ form.set_ids }}
  2. +
  3. +
+
{% endif %}
    -
  1. {{ new_set_form.name }}
  2. +
  3. {{ new_set_form.name }}
\ No newline at end of file diff --git a/templates/catalogue/tagged_book_list.html b/templates/catalogue/tagged_book_list.html index 3fd8e7255..695a49240 100644 --- a/templates/catalogue/tagged_book_list.html +++ b/templates/catalogue/tagged_book_list.html @@ -1,5 +1,5 @@ {% extends "base.html" %} -{% load catalogue pagination_tags %} +{% load catalogue_tags pagination_tags %} {% block title %}{% title_from_tags tags %} w WolneLektury.pl{% endblock %} -- 2.20.1