diff --git a/core/templates/core/feedback_form.html b/core/templates/core/feedback_form.html index f47cacba6d5af0a152c31770b885943f35de2136..a493e6644b4f355e9d38e30ca9e83f5fcc6dec1c 100644 --- a/core/templates/core/feedback_form.html +++ b/core/templates/core/feedback_form.html @@ -73,7 +73,7 @@ RESULT: {{test.label}} <div class="form-inline"> {# Score field #} - <div class="input-group col-5 nopadding mr-1 mb-1"> + <div class="input-group col-5 nopadding mr-1 mb-2"> <span class="input-group-addon">Score:</span> <input class="form-control" @@ -91,30 +91,32 @@ RESULT: {{test.label}} {# status select #} {% with form.fields.status as status %} - <div class="form-group mr-1 mb-1"> + <div class="form-group mr-2 mb-2"> <select class="custom-select" id="id_status" name="status"> {% for val, name in status.choices %} - <option value="{{val}}" {% if val == feedback.status %}selected{% endif %}> {{name}}</option> + <option value="{{val}}" {% if val == feedback.status %}selected{% endif %}>{{name}}</option> {% endfor %} </select> </div> {% endwith %} - <button type="submit" form="form1" class="btn btn-secondary mr-1 mb-1" name="update" value="Submit">Submit</button> + <div> + {# Beware! compares status and origin #} + <button type="submit" form="form1" class="btn btn-outline-success mb-2" name="update" value="Save">Save</button> + <button type="submit" form="form1" class="btn btn-outline-success mb-2" name="update" value="Submit">Save and return</button> - {# Beware! compares status and origin #} - {% if feedback.status == feedback.NEEDS_REVIEW or feedback.status == feedback.EDITABLE %} - <button type="submit" form="form1" class="btn btn-success mr-1 mb-1" name="update" value="Next">Next</button> - <button type="submit" form="form1" class="btn btn-success mr-1 mb-1" name="update" value="Save">Save</button> - {% endif %} + {% if feedback.status == feedback.NEEDS_REVIEW or feedback.status == feedback.EDITABLE %} + <button type="submit" onclick="set_accepted();" form="form1" class="btn btn-outline-success mb-2" name="update" value="Next">Accept, Save and Next</button> + {% endif %} - {% if feedback.origin != feedback.MANUAL %} - <a href="{% url 'FeedbackDelete' feedback.slug %}" class="btn btn-outline-danger mr-1 mb-1" name="delete" value="Delete">Delete auto feedback</a> - {% endif %} + {% if feedback.origin != feedback.MANUAL %} + <a href="{% url 'FeedbackDelete' feedback.slug %}" class="btn btn-outline-danger mb-2" name="delete" value="Delete">Delete auto feedback</a> + {% endif %} - {% if feedback.status == feedback.ACCEPTED %} - <button class="btn btn-secondary mr-1 mb-1" value="Submit" disabled>View is read only</button> - {% endif %} + {% if feedback.status == feedback.ACCEPTED %} + <button class="btn btn-secondary mr-1 mb-2" value="Submit" disabled>View is read only</button> + {% endif %} + </div> </div> </form> </div> @@ -130,6 +132,10 @@ RESULT: {{test.label}} {% block script_block %} <script> + function set_accepted() { + $('#id_status')[0].value = {{feedback.ACCEPTED}}; + } + $('#collapseAllOpen').click(function(){ $('.collapse').collapse('show'); }); diff --git a/core/views/index.py b/core/views/index.py index 9a6e56f787a88d764a4b487e906d041d782f7413..8c55022c3c84be1d0c2a0cb25f2d2b73bff9cce6 100644 --- a/core/views/index.py +++ b/core/views/index.py @@ -1,11 +1,5 @@ from django.shortcuts import render -from core.models import SubmissionType - def index(request): - context = { - 'boldmessage': 'Delbert Grady says hey there world!', - 'submission_types': SubmissionType.objects.all(), - } - return render(request, 'core/index.html', context) + return render(request, 'core/index.html')