Skip to content
Snippets Groups Projects
Commit a265522c authored by Jan Maximilian Michal's avatar Jan Maximilian Michal
Browse files

Changed feedback view buttons so they auto accept before submitting

parent e6c05d19
No related branches found
No related tags found
1 merge request!3Resolve "New input format"
......@@ -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');
});
......
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')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment