msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-05-09 16:09+0200\n"
+"POT-Creation-Date: 2013-05-10 10:38+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2);\n"
-#: models.py:8 models.py:22
+#: models.py:8 models.py:26
msgid "name"
msgstr "nazwa"
msgid "catalogs"
msgstr "katalogi"
-#: models.py:24
+#: models.py:28
msgid "url"
msgstr "url"
-#: models.py:25
+#: models.py:29
msgid "description"
msgstr "opis"
-#: models.py:28
+#: models.py:32
msgid "library"
msgstr "biblioteka"
-#: models.py:29
+#: models.py:33
msgid "libraries"
msgstr "biblioteki"
-#: templates/libraries/main_view.html:4 templates/libraries/main_view.html:8
+#: templates/libraries/library_view.html:4
+#: templates/libraries/library_view.html:8
msgid "Libraries directory"
msgstr "Katalog bibliotek"
+
+#: templates/libraries/main_view.html:4 templates/libraries/main_view.html:8
+msgid "Library directories"
+msgstr "Katalogi bibliotek"
+
def __unicode__(self):\r
return self.name\r
\r
- \r
+ @models.permalink\r
+ def get_absolute_url(self):\r
+ return ('library_view', [self.slug])\r
+ \r
+ \r
class Library(models.Model):\r
"""Represent a single library in the libraries dictionary"""\r
\r
--- /dev/null
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block titleextra %}{% trans 'Libraries directory' %}{% endblock %}
+
+
+{% block body %}
+ <h1>{% trans 'Libraries directory' %}: {{ catalog.name }}</h1>
+
+ <div class="libraries-list">
+ {% for library in catalog.libraries.all %}
+ <div class="libraries-list-item">
+ <div class="libraries-list-item-header"><a href="{{library.url}}">{{library.name}}</a></div>
+ <div class="libraries-list-item-description">
+
+ {% autoescape off %}{{library.description}}{% endautoescape%}
+ </div>
+ </div>
+ {% endfor %}
+ </div>
+
+{% endblock %}
\ No newline at end of file
-{% extends "base.html" %}
-{% load i18n %}
-
-{% block titleextra %}{% trans 'Libraries directory' %}{% endblock %}
-
-
-{% block body %}
- <h1>{% trans 'Libraries directory' %}: {{ catalog.name }}</h1>
-
- <div class="libraries-list">
- {% for library in catalog.libraries.all %}
- <div class="libraries-list-item">
- <div class="libraries-list-item-header"><a href="{{library.url}}">{{library.name}}</a></div>
- <div class="libraries-list-item-description">
-
- {% autoescape off %}{{library.description}}{% endautoescape%}
- </div>
- </div>
+{% extends "base.html" %}\r
+{% load i18n %}\r
+\r
+{% block titleextra %}{% trans 'Library directories' %}{% endblock %}\r
+\r
+\r
+{% block body %}\r
+ <h1>{% trans 'Library directories' %}</h1>
+ <ul>
+ {% for catalog in catalogs %}
+ <li><a href="{{catalog.get_absolute_url}}">{{catalog}}</a></li>
{% endfor %}
- </div>
-
+ </ul>\r
+\r
{% endblock %}
\ No newline at end of file
from django.conf.urls.defaults import patterns, url
+from django.http import HttpResponseRedirect
urlpatterns = patterns('libraries.views',
- url(r'^(?P<slug>[a-zA-Z0-9_-]+)$', 'main_view', name='libraries_main_view'),
+ url(r'^$', 'main_view', name='libraries_main_view'),
+ url(r'^/$', lambda x: HttpResponseRedirect(x.path[:-1])),
+ url(r'^/(?P<slug>[a-zA-Z0-9_-]+)$', 'library_view', name='library_view'),
)
\ No newline at end of file
from libraries.models import Catalog\r
\r
\r
-def main_view(request, slug):\r
+def main_view(request):\r
+ context = RequestContext(request)\r
+ context['catalogs'] = Catalog.objects.all()\r
+ return render_to_response('libraries/main_view.html', context_instance = context)\r
+\r
+def library_view(request, slug):\r
context = RequestContext(request)\r
context['catalog'] = get_object_or_404(Catalog.objects.filter(slug = slug).select_related())\r
- return render_to_response('libraries/main_view.html', context_instance = context)
\ No newline at end of file
+ return render_to_response('libraries/library_view.html', context_instance = context)
\ No newline at end of file
url(r'^ludzie/', include('social.urls')),
url(r'^uzytkownik/', include('allauth.urls')),
url(r'^czekaj/', include('waiter.urls')),
- url(r'^biblioteki/', include('libraries.urls')),
+ url(r'^biblioteki', include('libraries.urls')),
# Admin panel
url(r'^admin/catalogue/book/import$', 'catalogue.views.import_book', name='import_book'),