<form action="{{ request.get_full_path }}" method="post" accept-charset="utf-8" class="cuteform">
<ol>
+ <div id="id___all__"></div>
{{ form.as_ul }}
<li><input type="submit" value="{{ submit }}"/></li>
</ol>
form_class = None
# override to customize form look
template = "ajaxable/form.html"
- # set to redirect after succesful ajax-less post
submit = _('Send')
- redirect = None
+
title = ''
success_message = ''
formname = "form"
if form.is_valid():
self.success(form, request)
redirect = request.GET.get('next')
- if not ajax and redirect is not None:
+ if not ajax and redirect:
return HttpResponseRedirect(urlquote_plus(
- redirect, safe='/?='))
- response_data = {'success': True, 'message': self.success_message}
+ redirect, safe='/?='))
+ response_data = {'success': True,
+ 'message': self.success_message, 'redirect': redirect}
else:
response_data = {'success': False, 'errors': form.errors}
if ajax:
<h1>{{ page.title }}</h1>
{% autoescape off %}
- <div class="column-left">
- {{ left_column }}
+ <div class="left-column">
+ <div class="normal-text">
+ {{ left_column }}
+ </div>
</div>
- <div class="column-right">
- {{ right_column }}
+ <div class="right-column">
+ <div class="normal-text">
+ {{ right_column }}
+ </div>
</div>
{% endautoescape %}
{% endblock %}
def infopage(request, slug):
- page = InfoPage.objects.get(slug=slug)
-
page = get_object_or_404(InfoPage, slug=slug)
rc = RequestContext(request)
left_column = Template(page.left_column).render(rc)
],
'output_filename': 'js/player.min?.js',
},
- #~ 'book': {
- #~ 'source_filenames': ('js/jquery.eventdelegation.js', 'js/jquery.scrollto.js', 'js/jquery.highlightfade.js', 'js/book.js',),
- #~ 'source_filenames': [],
- #~ 'output_filename': 'js/book?.min.js',
- #~ },
- #~ 'book_ie': {
- #~ 'source_filenames': ('js/ierange-m2.js',),
- #~ 'source_filenames': [],
- #~ 'output_filename': 'js/book_ie?.min.js',
- #~ }
+ 'book': {
+ 'source_filenames': ('js/jquery.eventdelegation.js', 'js/jquery.scrollto.js', 'js/jquery.highlightfade.js', 'js/book.js',),
+ 'output_filename': 'js/book?.min.js',
+ },
+ 'book_ie': {
+ 'source_filenames': ('js/ierange-m2.js',),
+ 'output_filename': 'js/book_ie?.min.js',
+ }
}
float:right;
width: 48em;
}
+.normal-text {
+ font-size: 1.3em;
+ line-height: 1.3em;
+}
h2 {
margin: 0;
clear: both;
}
-#header-content, div#main-content, div#half-header-content {
+#header-content, div#main-content, div#half-header-content, #footer-content {
width: 97.5em;
margin: auto;
}
#footer {
color: #777;
- border-top: 1px solid #ddd;
- margin-top: 2.5em;
+ eborder-top: 1px solid #ddd;
+ margin-top: 5em;
+ padding-top:3em;
+ background: #fff;
}
margin: 0;
padding: 0;
}
+
+
+/* listing of all books */
+#book-list {
+ padding-left: 50px;
+}
+#book-list-nav {
+ position: absolute;
+ right: 50px;
+ width: 200px;
+ border-left: 1px #cfcfcf solid;
+ padding: 10px;
+ font-size: 1.2em;
+}
+
+#book-list-nav ul {
+ list-style-type: none;
+ margin: 5px;
+ padding: 0;
+}
+
+.book-list-show-index {
+ display: none;
+ margin: 0;
+ padding: 0;
+}
+
+
+#book-a-list #book-list ol {
+ padding-left: 1em;
+ margin: 0.3em 0 1.2em 0;
+ list-style: none;
+}
+
+#book-a-list #book-list h2 a {
+ color: black;
+}
+
+#book-list-up {
+ position: fixed;
+ bottom: 50px;
+ right: 50px;
+ border-left: 1px #cfcfcf solid;
+ padding: 10px;
+ background-color: white;
+}
\ No newline at end of file
+.cuteform {
+ font-size: 1.1em;
+}
.cuteform ol, .cuteform ul {
padding: 0;
margin: 0;
list-style: none;
+ font-style: 1.1em;
}
.cuteform ol li, .cuteform ul li {
color: #BF3024;
display: block;
}
+.cuteform .errorlist {
+ color: #BF3024;
+}
.jqmOverlay { background-color: #000; }
}
.dialog-window div.header {
+ font-size: 1.1em;
width: 4em;
background-color: #FFF;
border-right: 0.3em solid #DDD;
font-size: 1.2em;
}
+.dialog-window textarea, .dialog-window input {
+ width: 100%;
+}
#login-window {
- width: 24em;
+ width: 26em;
}
#register-window {
- width: 24em;
+ width: 26em;
}
#suggest-window {
- width: 24em;
+ width: 26em;
}
#suggest-window textarea {
- width: 19em;
height: 6em;
}
#suggest-publishing-window {
- width: 26em;
+ width: 29em;
}
#suggest-publishing-window textarea {
- width: 21em;
height: 3em;
}
});
+ $('.book-list-index').click(function(){
+ $('.book-list-show-index').hide('slow');
+ if($(this).parent().next('ul:not(:hidden)').length == 0){
+ $(this).parent().next('ul').toggle('slow');
+ }
+ return false;
+ });
+
+
});
})(jQuery)
hash.w.show();
},
onLoad: function(hash) {
- $('form', hash.w).each(function() {this.action += '?ajax=1';});
+ $('form', hash.w).each(function() {
+ if (this.action.search('[\\?&]ajax=1') != -1)
+ return;
+ if (this.action.search('\\?') != -1)
+ this.action += '&ajax=1';
+ else this.action += '?ajax=1';
+ });
$('form', hash.w).ajaxForm({
dataType: 'json',
target: $('.target', $window),
success: function(response) {
if (response.success) {
$('.target', $window).text(response.message);
- setTimeout(function() { $window.jqmHide() }, 1000)
+ setTimeout(function() { $window.jqmHide() }, 1000);
+ if (response.redirect)
+ window.location = response.redirect;
}
else {
$('.error', $window).remove();
+{% extends "base.html" %}
{% load i18n %}
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="pl" xml:lang="pl">
-<head>
-<title>404 - {% trans "Page does not exist" %} - WolneLektury.pl</title>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.2/build/reset/reset-min.css">
-<link rel="stylesheet" href="{{ STATIC_URL }}css/error.css" type="text/css" />
-</head>
-
-<body>
-
-<a href="/"><img src="{{ STATIC_URL }}img/logo.png" /></a>
-<p class="haj" style="font-weight: bold">{% trans "Page does not exist" %}</p>
+
+
+{% block titleextra %}404 - {% trans "Page does not exist" %}{% endblock %}
+
+
+{% block body %}
+
+<h1>{% trans "Page not found" %}</h1>
+
+
<p>
{% trans "We are sorry, but this page does not exist. Please check if you entered correct address or go to "%} <a href="/">{% trans "main page" %}</a>.
</p>
-<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
-</script>
-<script type="text/javascript">
- _uacct = "UA-2576694-1";
- urchinTracker();
-</script>
-</body>
-</html>
\ No newline at end of file
+
+
+{% endblock body %}
<div class="clearboth"></div>
+ </div>{# end main-content #}
<div id="footer">
+ <div id="footer-content">
<p>
{% blocktrans %}
Wolne Lektury is a project lead by <a href="http://nowoczesnapolska.org.pl/">Modern Poland Foundation</a>.
{% sponsor_page "footer" %}
</div>
+ </div>
- </div>{# end main-content #}
{# template #}
{% block body %}
<h1>{% block book_list_header %}{% trans "Listing of all works" %}{% endblock %}</h1>
- <div class="column-left">{% block book_list_info %}{% endblock %}</div><div style='clear:both;'></div>
+ <div class="left-column"><div class="normal-text">
+ {% block book_list_info %}{% endblock %}
+ </div></div>
+
+ <div style='clear:both;'></div>
+
<a name="top">
- <div id="book-list-nav">
+
+ <div id="book-list-nav" class="normal-text">
{% trans "Table of Content" %}
{% for index, authors in books_nav.items %}
<ul>
</ul>
{% endfor %}
</div>
- <div id="book-list">
+ <div id="book-list" class="normal-text">
{% block book_list %}
{% book_tree orphans books_by_parent %}
{% for author, group in books_by_author.items %}
<title>{% block title %}WolneLektury.pl{% endblock %}</title>
<link rel="icon" href="{{ STATIC_URL }}img/favicon.png" type="image/x-icon" />
{% compressed_css "book" %}
- {% compressed_js "jquery" %}
+ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
{% compressed_js "book" %}
<!--[if IE]>
{% compressed_js "book_ie" %}
{% block body %}
<h1>{% trans "Catalogue" %}</h1>
+ <div class="normal-text">
<h2></a>{% trans "Authors" %}<a name="autorzy"></a></h2>
{% tag_list categories.author %}
<h2>{% trans "Themes and topics" %}<a name="motywy"></a></h2>
{% tag_list fragment_tags %}
+ </div>
{% endblock %}
{% block body %}
<h1>Leśmianator</h1>
- <div id="books-list">
+ <div class="left-column">
+ <div class="normal-text">
<p>Leśmianator tworzy wierszmiksy – dzięki niemu
<a href="{% url new_poem %}">napiszesz wiersz jednym kliknięciem</a>.
W nowej odsłonie nowe możliwości zabawy – teraz możesz zdecydować, co wrzucasz do miksera,
{% endfor %}
</div>
+ </div>
- <div id="tags-list">
+ <div class="right-column">
+ <div class="normal-text">
<h3>Miksuj utwory</h3>
<p>Możesz <a href="{% url new_poem %}">zmiksować całą lirykę</a> w naszej bibliotece
albo tylko jeden konkretny utwór. Jak? Wejdź na
<p>Miłej zabawy!</p>
</div>
+ </div>
{% endblock %}
\ No newline at end of file
<li><a href="{% url suggest %}" id="suggest" class="ajaxable">{% trans "Report a bug or suggestion" %}</a></li>
<li><a href="http://turniej.wolnelektury.pl">Turniej Elektrybałtów</a></li>
<li><a href="{% url lesmianator %}">Leśmianator</a></li>
- <li><a href="">{% trans "Mobile app" %}</a></li>
+ <li><a href="{% url infopage "mobilna" %}">{% trans "Mobile app" %}</a></li>
<li><a href="{% url infopage "widget" %}">{% trans "Widget" %}</a></li>
- <li><a href="">{% trans "Public domain counter" %}</a></li>
<li><a href="{% url suggest_publishing %}" id="suggest-publishing" class="ajaxable">{% trans "Missing a book?" %}</a></li>
<li><a href="{% url publish_plan %}">{% trans "Publishing plan" %}</a></li>
</ul>
{% block body %}
<h1>{% trans "Publishing plan" %}</h1>
-<ul>
+<ul class="normal-text">
{% for elem in plan %}
<li><a href="{{ elem.link }}">{{ elem.title }}</a></li>
{% endfor %}
class LoginFormView(AjaxableFormView):
form_class = AuthenticationForm
- #template = "auth/login.html"
title = _('Sign in')
submit = _('Sign in')
+ ajax_redirect = True
def __call__(self, request):
if request.user.is_authenticated():
class RegisterFormView(AjaxableFormView):
form_class = UserCreationForm
- #template = "auth/register.html"
title = _('Register')
submit = _('Register')
+ ajax_redirect = True
def __call__(self, request):
if request.user.is_authenticated():