From 130bb98ed8876aa48c94d98650729f6662024db1 Mon Sep 17 00:00:00 2001
From: Sanmugasundaram K
Date: Thu, 19 Feb 2015 14:26:04 +0530
Subject: base data for FOSSEE Forum
---
forums/settings.py | 31 ++++--------------------
forums/urls.py | 9 +++----
static/website/js/custom.js | 8 ++----
static/website/templates/filter.html | 18 --------------
static/website/templates/get-question.html | 16 ------------
static/website/templates/index.html | 18 --------------
static/website/templates/new-question.html | 9 +------
static/website/templates/questions.html | 4 +--
website/forms.py | 39 ++++++------------------------
website/models.py | 29 +++++++++++++---------
website/templatetags/helpers.py | 2 +-
website/templatetags/permission_tags.py | 2 +-
website/urls.py | 4 +--
website/views.py | 24 +++++++-----------
14 files changed, 53 insertions(+), 160 deletions(-)
diff --git a/forums/settings.py b/forums/settings.py
index 7b758e0..88133d2 100644
--- a/forums/settings.py
+++ b/forums/settings.py
@@ -19,31 +19,13 @@ MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
- 'NAME': 'forums', # Or path to database file if using sqlite3.
+ 'NAME': 'forum', # Or path to database file if using sqlite3.
# The following settings are not used with sqlite3:
'USER': db_user,
'PASSWORD': db_pass,
'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
'PORT': '', # Set to empty string for default.
- },
- 'spoken': {
- 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
- 'NAME': 'spoken', # Or path to database file if using sqlite3.
- # The following settings are not used with sqlite3:
- 'USER': db_user,
- 'PASSWORD': db_pass,
- 'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
- 'PORT': '', # Set to empty string for default.
- },
- 'cdeep': {
- 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
- 'NAME': 'CDEEP', # Or path to database file if using sqlite3.
- # The following settings are not used with sqlite3:
- 'USER': db_user,
- 'PASSWORD': db_pass,
- 'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
- 'PORT': '', # Set to empty string for default.
- },
+ }
}
# Hosts/domain names that are valid for this site; required if DEBUG is False
@@ -151,15 +133,15 @@ INSTALLED_APPS = (
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
- #'django.contrib.admin',
+ 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'website',
'widget_tweaks',
- 'spoken_auth',
+ #'spoken_auth',
'compressor',
'debug_toolbar',
- 'migrate_spoken',
+ #'migrate_spoken',
)
# A sample logging configuration. The only tangible logging
@@ -191,9 +173,6 @@ LOGGING = {
}
}
-AUTH_USER_MODEL = 'spoken_auth.Users'
-AUTHENTICATION_BACKENDS = ( 'spoken_auth.backends.DrupalAuthBackend', )
-DATABASE_ROUTERS = ['spoken_auth.routers.DrupalAuthRouter']
TEMPLATE_CONTEXT_PROCESSORS += (
'django.core.context_processors.request',
'website.context_processors.admin_processor',
diff --git a/forums/urls.py b/forums/urls.py
index cb8b54e..90d61fb 100644
--- a/forums/urls.py
+++ b/forums/urls.py
@@ -1,21 +1,20 @@
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
-#from django.contrib import admin
-#admin.autodiscover()
+from django.contrib import admin
+admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'forums.views.home', name='home'),
# url(r'^forums/', include('forums.foo.urls')),
- url(r'^', include('website.urls', namespace='website')),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
- #url(r'^admin/', include(admin.site.urls)),
-
+ url(r'^admin/', include(admin.site.urls)),
+ url(r'^', include('website.urls', namespace='website')),
# User account urls
url(r'^accounts/login/', 'forums.views.user_login', name='user_login'),
url(r'^accounts/logout/', 'forums.views.user_logout', name='user_logout'),
diff --git a/static/website/js/custom.js b/static/website/js/custom.js
index 5565683..90ebe9c 100644
--- a/static/website/js/custom.js
+++ b/static/website/js/custom.js
@@ -4,7 +4,7 @@ $(document).ready(function() {
$minute_range = $("#id_minute_range");
$second_range = $("#id_second_range");
- function reset() {
+/* function reset() {
for (var i = 0, l = arguments.length; i < l; i ++) {
switch(arguments[i]) {
case "tutorial":
@@ -25,16 +25,12 @@ $(document).ready(function() {
}
}
}
-
$category.change(function() {
$("#similar-link").hide();
- /* resetting dropdowns */
reset("tutorial", "minute_range", "second_range");
- /* see thread-user.js */
$("#question-details-ok").show();
var category = $(this).val();
if(category == "General") {
- /* disabling all other fields */
$tutorial.html("");
$tutorial.removeAttr("disabled");
$minute_range.html("");
@@ -55,7 +51,7 @@ $(document).ready(function() {
});
}
});
-
+*/
$tutorial.change(function() {
/* resetting dropdowns */
reset("minute_range", "second_range");
diff --git a/static/website/templates/filter.html b/static/website/templates/filter.html
index 85ff760..8a54c72 100644
--- a/static/website/templates/filter.html
+++ b/static/website/templates/filter.html
@@ -28,8 +28,6 @@