Various style changes.
authorMarek Stępniowski <marek@stepniowski.com>
Fri, 22 Aug 2008 12:16:16 +0000 (14:16 +0200)
committerMarek Stępniowski <marek@stepniowski.com>
Fri, 22 Aug 2008 12:16:16 +0000 (14:16 +0200)
catalogue/forms.py
catalogue/models.py
catalogue/templatetags/catalogue.py
media/css/master.css
templates/base.html

index b383f99..5708d89 100644 (file)
@@ -14,6 +14,14 @@ class SearchForm(forms.Form):
         self.fields['q'].widget.attrs['title'] = u'tytuł utworu, motyw lub kategoria'
 
 
+class UserSetsForm(forms.Form):
+    def __init__(self, book, user, *args, **kwargs):
+        super(UserSetsForm, self).__init__(*args, **kwargs)
+        self.fields['set_ids'] = forms.ChoiceField(
+            choices=[(tag.id, tag.name) for tag in Tag.objects.filter(category='set', user=user)],
+        )
+
+
 class BookSetsForm(forms.Form):
     def __init__(self, book, user, *args, **kwargs):        
         super(BookSetsForm, self).__init__(*args, **kwargs)
index b49747b..483741b 100644 (file)
@@ -54,6 +54,14 @@ class Tag(TagBase):
     def __unicode__(self):
         return self.name
 
+    @staticmethod
+    def get_tag_list(tags):
+        if isinstance(tags, basestring):
+            tag_slugs = tags.split('/')
+            return [Tag.objects.get(slug=slug) for slug in tag_slugs]
+        else:
+            return TagBase.get_tag_list(tags)
+
 
 class Book(models.Model):
     title = models.CharField(_('title'), max_length=120)
index f2f35dd..6b06f38 100644 (file)
@@ -3,19 +3,19 @@ from django import template
 from django.template import Node, Variable
 from django.utils.encoding import smart_str
 from django.core.urlresolvers import reverse
-from django.contrib.auth import forms
-
+from django.contrib.auth.forms import UserCreationForm, AuthenticationForm
+    
 
 register = template.Library()
 
 
-class RegistrationForm(forms.UserCreationForm):
+class RegistrationForm(UserCreationForm):
     def as_ul(self):
         "Returns this form rendered as HTML <li>s -- excluding the <ul></ul>."
         return self._html_output(u'<li>%(errors)s%(label)s %(field)s<span class="help-text">%(help_text)s</span></li>', u'<li>%s</li>', '</li>', u' %s', False)
 
 
-class LoginForm(forms.AuthenticationForm):
+class LoginForm(AuthenticationForm):
     def as_ul(self):
         "Returns this form rendered as HTML <li>s -- excluding the <ul></ul>."
         return self._html_output(u'<li>%(errors)s%(label)s %(field)s<span class="help-text">%(help_text)s</span></li>', u'<li>%s</li>', '</li>', u' %s', False)
index 41c40c0..4450eb1 100644 (file)
@@ -388,3 +388,7 @@ em {
     list-style: none;
 }
 
+#top-message {
+    background-color: #2F4110;
+    color: #FFF;
+}
\ No newline at end of file
index 03f8e19..84cfd36 100644 (file)
@@ -12,6 +12,9 @@
         {% endblock %}
     </head>
     <body id="{% block bodyid %}base{% endblock %}">
+        <div id="top-message">
+            {% chunk "top-message" %}
+        </div>
         <div id="header">
             <div id="logo">
                 <a href="/"><img src="/media/img/logo.png" alt="WolneLektury.pl - logo" /></a>
@@ -20,6 +23,7 @@
                 {% if user.is_authenticated %}
                     <p>
                         Zalogowany jako <strong>{{ user.username }}</strong>
+                        | <a href="#">Zestawy</a>
                         {% if user.is_staff %}
                         | <a href="/admin/">Administracja</a>
                         {% endif %}