From 41b0da723cc8cebd28d678ab140c226cb8113bbb Mon Sep 17 00:00:00 2001 From: kinitrupti Date: Thu, 31 Mar 2016 17:21:26 +0530 Subject: modified-funcnames-frontpg --- PythonTBC/settings.py | 2 + base.html | 428 +++++++++++++++++++++++ tbc/certificate/tbc_certificate.tex | 6 + tbc/forms.py | 2 +- tbc/models.py | 3 +- tbc/static/css/base.css | 0 tbc/static/css/responsive.css | 0 tbc/static/js/.jshintrc | 0 tbc/static/js/bootstrap-affix.js | 0 tbc/static/js/bootstrap-alert.js | 0 tbc/static/js/bootstrap-button.js | 0 tbc/static/js/bootstrap-carousel.js | 0 tbc/static/js/bootstrap-collapse.js | 0 tbc/static/js/bootstrap-dropdown.js | 0 tbc/static/js/bootstrap-modal.js | 0 tbc/static/js/bootstrap-popover.js | 0 tbc/static/js/bootstrap-scrollspy.js | 0 tbc/static/js/bootstrap-tab.js | 0 tbc/static/js/bootstrap-tooltip.js | 0 tbc/static/js/bootstrap-transition.js | 0 tbc/static/js/bootstrap-typeahead.js | 0 tbc/static/js/jquery.js | 0 tbc/static/js/tests/index.html | 0 tbc/static/js/tests/phantom.js | 0 tbc/static/js/tests/server.js | 0 tbc/static/js/tests/unit/bootstrap-affix.js | 0 tbc/static/js/tests/unit/bootstrap-alert.js | 0 tbc/static/js/tests/unit/bootstrap-button.js | 0 tbc/static/js/tests/unit/bootstrap-carousel.js | 0 tbc/static/js/tests/unit/bootstrap-collapse.js | 0 tbc/static/js/tests/unit/bootstrap-dropdown.js | 0 tbc/static/js/tests/unit/bootstrap-modal.js | 0 tbc/static/js/tests/unit/bootstrap-phantom.js | 0 tbc/static/js/tests/unit/bootstrap-popover.js | 0 tbc/static/js/tests/unit/bootstrap-scrollspy.js | 0 tbc/static/js/tests/unit/bootstrap-tab.js | 0 tbc/static/js/tests/unit/bootstrap-tooltip.js | 0 tbc/static/js/tests/unit/bootstrap-transition.js | 0 tbc/static/js/tests/unit/bootstrap-typeahead.js | 0 tbc/static/js/tests/vendor/jquery.js | 0 tbc/static/js/tests/vendor/qunit.css | 0 tbc/static/js/tests/vendor/qunit.js | 0 tbc/static/templates/editors-picks.html | 26 ++ tbc/templates/base.html | 188 ++++++++-- tbc/templates/tbc/aicte-books.html | 4 +- tbc/templates/tbc/book-details.html | 11 +- tbc/templates/tbc/book-review-details.html | 4 +- tbc/templates/tbc/book-review.html | 4 +- tbc/templates/tbc/books_under_progress.html | 2 +- tbc/templates/tbc/browse-books.html | 4 +- tbc/templates/tbc/completed_books.html | 2 +- tbc/templates/tbc/get-certificate.html | 2 +- tbc/templates/tbc/link_image.html | 2 +- tbc/templates/tbc/login.html | 4 +- tbc/templates/tbc/review-proposal.html | 12 +- tbc/urls.py | 91 ++--- tbc/views.py | 98 +++--- 57 files changed, 742 insertions(+), 153 deletions(-) create mode 100755 base.html create mode 100644 tbc/certificate/tbc_certificate.tex mode change 100755 => 100644 tbc/static/css/base.css mode change 100755 => 100644 tbc/static/css/responsive.css mode change 100755 => 100644 tbc/static/js/.jshintrc mode change 100755 => 100644 tbc/static/js/bootstrap-affix.js mode change 100755 => 100644 tbc/static/js/bootstrap-alert.js mode change 100755 => 100644 tbc/static/js/bootstrap-button.js mode change 100755 => 100644 tbc/static/js/bootstrap-carousel.js mode change 100755 => 100644 tbc/static/js/bootstrap-collapse.js mode change 100755 => 100644 tbc/static/js/bootstrap-dropdown.js mode change 100755 => 100644 tbc/static/js/bootstrap-modal.js mode change 100755 => 100644 tbc/static/js/bootstrap-popover.js mode change 100755 => 100644 tbc/static/js/bootstrap-scrollspy.js mode change 100755 => 100644 tbc/static/js/bootstrap-tab.js mode change 100755 => 100644 tbc/static/js/bootstrap-tooltip.js mode change 100755 => 100644 tbc/static/js/bootstrap-transition.js mode change 100755 => 100644 tbc/static/js/bootstrap-typeahead.js mode change 100755 => 100644 tbc/static/js/jquery.js mode change 100755 => 100644 tbc/static/js/tests/index.html mode change 100755 => 100644 tbc/static/js/tests/phantom.js mode change 100755 => 100644 tbc/static/js/tests/server.js mode change 100755 => 100644 tbc/static/js/tests/unit/bootstrap-affix.js mode change 100755 => 100644 tbc/static/js/tests/unit/bootstrap-alert.js mode change 100755 => 100644 tbc/static/js/tests/unit/bootstrap-button.js mode change 100755 => 100644 tbc/static/js/tests/unit/bootstrap-carousel.js mode change 100755 => 100644 tbc/static/js/tests/unit/bootstrap-collapse.js mode change 100755 => 100644 tbc/static/js/tests/unit/bootstrap-dropdown.js mode change 100755 => 100644 tbc/static/js/tests/unit/bootstrap-modal.js mode change 100755 => 100644 tbc/static/js/tests/unit/bootstrap-phantom.js mode change 100755 => 100644 tbc/static/js/tests/unit/bootstrap-popover.js mode change 100755 => 100644 tbc/static/js/tests/unit/bootstrap-scrollspy.js mode change 100755 => 100644 tbc/static/js/tests/unit/bootstrap-tab.js mode change 100755 => 100644 tbc/static/js/tests/unit/bootstrap-tooltip.js mode change 100755 => 100644 tbc/static/js/tests/unit/bootstrap-transition.js mode change 100755 => 100644 tbc/static/js/tests/unit/bootstrap-typeahead.js mode change 100755 => 100644 tbc/static/js/tests/vendor/jquery.js mode change 100755 => 100644 tbc/static/js/tests/vendor/qunit.css mode change 100755 => 100644 tbc/static/js/tests/vendor/qunit.js create mode 100644 tbc/static/templates/editors-picks.html mode change 100755 => 100644 tbc/templates/base.html mode change 100755 => 100644 tbc/templates/tbc/login.html mode change 100755 => 100644 tbc/views.py diff --git a/PythonTBC/settings.py b/PythonTBC/settings.py index 4d99488..28eda1d 100644 --- a/PythonTBC/settings.py +++ b/PythonTBC/settings.py @@ -141,6 +141,8 @@ INSTALLED_APPS = ( 'south', 'commentingapp', 'tbc_error_page', + 'taggit', + 'taggit_templatetags2', ) diff --git a/base.html b/base.html new file mode 100755 index 0000000..e47cbf6 --- /dev/null +++ b/base.html @@ -0,0 +1,428 @@ +{% load static %} +{% load taggit_templatetags2_tags %} + + + + + {% block title %} + Python Textbook Companion Project | FOSSEE, IIT Bombay + {% endblock %} + + {% block meta %} + + + + + {% endblock %} + + + + + + + {% block css %} + + {% endblock %} + + + + +
+ {% block content %} + {% if up %} +
+
+ × +

