remove some experimental junk
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 31 Aug 2011 09:48:20 +0000 (11:48 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 31 Aug 2011 09:48:20 +0000 (11:48 +0200)
apps/catalogue/views.py
apps/piston/templates/piston/authorize_token.html
wolnelektury/static/css/mobile.css [deleted file]
wolnelektury/templates/auth/login.html
wolnelektury/urls.py

index aedc4ca..00a3a6b 100644 (file)
@@ -676,27 +676,6 @@ def delete_shelf(request, slug):
 # ==================
 # = Authentication =
 # ==================
-
-@cache.never_cache
-def simple_login(request):
-    if request.method == "GET":
-        #next = request.REQUEST.get('next', '')
-        #if next == '':
-        form = AuthenticationForm(prefix='login')
-        return render_to_response('auth/login.html', locals(),
-                context_instance=RequestContext(request))
-        #else:
-        #    return HttpResponseRedirect("/"+next)
-            
-    elif request.method == "POST":
-        form = AuthenticationForm(data=request.POST, prefix='login')
-        if form.is_valid():
-            auth.login(request, form.get_user())   
-        url = request.META['HTTP_REFERER'].split("next=")[1]
-        url = url.replace("%3F","?").replace("%3D","=")
-        return HttpResponseRedirect(url)    
-
-
 @require_POST
 @cache.never_cache
 def login(request):
index 3507e55..59c09e3 100644 (file)
@@ -1,17 +1,15 @@
-{% load i18n %}
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
 "http://www.w3.org/TR/html4/strict.dtd">
 <html>
        <head>
-               <title>{% trans "Authorize Token" %}</title>
-               <link rel="stylesheet" href="/static/css/mobile.css" media="handheld, only screen and (max-device-width:480px)"/>
-               <meta name="viewport" content="width=320" />
+               <title>Authorize Token</title>
        </head>
        <body>
-               <h1>WolneLektury.pl - {% trans "Authorize Token" %}</h1>
-        <form action="{% url piston.authentication.oauth_user_auth %}" method="post">
+               <h1>Authorize Token</h1>
+
+        <form action="{% url piston.authentication.oauth_user_auth %}" method="POST">
             {{ form.as_table }}
-            <input type="submit" value="{% trans "Confirm" %}" />
         </form>
+
        </body>
 </html>
diff --git a/wolnelektury/static/css/mobile.css b/wolnelektury/static/css/mobile.css
deleted file mode 100644 (file)
index 2f04e65..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-ul li {
-    list-style-type: none;
-}
-
-h1 {
-    font-size: 1em;
-}
index 204cce6..a168ff7 100644 (file)
@@ -1,28 +1,25 @@
+{% extends "base.html" %}
 {% load i18n %}
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
-"http://www.w3.org/TR/html4/strict.dtd">
-<html>
-       <head>
-               <title>{% trans "Authorize Token" %}</title>
-               <link rel="stylesheet" href="/static/css/mobile.css" media="handheld, only screen and (max-device-width:480px)"/>
-               <meta name="viewport" content="width=320" />            
-       </head>
-    <body>
-        <h1>WolneLektury.pl - {% trans "Sign in" %} / {% trans "Register"%}</h1>
-        <form method="post" action="." id="login-form" class="cuteform">
-            <h2>{% trans "Sign in" %}</h2>
-            <ul>
-                {{ form.as_ul }}
-                <li><input type="submit" value="{% trans "Sign in" %}" /></li>
-            </ul>
-            <p><input type="hidden" name="next" value="{{ next }}" /></p>
-        </form>
 
-        <form action="." method="post" accept-charset="utf-8" id="registration-form">
-            <h2>{% trans "Register" %}</h2>
-            <ul>
-                <li><input type="submit" value="{% trans "Register" %}"/></li>
-            </ul>
-        </form>
-    </body>
-</html>
+{% block title %}{% trans "Sign in" %} / {% trans "Register on"%} WolneLektury.pl{% endblock %}
+
+{% block body %}
+    <h1>{% trans "Sign in" %} / {% trans "Register"%}</h1>
+    <form action="." method="get" accept-charset="utf-8" id="search-form">
+        <p><li>{{ search_form.q }} <input type="submit" value="{% trans "Search" %}" /></li> <strong>{% trans "or" %}</strong> <a href="{% url main_page %}">{% trans "return to main page" %}</a></p>
+    </form>
+    <form method="post" action="." id="login-form" class="cuteform">
+        <h2>{% trans "Sign in" %}</h2>
+        <ol>
+            {{ form.as_ul }}
+            <li><input type="submit" value="{% trans "Sign in" %}" /></li>
+        </ol>
+        <p><input type="hidden" name="next" value="{{ next }}" /></p>
+    </form>
+
+    <form action="." method="post" accept-charset="utf-8" id="registration-form">
+        <h2>{% trans "Register" %}</h2>
+
+        <p><input type="submit" value="{% trans "Register" %}"/></p>
+    </form>
+{% endblock %}
index 932c440..a99030f 100644 (file)
@@ -37,7 +37,6 @@ urlpatterns = patterns('',
     url(r'^admin/', include(admin.site.urls)),
 
     # Authentication
-    url(r'^users/simple_login/$', 'catalogue.views.simple_login', name='simple_login'),
     url(r'^uzytkownicy/zaloguj/$', 'catalogue.views.login', name='login'),
     url(r'^uzytkownicy/wyloguj/$', 'catalogue.views.logout_then_redirect', name='logout'),
     url(r'^uzytkownicy/utworz/$', 'catalogue.views.register', name='register'),