Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion managers/static/managers/scripts/delete_project_popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $(function () {
{
text: "Yes",
click: function () {
window.location.href = delete_project_path;
$("#form").submit();
}
}
]
Expand Down
12 changes: 9 additions & 3 deletions managers/templates/managers/project_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
{% load rest_framework %}
{% load crispy_forms_tags %}

{% block extra_head %}
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">
{% endblock %}

{% block content %}
<h2>
<small>
Expand Down Expand Up @@ -32,16 +36,18 @@ <h2>
<div id="dialog" style="display: none" title="{% trans 'Are you sure' %}?" align="center">
{% trans 'Do you want to delete' %} <br/>
<b>{{object.name}}</b> {% trans 'project' %}?
<form style="display: hidden" action="{% url 'custom-project-delete' pk=object.pk %}" method="POST" id="form">
{% csrf_token %}
</form>
</div>
{% endif %}
{% endblock %}

{% block extra_script %}
{{ form.media }}
{% if request.user.is_admin and object %}
<script type="text/javascript">
var delete_project_path = "{% url 'custom-project-delete' pk=object.pk %}";
</script>
<script src="//code.jquery.com/jquery-1.12.4.js"></script>
<script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script type="text/javascript" src="{% static 'managers/scripts/delete_project_popup.js' %}"></script>
{% endif %}
{% endblock %}