Book has been uploaded successfully !

+
+
+
+ {% endif %} + {% if login %} +
+
+ × +

Login Successful !

+
+
+
+ {% endif %} + {% if logout %} +
+
+ × +

You have logged out successfully !

+
+
+
+ {% endif %} + {% if update_book %} +
+
+ × +

Book has been updated successfully !

+
+
+
+ {% endif %} + {% if not_found %} +
+
+ × +

It seems that currently there is no book that you can update ! Please submit one.

+
+
+
+ {% endif %} + {% if proposal_submitted %} +
+
+ × +

Thank you for showing interest in contributing to Python TBC.
We have received your proposal. Please be patient we will get back to you within few days.

+
+
+
+ {% endif %} + {% if proposal_pending %} +
+
+ × +

You either have a proposal pending or you are already working on a book. You cannot submit a proposal at this moment.

+
+
+
+ {% endif %} + {% if book_pending %} +
+
+ × +

You either have a proposal pending or you are already working on a book. You cannot submit a proposal at this moment.

+
+
+
+ {% endif %} + {% if no_book_alloted %} +
+
+ × +

There is no book alloted to you. You cannot submit codes.

+
+
+
+ {% endif %} + {% if sample_notebook %} +
+
+ × +

Sample notebook has been submitted successfully. Please be patient while the reviewer reviews your codes & get backs to you.

