summaryrefslogtreecommitdiff
path: root/tbc/views.py
diff options
context:
space:
mode:
authorhardythe12014-06-17 10:35:51 +0530
committerhardythe12014-06-17 10:35:51 +0530
commite022b894fef6c3d82d7cd8b3f3ee69df606b0e2e (patch)
tree56250bb1feac162fefc341acd99d709910bafbe4 /tbc/views.py
parent10d586434c8eb0f78b5d2ebd901d3d435f5fdd25 (diff)
downloadPython-TBC-Interface-e022b894fef6c3d82d7cd8b3f3ee69df606b0e2e.tar.gz
Python-TBC-Interface-e022b894fef6c3d82d7cd8b3f3ee69df606b0e2e.tar.bz2
Python-TBC-Interface-e022b894fef6c3d82d7cd8b3f3ee69df606b0e2e.zip
Disabling the links again for each url
Diffstat (limited to 'tbc/views.py')
-rwxr-xr-xtbc/views.py31
1 files changed, 24 insertions, 7 deletions
diff --git a/tbc/views.py b/tbc/views.py
index c352ed7..d85666a 100755
--- a/tbc/views.py
+++ b/tbc/views.py
@@ -4,7 +4,6 @@ from django.core.context_processors import csrf
from django.contrib.auth import authenticate, login, logout
from models import *
from tbc.forms import *
-from local import *
import os
import zipfile
import StringIO
@@ -66,6 +65,7 @@ def TemporarilyUnavailable(request):
def Home(request):
context = {}
+ return render_to_response('tbc/unavailable.html', context)
images = []
if request.user.is_anonymous():
context['anonymous'] = True
@@ -100,6 +100,7 @@ def Home(request):
def UserLogin(request):
context = {}
+ return render_to_response('tbc/unavailable.html', context)
context.update(csrf(request))
if 'require_login' in request.GET:
context['require_login'] = True
@@ -139,6 +140,8 @@ def UserLogin(request):
def UserRegister(request):
+ context = {}
+ return render_to_response('tbc/unavailable.html', context)
if request.method == 'POST':
form = UserRegisterForm(request.POST)
if form.is_valid():
@@ -151,7 +154,6 @@ def UserRegister(request):
return render_to_response('tbc/register.html', context)
else:
form = UserRegisterForm()
- context = {}
context.update(csrf(request))
context['form'] = form
return render_to_response('tbc/register.html', context)
@@ -159,6 +161,8 @@ def UserRegister(request):
def UserProfile(request):
user = request.user
+ context = {}
+ return render_to_response('tbc/unavailable.html', context)
if user.is_authenticated():
if request.method == 'POST':
form = UserProfileForm(request.POST)
@@ -168,13 +172,11 @@ def UserProfile(request):
data.save()
return HttpResponseRedirect('/')
else:
- context = {}
context.update(csrf(request))
context['form'] = form
return render_to_response('tbc/profile.html', context)
else:
form = UserProfileForm()
- context = {}
context.update(csrf(request))
context['form'] = form
context['user'] = user
@@ -194,6 +196,7 @@ def UserLogout(request):
def ForgotPassword(request):
context = {}
+ return render_to_response('tbc/unavailable.html', context)
user_emails = []
context.update(csrf(request))
if request.user.is_anonymous():
@@ -232,6 +235,7 @@ def ForgotPassword(request):
def UpdatePassword(request):
user = request.user
context = {}
+ return render_to_response('tbc/unavailable.html', context)
context.update(csrf(request))
if user.is_authenticated():
if request.method == 'POST':
@@ -269,6 +273,7 @@ def UpdatePassword(request):
def SubmitBook(request):
curr_user = request.user
context = {}
+ return render_to_response('tbc/unavailable.html', context)
if request.method == 'POST':
form = BookForm(request.POST)
if form.is_valid():
@@ -295,6 +300,8 @@ def SubmitBook(request):
def UpdateBook(request):
+ context = {}
+ return render_to_response('tbc/unavailable.html', context)
current_user = request.user
user_profile = Profile.objects.get(user=current_user)
try:
@@ -304,7 +311,6 @@ def UpdateBook(request):
title = book_to_update.title
chapters = Chapters.objects.filter(book=book_to_update)
screenshots = ScreenShots.objects.filter(book=book_to_update)
- context = {}
if request.method == 'POST':
book_form = BookForm(request.POST, instance=book_to_update)
if book_form.is_valid():
@@ -336,6 +342,8 @@ def UpdateBook(request):
def ContentUpload(request, book_id=None):
+ context = {}
+ return render_to_response('tbc/unavailable.html', context)
user = request.user
curr_book = Book.objects.get(id=book_id)
if request.method == 'POST':
@@ -365,7 +373,6 @@ def ContentUpload(request, book_id=None):
"http://tbc-python.fossee.in/book-review/"+str(curr_book.id)
email_send(book.reviewer.email, subject, message)
return HttpResponseRedirect('/?up=done')
- context = {}
context.update(csrf(request))
context['user'] = user
context['curr_book'] = curr_book
@@ -375,11 +382,12 @@ def ContentUpload(request, book_id=None):
def UpdateContent(request, book_id=None):
+ context = {}
+ return render_to_response('tbc/unavailable.html', context)
user = request.user
current_book = Book.objects.get(id=book_id)
chapters_to_update = Chapters.objects.filter(book=current_book)
screenshots_to_update = ScreenShots.objects.filter(book=current_book)
- context = {}
if request.method == 'POST':
for i in range(1, current_book.no_chapters+1):
chapter = Chapters.objects.get(id=chapters_to_update[i-1].id)
@@ -445,6 +453,7 @@ def GetZip(request, book_id=None):
def BookDetails(request, book_id=None):
context = {}
+ return render_to_response('tbc/unavailable.html', context)
if request.user.is_anonymous():
context['anonymous'] = True
else:
@@ -463,6 +472,7 @@ def BookDetails(request, book_id=None):
def BookReview(request, book_id=None):
context = {}
+ return render_to_response('tbc/unavailable.html', context)
if is_reviewer(request.user):
if book_id:
book = Book.objects.get(id=book_id)
@@ -491,6 +501,7 @@ def BookReview(request, book_id=None):
def ApproveBook(request, book_id=None):
user = request.user
context = {}
+ return render_to_response('tbc/unavailable.html', context)
if is_reviewer(request.user):
if request.method == 'POST' and request.POST['approve_notify'] == "approve":
book = Book.objects.get(id=book_id)
@@ -542,6 +553,7 @@ def ApproveBook(request, book_id=None):
def NotifyChanges(request, book_id=None):
context = {}
+ return render_to_response('tbc/unavailable.html', context)
if is_reviewer(request.user):
book = Book.objects.get(id=book_id)
if request.method == 'POST':
@@ -566,6 +578,7 @@ def NotifyChanges(request, book_id=None):
def BrowseBooks(request):
context = {}
+ return render_to_response('tbc/unavailable.html', context)
category = None
images = []
book_images = []
@@ -598,6 +611,8 @@ def BrowseBooks(request):
def ConvertNotebook(request, notebook_path=None):
+ context = {}
+ return render_to_response('tbc/unavailable.html', context)
path = os.path.abspath(os.path.dirname(__file__))
path = path+"/static/uploads/"
path = path+notebook_path
@@ -619,6 +634,7 @@ def ConvertNotebook(request, notebook_path=None):
def CompletedBooks(request):
context = {}
+ return render_to_response('tbc/unavailable.html', context)
images = []
if request.user.is_anonymous():
context['anonymous'] = True
@@ -632,6 +648,7 @@ def CompletedBooks(request):
def BooksUnderProgress(request):
context = {}
+ return render_to_response('tbc/unavailable.html', context)
images = []
if request.user.is_anonymous():
context['anonymous'] = True