diff --git a/dmoj/urls.py b/dmoj/urls.py index 2b2c52f..d9233de 100644 --- a/dmoj/urls.py +++ b/dmoj/urls.py @@ -420,12 +420,12 @@ urlpatterns = [ url( r"^edit_page$", test_formatter.EditTestFormatter.as_view(), - name="edit_page", + name="test_formatter_edit", ), url( r"^download_page$", test_formatter.DownloadTestFormatter.as_view(), - name="download_page", + name="test_formatter_download", ), ] ), diff --git a/templates/test_formatter/download_test_formatter.html b/templates/test_formatter/download_test_formatter.html index b7f4d2c..2fddc4e 100644 --- a/templates/test_formatter/download_test_formatter.html +++ b/templates/test_formatter/download_test_formatter.html @@ -33,7 +33,7 @@ event.preventDefault() var file_path = document.getElementById('file_path').value; $.ajax({ - url: "{{url('download_page')}}", + url: "{{url('test_formatter_download')}}", type: 'POST', data: { file_path: file_path @@ -74,7 +74,7 @@
- {{_('Edit')}} + {{_('Edit')}}
diff --git a/templates/test_formatter/edit_test_formatter.html b/templates/test_formatter/edit_test_formatter.html index ac4e6f1..6cf7298 100644 --- a/templates/test_formatter/edit_test_formatter.html +++ b/templates/test_formatter/edit_test_formatter.html @@ -45,7 +45,7 @@ $("#convert").on("click", function(event) { event.preventDefault() $.ajax({ - url: "{{url('edit_page')}}", + url: "{{url('test_formatter_edit')}}", type: 'POST', data: { action: 'convert', @@ -70,16 +70,15 @@ $(document).ready(function(){ $("#download").on("click", function(event) { event.preventDefault() - window.location.href = "{{url('edit_page')}}"; $.ajax({ - url: "{{url('edit_page')}}", + url: "{{url('test_formatter_edit')}}", type: 'POST', data: { action: 'download' }, success: function(data) { var file_path = data; - window.location.href = "{{url('download_page')}}" + "?file_path="+file_path; + window.location.href = "{{url('test_formatter_download')}}" + "?file_path="+file_path; }, error: function(error) { alert(error); diff --git a/templates/test_formatter/test_formatter.html b/templates/test_formatter/test_formatter.html index 3d199cb..5831f1d 100644 --- a/templates/test_formatter/test_formatter.html +++ b/templates/test_formatter/test_formatter.html @@ -1,11 +1,11 @@ {% extends 'base.html' %} {% block body %} -
- {% csrf_token %} - {{ form }} - -
- - +
+
+ {% csrf_token %} + {{ form }} + +
+
{% endblock %}