From 99bbf8ec16fca5eeec9d0ddad5f0a5ae169e4218 Mon Sep 17 00:00:00 2001
From: Jayaram Pai
Date: Wed, 23 Apr 2014 17:18:27 +0530
Subject: changed slick in index page
changed login:next_url
modified the forms.py for initial value
---
forums/settings.py | 4 +-
forums/views.py | 7 ++-
forums/wsgi.py | 4 +-
static/forums/templates/user-login.html | 4 +-
static/website/css/main.css | 48 +++++++++++++--------
static/website/templates/filter.html | 3 ++
static/website/templates/index.html | 61 ++++++++++-----------------
static/website/templates/latest_question.html | 11 +++++
static/website/templates/new-question.html | 8 +++-
website/forms.py | 22 ++++++++--
website/models.py | 3 ++
website/templatetags/notify.py | 13 ++++++
website/views.py | 14 +++---
13 files changed, 129 insertions(+), 73 deletions(-)
create mode 100644 static/website/templates/latest_question.html
diff --git a/forums/settings.py b/forums/settings.py
index be17520..c2811f4 100644
--- a/forums/settings.py
+++ b/forums/settings.py
@@ -188,5 +188,5 @@ DATABASE_ROUTERS = ['drupal_auth.routers.DrupalAuthRouter']
TEMPLATE_CONTEXT_PROCESSORS += ('website.context_processors.admin_processor', )
COMPRESS_ROOT = PROJECT_DIR + "/static/"
-COMPRESS_ENABLED = True
-HTML_MINIFY = True
+COMPRESS_ENABLED = False
+HTML_MINIFY = False
diff --git a/forums/views.py b/forums/views.py
index 6890d61..a38d6b7 100644
--- a/forums/views.py
+++ b/forums/views.py
@@ -14,6 +14,9 @@ def user_login(request):
if user is not None:
if user.is_active:
login(request, user)
+ if 'next' in request.POST:
+ next_url = request.POST.get('next')
+ return HttpResponseRedirect(next_url)
return HttpResponseRedirect('/')
else:
return HttpResponse('you are blocked')
@@ -21,8 +24,10 @@ def user_login(request):
return HttpResponse('Invalid username or password')
else:
form = UserLoginForm()
+ next_url = request.GET.get('next')
context = {
- 'form': form
+ 'form': form,
+ 'next': next_url
}
context.update(csrf(request))
return render_to_response('forums/templates/user-login.html', context)
diff --git a/forums/wsgi.py b/forums/wsgi.py
index 728eed4..3901802 100644
--- a/forums/wsgi.py
+++ b/forums/wsgi.py
@@ -24,8 +24,8 @@ sys.path.append('/Sites/venv/forums/')
# os.environ["DJANGO_SETTINGS_MODULE"] = "forums.settings"
os.environ["DJANGO_SETTINGS_MODULE"] = "forums.settings"
-activate_this = '/Sites/venv/bin/activate_this.py'
-execfile(activate_this, dict(__file__=activate_this))
+# activate_this = '/Sites/venv/bin/activate_this.py'
+# execfile(activate_this, dict(__file__=activate_this))
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
diff --git a/static/forums/templates/user-login.html b/static/forums/templates/user-login.html
index a1951fe..21c4551 100644
--- a/static/forums/templates/user-login.html
+++ b/static/forums/templates/user-login.html
@@ -16,7 +16,9 @@
{% render_field form.password class+="form-control" %}
-
+ {% if next %}
+
+ {% endif %}
{% endwith %}
diff --git a/static/website/css/main.css b/static/website/css/main.css
index ae785bc..4726635 100644
--- a/static/website/css/main.css
+++ b/static/website/css/main.css
@@ -12,23 +12,6 @@ hr {
.navbar-default {
margin-bottom: 0;
}
-.carousel, .slick-list {
- height: 100px;
- margin-right: -2px;
-}
-.carousel .item {
- border: 1px solid #333333;
- position: relative;
-}
-.carousel .thumb {
- text-align: center;
- height: 75px;
-}
-.carousel .descp {
- position: absolute;
- bottom: 0;
- width: 100%;
-}
#filter-container {
background: #f5f5f5;
padding: 15px;
@@ -340,3 +323,34 @@ table .title a {
.slick-prev:after {
color: #a26dc8;
}
+.carousel, .slick-list {
+ height: 245px;
+ margin-right: -2px;
+}
+.carousel .thumbnail {
+ width: 97%;
+ height: 245px;
+ border: 1px solid #cccccc;
+}
+.carousel .thumbnail img {
+ height: 100px;
+}
+.carousel .caption .category {
+ display: block;
+ width: 100%;
+ white-space: nowrap;
+ overflow: hidden;
+ text-align: center;
+}
+.carousel .caption .latest {
+ display: block;
+ padding: 5px 0 5px 0;
+ border-top: 1px solid #cccccc;
+ width: 100%;
+ white-space: nowrap;
+ overflow: hidden;
+ text-align: center;
+}
+.carousel .caption .btn {
+ margin-top: 7px;
+}
diff --git a/static/website/templates/filter.html b/static/website/templates/filter.html
index dada403..7496c0c 100644
--- a/static/website/templates/filter.html
+++ b/static/website/templates/filter.html
@@ -70,7 +70,10 @@
>
{{ second_range }} sec
{% endif %}
+ Ask a new question.
+
+
FOSS | diff --git a/static/website/templates/index.html b/static/website/templates/index.html index 95c8500..991c777 100644 --- a/static/website/templates/index.html +++ b/static/website/templates/index.html @@ -1,45 +1,33 @@ {% extends 'website/templates/base.html' %} {% load static %} {% load count_tags %} +{% load notify %} {% block content %}
---|