fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
4a6b564
)
Various style changes.
author
Marek Stępniowski
<marek@stepniowski.com>
Fri, 22 Aug 2008 12:16:16 +0000
(14:16 +0200)
committer
Marek Stępniowski
<marek@stepniowski.com>
Fri, 22 Aug 2008 12:16:16 +0000
(14:16 +0200)
catalogue/forms.py
patch
|
blob
|
history
catalogue/models.py
patch
|
blob
|
history
catalogue/templatetags/catalogue.py
patch
|
blob
|
history
media/css/master.css
patch
|
blob
|
history
templates/base.html
patch
|
blob
|
history
diff --git
a/catalogue/forms.py
b/catalogue/forms.py
index
b383f99
..
5708d89
100644
(file)
--- a/
catalogue/forms.py
+++ b/
catalogue/forms.py
@@
-14,6
+14,14
@@
class SearchForm(forms.Form):
self.fields['q'].widget.attrs['title'] = u'tytuł utworu, motyw lub kategoria'
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)
class BookSetsForm(forms.Form):
def __init__(self, book, user, *args, **kwargs):
super(BookSetsForm, self).__init__(*args, **kwargs)
diff --git
a/catalogue/models.py
b/catalogue/models.py
index
b49747b
..
483741b
100644
(file)
--- a/
catalogue/models.py
+++ b/
catalogue/models.py
@@
-54,6
+54,14
@@
class Tag(TagBase):
def __unicode__(self):
return self.name
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)
class Book(models.Model):
title = models.CharField(_('title'), max_length=120)
diff --git
a/catalogue/templatetags/catalogue.py
b/catalogue/templatetags/catalogue.py
index
f2f35dd
..
6b06f38
100644
(file)
--- a/
catalogue/templatetags/catalogue.py
+++ b/
catalogue/templatetags/catalogue.py
@@
-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.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()
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)
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)
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)
diff --git
a/media/css/master.css
b/media/css/master.css
index
41c40c0
..
4450eb1
100644
(file)
--- a/
media/css/master.css
+++ b/
media/css/master.css
@@
-388,3
+388,7
@@
em {
list-style: none;
}
list-style: none;
}
+#top-message {
+ background-color: #2F4110;
+ color: #FFF;
+}
\ No newline at end of file
diff --git
a/templates/base.html
b/templates/base.html
index
03f8e19
..
84cfd36
100644
(file)
--- a/
templates/base.html
+++ b/
templates/base.html
@@
-12,6
+12,9
@@
{% endblock %}
</head>
<body id="{% block bodyid %}base{% endblock %}">
{% 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>
<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>
{% 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 %}
{% if user.is_staff %}
| <a href="/admin/">Administracja</a>
{% endif %}