diff options
-rwxr-xr-x | tbc/static/css/base.css | 1 | ||||
-rwxr-xr-x | tbc/templates/base.html | 3 | ||||
-rw-r--r-- | tbc/views.py | 9 |
3 files changed, 5 insertions, 8 deletions
diff --git a/tbc/static/css/base.css b/tbc/static/css/base.css index 1c3572e..c3d835e 100755 --- a/tbc/static/css/base.css +++ b/tbc/static/css/base.css @@ -6178,6 +6178,7 @@ a.badge:focus { height: 220px; margin: 20px 0 0 20px; padding: 10px; + padding-bottom: 35px; position: relative; width: 300px; } diff --git a/tbc/templates/base.html b/tbc/templates/base.html index bcbf19b..9a47446 100755 --- a/tbc/templates/base.html +++ b/tbc/templates/base.html @@ -81,11 +81,12 @@ <center><h3>Latest Books</h3></center> {% for item in items %} <div class ="module-list"> - <a href="{% url 'tbc:BookDetails' item.book.id %}"><img src="{% static 'uploads/' %}{{ item.image.image }}"></a> <center><a href="{% url 'tbc:BookDetails' item.book.id %}">{{ item.book.title }}</a></center> + <a href="{% url 'tbc:BookDetails' item.book.id %}"><img src="{% static 'uploads/' %}{{ item.image.image }}"></a> </div> {% endfor %} </div> + <br> <hr> <input type=text> <input type=submit value=Search><a href="{% url 'tbc:BrowseBooks' %}" style="float:right;">Browse All Books</a> {% endblock %} diff --git a/tbc/views.py b/tbc/views.py index 2a5b950..d19d7d3 100644 --- a/tbc/views.py +++ b/tbc/views.py @@ -9,6 +9,7 @@ import os import zipfile import StringIO import smtplib +import shutil from email.mime.text import MIMEText @@ -255,7 +256,6 @@ def ApproveBook(request, book_id=None): zip_path = "/".join(file_path.split("/")[1:-2]) zip_path = "/"+zip_path+"/Python-Textbook-Companions/" file_path = file_path+"/static/uploads/" - return HttpResponse(file_path) directory = file_path+book.contributor.user.first_name os.chmod(directory, 0777) os.chdir(directory) @@ -271,12 +271,7 @@ def ApproveBook(request, book_id=None): fp.write("Isbn: "+book.isbn+"\n") fp.write("Edition: "+book.edition) fp.close() - os.popen("cp -r "+book.title+" "+zip_path) - os.chdir(zip_path) - os.popen("git add .") - commit_msg = "adding "+book.title - os.popen("git commit -m "+commit_msg) - os.popen("git push") + x = shutil.copytree(book.title, zip_path+book.title) context['user'] = user return HttpResponseRedirect("/book-review") elif request.method == 'POST' and request.POST['approve_notify'] == "notify": |