forked from enviPath/enviPy
refactor: large scale formatting/linting
This commit is contained in:
@ -1,50 +1,91 @@
|
||||
{% load static %}
|
||||
<div class="modal fade bs-modal-lg" id="new_reaction_modal" tabindex="-1" aria-labelledby="new_reaction_modal" aria-modal="true"
|
||||
role="dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">Create a new Reaction</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="new_reaction_modal_form" accept-charset="UTF-8" action="{% url 'package reaction list' meta.current_package.uuid %}" data-remote="true" method="post">
|
||||
{% csrf_token %}
|
||||
<label for="reaction-name">Name</label>
|
||||
<input id="reaction-name" class="form-control" name="reaction-name" placeholder="Name"/>
|
||||
<label for="reaction-description">Description</label>
|
||||
<input id="reaction-description" class="form-control" name="reaction-description" placeholder="Description"/>
|
||||
<p></p>
|
||||
<div>
|
||||
<iframe id="new_reaction_ketcher" src="{% static '/js/ketcher2/ketcher.html' %}" width="100%"
|
||||
height="510"></iframe>
|
||||
</div>
|
||||
<input type="hidden" name="reaction-smirks" id="reaction-smirks">
|
||||
<p></p>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary pull-left" data-dismiss="modal">Close
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary" id="new_reaction_modal_form_submit">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="modal fade bs-modal-lg"
|
||||
id="new_reaction_modal"
|
||||
tabindex="-1"
|
||||
aria-labelledby="new_reaction_modal"
|
||||
aria-modal="true"
|
||||
role="dialog"
|
||||
>
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button
|
||||
type="button"
|
||||
class="close"
|
||||
data-dismiss="modal"
|
||||
aria-label="Close"
|
||||
>
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">Create a new Reaction</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form
|
||||
id="new_reaction_modal_form"
|
||||
accept-charset="UTF-8"
|
||||
action="{% url 'package reaction list' meta.current_package.uuid %}"
|
||||
data-remote="true"
|
||||
method="post"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<label for="reaction-name">Name</label>
|
||||
<input
|
||||
id="reaction-name"
|
||||
class="form-control"
|
||||
name="reaction-name"
|
||||
placeholder="Name"
|
||||
/>
|
||||
<label for="reaction-description">Description</label>
|
||||
<input
|
||||
id="reaction-description"
|
||||
class="form-control"
|
||||
name="reaction-description"
|
||||
placeholder="Description"
|
||||
/>
|
||||
<p></p>
|
||||
<div>
|
||||
<iframe
|
||||
id="new_reaction_ketcher"
|
||||
src="{% static '/js/ketcher2/ketcher.html' %}"
|
||||
width="100%"
|
||||
height="510"
|
||||
></iframe>
|
||||
</div>
|
||||
<input type="hidden" name="reaction-smirks" id="reaction-smirks" />
|
||||
<p></p>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary pull-left"
|
||||
data-dismiss="modal"
|
||||
>
|
||||
Close
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary"
|
||||
id="new_reaction_modal_form_submit"
|
||||
>
|
||||
Submit
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function() {
|
||||
$('#new_reaction_modal_form_submit').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
$(this).prop("disabled",true);
|
||||
$(function () {
|
||||
$("#new_reaction_modal_form_submit").on("click", function (e) {
|
||||
e.preventDefault();
|
||||
$(this).prop("disabled", true);
|
||||
|
||||
k = getKetcher('new_reaction_ketcher');
|
||||
$('#reaction-smirks').val(k.getSmiles());
|
||||
k = getKetcher("new_reaction_ketcher");
|
||||
$("#reaction-smirks").val(k.getSmiles());
|
||||
|
||||
// submit form
|
||||
$('#new_reaction_modal_form').submit();
|
||||
// submit form
|
||||
$("#new_reaction_modal_form").submit();
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user