From: Marek Stępniowski
Date: Sat, 16 Aug 2008 11:08:25 +0000 (+0200)
Subject: Changed login method.
X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/e390e737951ea78e783070b9729a877945daaa42?hp=5bb84c5c39ca5c6865f6a417d1b170f3b65e8bce
Changed login method.
---
diff --git a/catalogue/views.py b/catalogue/views.py
index a0315a4c6..dc2e7b107 100644
--- a/catalogue/views.py
+++ b/catalogue/views.py
@@ -6,7 +6,7 @@ from django.core.urlresolvers import reverse
from django.db.models import Q
from django.contrib.auth.decorators import login_required
from django.utils.datastructures import SortedDict
-from django.views.decorators.http import require_POST
+from django.views.decorators.http import require_GET, require_POST
from catalogue import models
from catalogue import forms
@@ -28,7 +28,16 @@ def catalogue_redirect(request, tags=''):
else:
return HttpResponseRedirect(reverse('catalogue.views.main_page'))
-
+#
+# @require_GET
+# def tag_search(request):
+# search_form = forms.SearchForm(request.GET)
+# if search_form.is_valid():
+# query = search_form.cleaned_data['q']
+# tags = search_form.cleaned_data['tags']
+#
+
+
def tags_starting_with(request):
try:
prefix = request.GET['q']
@@ -144,6 +153,7 @@ def book_sets(request, slug):
return render_to_response('catalogue/book_sets.html', locals(),
context_instance=RequestContext(request))
+
@login_required
@require_POST
def new_set(request):
diff --git a/chunks/admin.py b/chunks/admin.py
index 29c1fc24f..c44d5a037 100644
--- a/chunks/admin.py
+++ b/chunks/admin.py
@@ -4,8 +4,8 @@ from chunks.models import Chunk
class ChunkAdmin(admin.ModelAdmin):
- list_display = ('key',)
- search_fields = ('key', 'content')
+ list_display = ('key', 'description',)
+ search_fields = ('key', 'content',)
admin.site.register(Chunk, ChunkAdmin)
diff --git a/chunks/models.py b/chunks/models.py
index ac164524b..396d221ed 100644
--- a/chunks/models.py
+++ b/chunks/models.py
@@ -4,12 +4,11 @@ from django.utils.translation import ugettext_lazy as _
class Chunk(models.Model):
"""
- A Chunk is a piece of content associated
- with a unique key that can be inserted into
- any template with the use of a special template
- tag
+ A Chunk is a piece of content associated with a unique key that can be inserted into
+ any template with the use of a special template tag.
"""
key = models.CharField(_('key'), help_text=_('A unique name for this chunk of content'), primary_key=True, max_length=255)
+ description = models.CharField(_('description'), blank=True, max_length=255)
content = models.TextField(_('content'), blank=True)
class Meta:
diff --git a/chunks/templatetags/chunks.py b/chunks/templatetags/chunks.py
index fe8efdefe..f79d495ec 100644
--- a/chunks/templatetags/chunks.py
+++ b/chunks/templatetags/chunks.py
@@ -39,7 +39,7 @@ class ChunkNode(template.Node):
except Chunk.DoesNotExist:
n = Chunk(key=self.key)
n.save()
- return 'SOME TEXT PLEASE'
+ return ''
return content
register.tag('chunk', do_get_chunk)
diff --git a/media/css/master.css b/media/css/master.css
index 3fa1655ea..942111ce9 100644
--- a/media/css/master.css
+++ b/media/css/master.css
@@ -3,7 +3,7 @@ body {
font: 70% Verdana, Arial, Helvetica, sans-serif;
line-height: 1.5em;
background: #FFF url(/media/img/bg.png) repeat-x;
- color: #000;
+ color: #2F4110;
}
img {
@@ -26,7 +26,7 @@ input {
h1 {
font: normal normal bold 1.75em Arial, sans-serif;
color: #2F4110;
- margin: 1em 0 0 0;
+ margin: 0.55em 0 0 0;
}
h2 {
@@ -53,7 +53,7 @@ em {
}
.blur {
- color: #999;
+ color: #777;
}
/* ================================== */
@@ -73,6 +73,15 @@ em {
text-align: right;
}
+#site-description {
+ margin-top: -1.5em;
+ height:4.5em;
+ overflow: hidden;
+ float: right;
+ width: 42em;
+ text-align: right;
+ color: #777;
+}
/* ======================== */
/* = Footer with sponsors = */
@@ -296,9 +305,14 @@ em {
}
.cuteform ol li, .cuteform ul li {
- margin-top: 0.5em;
+ margin-top: 0.7em;
+}
+
+.cuteform label {
+ display: block;
}
+
/* ================ */
/* = Modal Window = */
/* ================ */
@@ -307,28 +321,55 @@ em {
display: none;
width: 32em;
background-color: transparent;
- color: #333;
margin-top: -0.5em;
margin-left: -1em;
}
#set-window div.header {
background-color: #FFF;
- border-right: 0.5em solid #DDD;
+ border-right: 0.25em solid #DDD;
width: 4em;
padding: 0.5em 1em 0.5em 1em;
}
#set-window div.target {
background-color: #FFF;
- border-right: 0.5em solid #DDD;
- border-bottom: 0.5em solid #DDD;
+ border-right: 0.3em solid #DDD;
+ border-bottom: 0.3em solid #DDD;
padding: 1em;
}
.jqmOverlay { background-color: #000; }
+#login-register-window {
+ position: absolute;
+ display: none;
+ width: 24em;
+ background-color: transparent;
+ margin-top: -0.5em;
+ margin-left: 1em;
+}
+
+#login-register-window div.header {
+ background-color: #FFF;
+ border-right: 0.3em solid #DDD;
+ width: 4em;
+ right: 0;
+ left: auto;
+ padding: 0.5em 1em 0.5em 1em;
+ float: right;
+ text-align: center;
+}
+
+#login-register-window div.target {
+ clear: both;
+ background-color: #FFF;
+ border-right: 0.3em solid #DDD;
+ border-bottom: 0.3em solid #DDD;
+ padding: 1em;
+}
+
/* ======================== */
/* = Alphabetic book list = */
/* ======================== */
@@ -337,3 +378,4 @@ em {
margin: 0.3em 0 1.2em 0;
list-style: none;
}
+
diff --git a/settings.py b/settings.py
index 829eaf8bf..788e33e96 100644
--- a/settings.py
+++ b/settings.py
@@ -97,7 +97,7 @@ COMPRESS_CSS = {
COMPRESS_JS = {
'all': {
'source_filenames': ('js/jquery.js', 'js/jquery.autocolumn.js', 'js/jquery.autocomplete.js',
- 'js/jquery.form.js', 'js/jquery.jqmodal.js', 'js/jquery.labelify.js', 'js/jquery.cuteform.js',),
+ 'js/jquery.form.js', 'js/jquery.jqmodal.js', 'js/jquery.labelify.js', 'js/catalogue.js',),
'output_filename': 'js/all.min.js',
}
}
diff --git a/templates/auth/login.html b/templates/auth/login.html
index dcacd8155..6db94aa22 100644
--- a/templates/auth/login.html
+++ b/templates/auth/login.html
@@ -1,13 +1,24 @@
{% extends "base.html" %}
+{% block title %}Zaloguj / Zarejestruj siÄ w WolneLektury.pl{% endblock %}
+
{% block body %}
- Zaloguj / Zarejestruj
+ Zaloguj siÄ / ZaÅóż konto
+
+
+
-
{% endblock %}
diff --git a/templates/base.html b/templates/base.html
index a98dcdf64..78bb6b5a2 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -18,9 +18,15 @@
@@ -58,5 +64,31 @@
+