diff options
author | hardythe1 | 2014-08-11 17:57:33 +0530 |
---|---|---|
committer | hardythe1 | 2014-08-11 17:57:33 +0530 |
commit | 60a93ffd5a9aa7abb0a4f09c5de4374b77b2cae8 (patch) | |
tree | 2bbf5c6e9b7277922e9a2760650531f97e4a4c12 /tbc/templates | |
parent | 250fc9e92257994e5610892be40ab62939fbcbac (diff) | |
download | Python-TBC-Interface-60a93ffd5a9aa7abb0a4f09c5de4374b77b2cae8.tar.gz Python-TBC-Interface-60a93ffd5a9aa7abb0a4f09c5de4374b77b2cae8.tar.bz2 Python-TBC-Interface-60a93ffd5a9aa7abb0a4f09c5de4374b77b2cae8.zip |
added changes to submit codes directly for a book & to overwrite the previous data for sample notebooks
Diffstat (limited to 'tbc/templates')
-rwxr-xr-x | tbc/templates/base.html | 20 | ||||
-rw-r--r-- | tbc/templates/tbc/review-proposal.html | 8 | ||||
-rw-r--r-- | tbc/templates/tbc/submit-sample.html | 27 | ||||
-rw-r--r-- | tbc/templates/tbc/upload-content.html | 8 |
4 files changed, 49 insertions, 14 deletions
diff --git a/tbc/templates/base.html b/tbc/templates/base.html index 91e8454..9708a53 100755 --- a/tbc/templates/base.html +++ b/tbc/templates/base.html @@ -94,7 +94,7 @@ <ul class="dropdown-menu"> <li><a href="{% url 'tbc:SubmitProposal' %}">Submit Proposal</a></li> <li><a href="{% url 'tbc:SubmitSample' %}">Submit Sample Notebook</a></li> - <li><a href="{% url 'tbc:SubmitBook' %}">Submit Book</a></li> + <li><a href="{% url 'tbc:SubmitCode' %}">Submit Codes</a></li> <li><a href="{% url 'tbc:UpdateBook' %}">Update Submission</a></li> <li><a href="{% url 'tbc:UpdatePassword' %}">Update Password</a></li> <li><a href="{% url 'tbc:UserLogout' %}">Logout</a></li> @@ -188,6 +188,24 @@ </center> <div class="clearfix"></div> {% endif %} + {% if no_book_alloted %} + <center> + <div class="alert" style="width:400px;height:25px;"> + <a class="close" data-dismiss="alert" href="#">×</a> + <p>There is no book alloted to you. You cannot submit codes.</p> + </div> + </center> + <div class="clearfix"></div> + {% endif %} + {% if sample_notebook %} + <center> + <div class="alert" style="width:550px;height:40px;"> + <a class="close" data-dismiss="alert" href="#">×</a> + <p>Sample notebook has been submitted successfully. Please be patient while the reviewer reviews your codes & get backs to you.</p> + </div> + </center> + <div class="clearfix"></div> + {% endif %} <div class="row-fluid"> <center><h3>Recent Submissions</h3></center> {% for item in items %} diff --git a/tbc/templates/tbc/review-proposal.html b/tbc/templates/tbc/review-proposal.html index 98c26a1..a71ebfc 100644 --- a/tbc/templates/tbc/review-proposal.html +++ b/tbc/templates/tbc/review-proposal.html @@ -9,11 +9,11 @@ <ol> {% for proposal in proposals %} <li><h4>Propsal from {{ proposal.user.user.first_name }} {{ proposal.user.user.last_name }}</h4></li> - <div class="accordion" id="accordion2"> + <div class="accordion" id="accordion{{ forloop.counter }}"> {% for textbook in proposal.textbooks.all %} <div class="accordion-group"> <div class="accordion-heading"> - <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapse{{forloop.counter}}"> + <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion{{ forloop.counter }}" href="#collapse{{forloop.counter}}"> Book Preference {{ forloop.counter }} - {{ textbook.title }} </a> </div> @@ -41,11 +41,11 @@ <ol> {% for proposal in old_proposals %} <h4><li>Propsal from {{ proposal.proposal.user.user.first_name }} {{ proposal.proposal.user.user.last_name }}</h4></li> - <div class="accordion" id="accordion2"> + <div class="accordion" id="accordion{{ forloop.counter }}"> {% for textbook in proposal.proposal.textbooks.all %} <div class="accordion-group"> <div class="accordion-heading"> - <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapse{{forloop.counter}}"> + <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion{{ forloop.counter }}" href="#collapse{{forloop.counter}}"> Book Preference {{ forloop.counter }} - {{ textbook.title }} </a> </div> diff --git a/tbc/templates/tbc/submit-sample.html b/tbc/templates/tbc/submit-sample.html index b26e8ae..f259ffc 100644 --- a/tbc/templates/tbc/submit-sample.html +++ b/tbc/templates/tbc/submit-sample.html @@ -26,13 +26,24 @@ function validate_content() <div id="content-wrap" style="max-width:600px;"> <h5>You are uploading sample notebook for the book {{ proposal.accepted }} by {{ proposal.accepted.author }}</h5> <p>Only .ipynb files are acceptable</p> - <form action="/submit-sample/{{ proposal.id }}" method=POST enctype="multipart/form-data" onSubmit="return validate_content();"> - {% csrf_token %} - <input type=text id=ch_name name=ch_name placeholder="Name of the chapter you coded the solved example from"> - <input type=file id=sample_notebook name=sample_notebook> - <br> - <hr> - <center><input class="btn btn-primary" type=submit value=submit></center> - </form> + {% if has_old %} + <form action="/submit-sample/{{ proposal.id }}/{{ old_notebook.id }}" name="with-old" method=POST enctype="multipart/form-data" onSubmit="return validate_content();"> + {% csrf_token %} + <input type=text id=ch_name_old name=ch_name_old placeholder="{{ old_notebook.title }}"> + <input type=file id=old_notebook name=old_notebook> + <br> + <hr> + <center><input class="btn btn-primary" type=submit value=submit></center> + </form> + {% else %} + <form action="/submit-sample/{{ proposal.id }}" name="without-old" method=POST enctype="multipart/form-data" onSubmit="return validate_content();"> + {% csrf_token %} + <input type=text id=ch_name name=ch_name placeholder="Name of the chapter you coded the solved example from"> + <input type=file id=sample_notebook name=sample_notebook> + <br> + <hr> + <center><input class="btn btn-primary" type=submit value=submit></center> + </form> + {% endif %} </div> {% endblock %} diff --git a/tbc/templates/tbc/upload-content.html b/tbc/templates/tbc/upload-content.html index 01bb584..1b73691 100644 --- a/tbc/templates/tbc/upload-content.html +++ b/tbc/templates/tbc/upload-content.html @@ -44,10 +44,15 @@ function validate_content() {% endblock %} {% block content %} +<center> + <h4>Submitting code for the book </h4> + <h4> {{ curr_book.title }} by {{ curr_book.author }}</h4> +</center> +<hr> <div id="content-wrap" style="max-width:600px;"> <p>Upload chapters as individual IPython notebooks. Please do not use spaces to name your Ipython Notebook files. For ex. use "chapter1.ipynb instead of chapter 1.ipynb"</p> - <form action="/upload-content/{{ curr_book.id }}" method=POST enctype="multipart/form-data"> + <form action="/submit-code/" method=POST enctype="multipart/form-data"> {% csrf_token %} {% for i in no_notebooks %} <input type=text id=chapter{{i}} name=chapter{{i}} placeholder="Chapter {{ forloop.counter }} name"> @@ -60,6 +65,7 @@ function validate_content() <input type=text id=caption{{i}} name=caption{{i}} placeholder="Caption {{ forloop.counter }}"> <input type=file id=image{{i}} name=image{{i}}> {% endfor %} + <br><br> <center><input class="btn btn-primary" type=submit value=submit onClick="return validate_content();"></center> </form> </div> |