summaryrefslogtreecommitdiff
path: root/tbc
diff options
context:
space:
mode:
authorhardythe12014-06-15 12:42:30 +0530
committerhardythe12014-06-15 12:42:30 +0530
commit3c2d793c7c5d26b91e29312b42e1b2869e244d32 (patch)
treeac0063a639f166df8d0aa997422e15f5667d7268 /tbc
parent8ce7163b095edb6730603655dea1f21a614de98a (diff)
downloadPython-TBC-Interface-3c2d793c7c5d26b91e29312b42e1b2869e244d32.tar.gz
Python-TBC-Interface-3c2d793c7c5d26b91e29312b42e1b2869e244d32.tar.bz2
Python-TBC-Interface-3c2d793c7c5d26b91e29312b42e1b2869e244d32.zip
changes to make the books completed & books under progress links work
Diffstat (limited to 'tbc')
-rwxr-xr-xtbc/templates/base.html4
-rw-r--r--tbc/templates/tbc/books_under_progress.html (renamed from tbc/static/templates/books_under_progress.html)0
-rw-r--r--tbc/templates/tbc/converted_textbooks.html (renamed from tbc/static/templates/converted_textbooks.html)0
-rw-r--r--tbc/urls.py2
-rwxr-xr-xtbc/views.py26
5 files changed, 30 insertions, 2 deletions
diff --git a/tbc/templates/base.html b/tbc/templates/base.html
index f6bb66a..30be78f 100755
--- a/tbc/templates/base.html
+++ b/tbc/templates/base.html
@@ -91,8 +91,8 @@
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Textbooks<b class="caret"></b></a>
<ul class="dropdown-menu">
- <li><a href="{% static 'templates/converted_textbooks.html' %}">Completed</a></li>
- <li><a href="{% static 'templates/books_under_progess.html' %}">Under Progress</a></li>
+ <li><a href="{% url 'tbc:CompletedBooks' %}">Completed</a></li>
+ <li><a href="{% url 'tbc:BooksUnderProgress' %}">Under Progress</a></li>
</ul>
</li>
<li><a href="{% url 'tbc:InternshipForms' %}">Internship Forms</a></li>
diff --git a/tbc/static/templates/books_under_progress.html b/tbc/templates/tbc/books_under_progress.html
index f5d60c8..f5d60c8 100644
--- a/tbc/static/templates/books_under_progress.html
+++ b/tbc/templates/tbc/books_under_progress.html
diff --git a/tbc/static/templates/converted_textbooks.html b/tbc/templates/tbc/converted_textbooks.html
index d587ac9..d587ac9 100644
--- a/tbc/static/templates/converted_textbooks.html
+++ b/tbc/templates/tbc/converted_textbooks.html
diff --git a/tbc/urls.py b/tbc/urls.py
index 939be37..0aa0b3c 100644
--- a/tbc/urls.py
+++ b/tbc/urls.py
@@ -22,6 +22,8 @@ urlpatterns = patterns('',
url(r'^browse-books/(?P<category>.+)$', 'tbc.views.BrowseBooks', name='BrowseBooks'),
url(r'^convert-notebook/(?P<notebook_path>.+)$', 'tbc.views.ConvertNotebook', name='ConvertNotebook'),
url(r'^book-details/(?P<book_id>\d+)/$', 'tbc.views.BookDetails', name='BookDetails'),
+ url(r'^completed-books/$', 'tbc.views.CompletedBooks', name='CompletedBooks'),
+ url(r'^books-under-progress/$', 'tbc.views.BooksUnderProgress', name='BooksUnderProgress'),
url(r'^book-review/$', 'tbc.views.BookReview', name='BookReview'),
diff --git a/tbc/views.py b/tbc/views.py
index 0c75f96..e3953d8 100755
--- a/tbc/views.py
+++ b/tbc/views.py
@@ -611,3 +611,29 @@ def ConvertNotebook(request, notebook_path=None):
template = path.split("/")[8:]
template = "/".join(template)+notebook_name+".html"
return render_to_response(template, {})
+
+
+def CompletedBooks(request):
+ context = {}
+ images = []
+ if request.user.is_anonymous():
+ context['anonymous'] = True
+ else:
+ if is_reviewer(request.user):
+ context['reviewer'] = request.user
+ else:
+ context['user'] = request.user
+ return render_to_response('tbc/converted_textbooks.html', context)
+
+
+def BooksUnderProgress(request):
+ context = {}
+ images = []
+ if request.user.is_anonymous():
+ context['anonymous'] = True
+ else:
+ if is_reviewer(request.user):
+ context['reviewer'] = request.user
+ else:
+ context['user'] = request.user
+ return render_to_response('tbc/books_under_progress.html', context)