summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhardythe12014-07-08 15:35:16 +0530
committerhardythe12014-07-08 15:35:16 +0530
commit3afa66d898abc2a68cb9912c93a86edaee6eef72 (patch)
treef656e5b2a399d8ced4b06f4bb4f6517998ab743c
parent2415d9e6616b2fbf3e2cf74a970b82e59868f18d (diff)
downloadPython-TBC-Interface-3afa66d898abc2a68cb9912c93a86edaee6eef72.tar.gz
Python-TBC-Interface-3afa66d898abc2a68cb9912c93a86edaee6eef72.tar.bz2
Python-TBC-Interface-3afa66d898abc2a68cb9912c93a86edaee6eef72.zip
removing the changes for now
-rw-r--r--tbc/models.py1
-rw-r--r--tbc/templates/tbc/book-details.html2
-rw-r--r--tbc/templates/tbc/upload-content.html2
-rwxr-xr-xtbc/views.py2
4 files changed, 2 insertions, 5 deletions
diff --git a/tbc/models.py b/tbc/models.py
index 56ea268..76c9dc6 100644
--- a/tbc/models.py
+++ b/tbc/models.py
@@ -101,7 +101,6 @@ class ScreenShots(models.Model):
caption = models.CharField(max_length=128)
image = models.FileField(upload_to=get_image_dir)
book = models.ForeignKey(Book)
- chapter = models.ForeignKey(Chapters)
def __unicode__(self):
name = self.caption or 'ScreenShots'
return '%s'%(name)
diff --git a/tbc/templates/tbc/book-details.html b/tbc/templates/tbc/book-details.html
index 6684244..3099063 100644
--- a/tbc/templates/tbc/book-details.html
+++ b/tbc/templates/tbc/book-details.html
@@ -19,7 +19,7 @@ function redirectToIpynb(notebook)
<div class="row-fluid">
{% for image in images %}
<div class ="module-list">
- <a href="{% url 'tbc:ConvertNotebook' image.chapter.notebook %}"><img src="{% static 'uploads/' %}{{ image.image }}"></a>
+ <img src="{% static 'uploads/' %}{{ image.image }}">
<center><p style="margin-top:30px;">{{ image.caption }}</p></center>
</div>
{% endfor %}
diff --git a/tbc/templates/tbc/upload-content.html b/tbc/templates/tbc/upload-content.html
index 3b53ecc..ddc0f72 100644
--- a/tbc/templates/tbc/upload-content.html
+++ b/tbc/templates/tbc/upload-content.html
@@ -55,7 +55,7 @@ function validate_content()
{% endfor %}
<br>
<hr>
- <p>Upload screenshots of Plots/Graphs/Charts(if any) "that you have plotted" and not from the textbook itself from any cahpter. If there are no plots/graphs/charts, then upload a screenshot of any chapter. Also give the name of the chapter the screen shot is taken from. The name of the chapter you give should match the name of the chapter given above for its .ipynb file. Only .png files are acceptable.</p>
+ <p>Upload screenshots of Plots/Graphs/Charts(if any) "that you have plotted" and not from the textbook itself from any cahpter. If there are no plots/graphs/charts, then upload a screenshot of any chapter. Give proper caption for the screen shots. Only .png files are acceptable.</p>
{% for i in no_images %}
<input type=text id=caption{{i}} name=caption{{i}} placeholder="Caption {{ forloop.counter }}">
<input type=file id=image{{i}} name=image{{i}}>
diff --git a/tbc/views.py b/tbc/views.py
index f45df40..bc3913b 100755
--- a/tbc/views.py
+++ b/tbc/views.py
@@ -348,8 +348,6 @@ def ContentUpload(request, book_id=None):
screenshot = ScreenShots()
screenshot.caption = request.POST['caption'+str(i)]
screenshot.image = request.FILES['image'+str(i)]
- chapter = Chapters.objects.get(name=request.POST['caption'+str(i)], book=curr_book)
- screenshot.chapter = chapter
screenshot.book = curr_book
screenshot.save()
book = Book.objects.order_by("-id")[0]