Skip to content

Commit 9e44531

Browse files
committed
Add a modal that reminds people to include XML with their submission.
Commit ready for merge. - Legacy-Id: 19495
1 parent 4ed19e1 commit 9e44531

1 file changed

Lines changed: 53 additions & 3 deletions

File tree

ietf/templates/submit/upload_submission.html

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
<div class="panel panel-default">
4040
<div class="panel-body">
41-
<form method="post" enctype="multipart/form-data">
41+
<form method="post" enctype="multipart/form-data" id="upload-form">
4242
{% csrf_token %}
4343

4444
<div class="form-group">
@@ -95,13 +95,63 @@
9595

9696
{% include "submit/problem-reports-footer.html" %}{% endif %}
9797

98+
<div class="modal fade" id="no-xml" tabindex="-1" role="dialog" aria-labelledby="no-xml-label">
99+
<div class="modal-dialog" role="document">
100+
<div class="modal-content">
101+
<div class="modal-header">
102+
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
103+
<h4 class="modal-title" id="no-xml-label">
104+
Attempting I-D submission without XML
105+
</h4>
106+
</div>
107+
<div class="modal-body">
108+
<p>
109+
<b>
110+
You are attempting to submit an Internet-Draft without
111+
including the XML source. This is discouraged.
112+
</b>
113+
</p>
114+
<p>
115+
If you have the XML source available, please return to the
116+
upload form and include it with the submission.
117+
</p>
118+
<p>
119+
If you do not have the XML source, you may proceed.
120+
</p>
121+
</div>
122+
<div class="modal-footer">
123+
<button type="button" class="btn btn-default" id="upload-anyway" data-dismiss="modal">
124+
Proceed without XML source
125+
</button>
126+
<button type="button" class="btn btn-primary" data-dismiss="modal">
127+
Return to form
128+
</button>
129+
</div>
130+
</div>
131+
</div>
132+
</div>
133+
98134
{% endblock %}
99135

100136
{% block js %}
101137
<script>
102138
$(document).ready(function() {
103-
if ($("#checkbox").is(':checked'))
104-
$("#other-formats").collapse('show')
139+
if ($("#checkbox").is(":checked") || $("#other-formats .has-error").length) {
140+
$("#checkbox").attr("checked", true);
141+
$("#other-formats").collapse("show");
142+
}
143+
});
144+
145+
$("#upload-form").submit(function(e) {
146+
e.preventDefault();
147+
if ($("#id_xml").val() == "")
148+
$("#no-xml").modal();
149+
else
150+
this.submit();
151+
});
152+
153+
$("#upload-anyway").click(function() {
154+
$("#upload-form").unbind("submit").submit();
105155
});
106156
</script>
107157
{% endblock %}

0 commit comments

Comments
 (0)