+
+
+
+ {% endif %} + {% if cannot_submit_sample %} +
+
+ × +

You have not been permitted to send sample notebook.

+
+
+
+ {% endif %} + {% if bookupdate %} +
+
+ × +

Thank You ! Codes have been updated successfully !

+
+
+
+ {% endif %} + +
+

Editors' Picks

+
+
+ + + + ? + + Minimum or NO trivial examples
+ Maximum usage of scientific libraries +
+
+ + {% get_taglist as tags for 'tbc.book' %} +
+ {% for item in items %} + {% if item.book.tags.all %} + + {% endif %} + {% endfor %} + + +
+ + + +
+

Recent Submissions

+
+ + +
+
+ {% for item in items|slice:":3" %} + + {% endfor %} +
+
+
+ Browse All Books +
+
+ + + + {% endblock %} +
+ + + +
+ + + + {% block script %} + {% endblock %} + + + + + + + + + + + + diff --git a/tbc/certificate/tbc_certificate.tex b/tbc/certificate/tbc_certificate.tex new file mode 100644 index 0000000..06def58 --- /dev/null +++ b/tbc/certificate/tbc_certificate.tex @@ -0,0 +1,6 @@ +Certificate template for Python Textbook Companion +Write your own template and use $variable name to substitute that variable +with the data you want. +Example use in the template and then using Template class of the string +module you can substitute the with a name you want. +Note: The template should result in a tex file. diff --git a/tbc/forms.py b/tbc/forms.py index 327c32a..f1a1328 100644 --- a/tbc/forms.py +++ b/tbc/forms.py @@ -62,7 +62,7 @@ class BookForm(forms.ModelForm): self.fields['no_chapters'].label = "Number of Chapters" class Meta: model = Book - exclude = ('contributor', 'approved', 'reviewer') + exclude = ('contributor', 'approved', 'reviewer', 'tags') widgets = { 'title':forms.TextInput(attrs={'placeholder':'Title of the Book'}), 'author':forms.TextInput(attrs={'placeholder':'Author of the Book'}), diff --git a/tbc/models.py b/tbc/models.py index 4032125..44571ba 100644 --- a/tbc/models.py +++ b/tbc/models.py @@ -3,7 +3,7 @@ from django.contrib.auth.models import User from PythonTBC import settings from django.contrib.admin.models import LogEntry from local import sitemap_path - +from taggit.managers import TaggableManager CATEGORY = (("fluid mechanics", "Fluid Mechanics"), ("control systems", "Control Theory & Control Systems"), @@ -104,6 +104,7 @@ class Book(models.Model): contributor = models.ForeignKey(Profile) reviewer = models.ForeignKey(Reviewer) approved = models.BooleanField(default=False) + tags = TaggableManager() def __unicode__(self): name = self.title or 'Book' return '%s'%(name) diff --git a/tbc/static/css/base.css b/tbc/static/css/base.css old mode 100755 new mode 100644 diff --git a/tbc/static/css/responsive.css b/tbc/static/css/responsive.css old mode 100755 new mode 100644 diff --git a/tbc/static/js/.jshintrc b/tbc/static/js/.jshintrc old mode 100755 new mode 100644 diff --git a/tbc/static/js/bootstrap-affix.js b/tbc/static/js/bootstrap-affix.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/bootstrap-alert.js b/tbc/static/js/bootstrap-alert.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/bootstrap-button.js b/tbc/static/js/bootstrap-button.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/bootstrap-carousel.js b/tbc/static/js/bootstrap-carousel.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/bootstrap-collapse.js b/tbc/static/js/bootstrap-collapse.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/bootstrap-dropdown.js b/tbc/static/js/bootstrap-dropdown.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/bootstrap-modal.js b/tbc/static/js/bootstrap-modal.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/bootstrap-popover.js b/tbc/static/js/bootstrap-popover.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/bootstrap-scrollspy.js b/tbc/static/js/bootstrap-scrollspy.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/bootstrap-tab.js b/tbc/static/js/bootstrap-tab.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/bootstrap-tooltip.js b/tbc/static/js/bootstrap-tooltip.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/bootstrap-transition.js b/tbc/static/js/bootstrap-transition.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/bootstrap-typeahead.js b/tbc/static/js/bootstrap-typeahead.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/jquery.js b/tbc/static/js/jquery.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/tests/index.html b/tbc/static/js/tests/index.html old mode 100755 new mode 100644 diff --git a/tbc/static/js/tests/phantom.js b/tbc/static/js/tests/phantom.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/tests/server.js b/tbc/static/js/tests/server.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/tests/unit/bootstrap-affix.js b/tbc/static/js/tests/unit/bootstrap-affix.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/tests/unit/bootstrap-alert.js b/tbc/static/js/tests/unit/bootstrap-alert.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/tests/unit/bootstrap-button.js b/tbc/static/js/tests/unit/bootstrap-button.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/tests/unit/bootstrap-carousel.js b/tbc/static/js/tests/unit/bootstrap-carousel.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/tests/unit/bootstrap-collapse.js b/tbc/static/js/tests/unit/bootstrap-collapse.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/tests/unit/bootstrap-dropdown.js b/tbc/static/js/tests/unit/bootstrap-dropdown.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/tests/unit/bootstrap-modal.js b/tbc/static/js/tests/unit/bootstrap-modal.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/tests/unit/bootstrap-phantom.js b/tbc/static/js/tests/unit/bootstrap-phantom.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/tests/unit/bootstrap-popover.js b/tbc/static/js/tests/unit/bootstrap-popover.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/tests/unit/bootstrap-scrollspy.js b/tbc/static/js/tests/unit/bootstrap-scrollspy.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/tests/unit/bootstrap-tab.js b/tbc/static/js/tests/unit/bootstrap-tab.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/tests/unit/bootstrap-tooltip.js b/tbc/static/js/tests/unit/bootstrap-tooltip.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/tests/unit/bootstrap-transition.js b/tbc/static/js/tests/unit/bootstrap-transition.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/tests/unit/bootstrap-typeahead.js b/tbc/static/js/tests/unit/bootstrap-typeahead.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/tests/vendor/jquery.js b/tbc/static/js/tests/vendor/jquery.js old mode 100755 new mode 100644 diff --git a/tbc/static/js/tests/vendor/qunit.css b/tbc/static/js/tests/vendor/qunit.css old mode 100755 new mode 100644 diff --git a/tbc/static/js/tests/vendor/qunit.js b/tbc/static/js/tests/vendor/qunit.js old mode 100755 new mode 100644 diff --git a/tbc/static/templates/editors-picks.html b/tbc/static/templates/editors-picks.html new file mode 100644 index 0000000..1406cf2 --- /dev/null +++ b/tbc/static/templates/editors-picks.html @@ -0,0 +1,26 @@ +

Editors' Picks

+

+