diff options
author | hardythe1 | 2014-09-25 14:21:49 +0530 |
---|---|---|
committer | hardythe1 | 2014-09-25 14:21:49 +0530 |
commit | baa81d0e2e2d323c90c55ebba7b66dd0dc04a99e (patch) | |
tree | 2130bf6253c7056d43945448f53e75f69af15bd3 /tbc/templates | |
parent | c498e86b5aa3f7afda65958adf81bee366c2dd1a (diff) | |
download | Python-TBC-Interface-baa81d0e2e2d323c90c55ebba7b66dd0dc04a99e.tar.gz Python-TBC-Interface-baa81d0e2e2d323c90c55ebba7b66dd0dc04a99e.tar.bz2 Python-TBC-Interface-baa81d0e2e2d323c90c55ebba7b66dd0dc04a99e.zip |
Fixed minor problems before deploying the automated proposal
Diffstat (limited to 'tbc/templates')
-rw-r--r-- | tbc/templates/tbc/review-proposal.html | 7 | ||||
-rw-r--r-- | tbc/templates/tbc/submit-sample.html | 15 |
2 files changed, 14 insertions, 8 deletions
diff --git a/tbc/templates/tbc/review-proposal.html b/tbc/templates/tbc/review-proposal.html index c0ea983..f4ab9b3 100644 --- a/tbc/templates/tbc/review-proposal.html +++ b/tbc/templates/tbc/review-proposal.html @@ -71,11 +71,14 @@ {% ifequal proposal.proposal.status "samples" %} {% if proposal.sample.sample_notebook %} <h5><a href="{% static 'uploads/' %}{{ proposal.sample.sample_notebook }}">sample notebook</a><br></h5> + <a class="btn btn-primary" href="{% url 'tbc:DisapproveProposal' proposal.proposal.id %}">Disapprove Samples</a> + <a class="btn btn-primary" href="{% url 'tbc:AllotBook' proposal.proposal.id %}">Alot Book</a> {% else %} <h5>Contributor has not submitted sample notebook yet.</h5> {% endif %} - <a class="btn btn-primary" href="{% url 'tbc:DisapproveProposal' proposal.proposal.id %}">Disapprove Samples</a> - <a class="btn btn-primary" href="{% url 'tbc:AllotBook' proposal.proposal.id %}">Alot Book</a> + {% endifequal %} + {% ifequal proposal.proposal.status "sample disapproved" %} + <h5>Samples have been disapproved. Contributor has not resubmitted sample notebook yet.</h5> {% endifequal %} </div> {% endfor %} diff --git a/tbc/templates/tbc/submit-sample.html b/tbc/templates/tbc/submit-sample.html index 96f1209..404ede5 100644 --- a/tbc/templates/tbc/submit-sample.html +++ b/tbc/templates/tbc/submit-sample.html @@ -2,10 +2,9 @@ {% block script %} <script> -function validate_content() +function validate_content(element) { - no_notebooks = {{ no_notebooks }}.length; - extension = document.getElementById("sample_notebook").value; + extension = document.getElementById(element).value; extension = extension.split("."); if (extension == "" || name == "") { @@ -13,10 +12,14 @@ function validate_content() return false; } if(extension.slice(Math.max(extension.length - 1, 1)) == "ipynb") + { return true; + } else + { alert("Oops ! You can upload only Ipython Notebooks (.ipynb extension)"); return false; + } return true; } </script> @@ -24,10 +27,10 @@ function validate_content() {% block 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> + <h5>You are uploading sample notebook for the book <br>{{ proposal.accepted }} by {{ proposal.accepted.author }}</h5> <p>Only .ipynb files are acceptable</p> {% 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();"> + <form action="/submit-sample/{{ proposal.id }}/{{ old_notebook.id }}" name="with-old" method=POST enctype="multipart/form-data" onSubmit="return validate_content('old_notebook');"> {% csrf_token %} <input type=text id=ch_name_old name=ch_name_old value="{{ old_notebook.name }}"> <input type=file id=old_notebook name=old_notebook> @@ -36,7 +39,7 @@ function validate_content() <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();"> + <form action="/submit-sample/{{ proposal.id }}" name="without-old" method=POST enctype="multipart/form-data" onSubmit="return validate_content('sample_notebook');"> {% 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> |