From c435fddecde1fc7d13687d23740062151bc52a72 Mon Sep 17 00:00:00 2001 From: hardythe1 Date: Fri, 25 Jul 2014 18:38:05 +0530 Subject: added changes to submit sample notebook & approve/dispprove sample notebook --- tbc/models.py | 2 +- tbc/templates/tbc/disapprove-sample.html | 17 ++++++++++++ tbc/templates/tbc/review-proposal.html | 24 ++++++++++------- tbc/templates/tbc/submit-sample.html | 2 +- tbc/urls.py | 2 +- tbc/views.py | 46 ++++++++++++++++++++++++++------ 6 files changed, 72 insertions(+), 21 deletions(-) create mode 100644 tbc/templates/tbc/disapprove-sample.html diff --git a/tbc/models.py b/tbc/models.py index 00cb56b..a1f2408 100644 --- a/tbc/models.py +++ b/tbc/models.py @@ -58,7 +58,7 @@ def get_image_dir(instance, filename): def get_sample_dir(instance, filename): - user_name = instance.user.user.first_name+instance.user.user.last_name + user_name = instance.proposal.user.user.first_name+instance.proposal.user.user.last_name return 'sample_notebooks/%s/%s' % (user_name, filename.replace(' ', '_')) class Profile(models.Model): diff --git a/tbc/templates/tbc/disapprove-sample.html b/tbc/templates/tbc/disapprove-sample.html new file mode 100644 index 0000000..2632edb --- /dev/null +++ b/tbc/templates/tbc/disapprove-sample.html @@ -0,0 +1,17 @@ +{% extends 'base.html' %} +{% load static %} +{% block content %} +
You are uploading sample notebook for the book {{ proposal.accepted.title }} by {{ proposal.accepted.author }}
+Only .ipynb files are acceptable