From 475a7b16aa8c24ff2d42e71a84db32949c0f4cf8 Mon Sep 17 00:00:00 2001 From: prathamesh Date: Fri, 14 Nov 2014 17:18:08 +0530 Subject: Screenshots will be linked to corresponding chapter Any new chapters and screenshots submitted will be linked. --- tbc/models.py | 1 + tbc/templates/tbc/book-details.html | 6 +++++- tbc/templates/tbc/book-review-details.html | 6 +++++- tbc/templates/tbc/update-code.html | 27 ++++++++++++++++++++++----- tbc/templates/tbc/upload-content.html | 14 +++++++++++++- tbc/views.py | 14 ++++++++++++++ 6 files changed, 60 insertions(+), 8 deletions(-) diff --git a/tbc/models.py b/tbc/models.py index 67a6d09..bd06c93 100644 --- a/tbc/models.py +++ b/tbc/models.py @@ -109,6 +109,7 @@ class Chapters(models.Model): name = models.CharField(max_length=200) notebook = models.FileField(upload_to=get_notebook_dir) book = models.ForeignKey(Book) + screen_shots = models.ManyToManyField('ScreenShots') def __unicode__(self): name = self.name or 'Chapter' return '%s'%(name) diff --git a/tbc/templates/tbc/book-details.html b/tbc/templates/tbc/book-details.html index 415666d..dc8c272 100644 --- a/tbc/templates/tbc/book-details.html +++ b/tbc/templates/tbc/book-details.html @@ -19,7 +19,11 @@ function redirectToIpynb(notebook)
You are updating codes for the book {{ book.title }} by {{ book.author }}
@@ -6,17 +17,23 @@