Permalink
Browse files

Make delete resource confirmation a facebox dialog instead of a separ…

…ate page.
  • Loading branch information...
1 parent 073108d commit fb41aced76f790ec79475248079a1fbbf57b0f1d @jkal jkal committed Apr 20, 2012
@@ -109,10 +109,8 @@ def resource_delete(request, project_slug, resource_slug):
return HttpResponseRedirect(reverse('project_detail',
args=[resource.project.slug]),)
else:
- return render_to_response(
- 'resources/resource_confirm_delete.html', {'resource': resource,},
- context_instance=RequestContext(request))
-
+ return HttpResponseRedirect(reverse('resource_edit',
+ args=[resource.project.slug, resource.slug]))
@one_perm_required_or_403(pr_resource_add_change,
@@ -1,26 +0,0 @@
-{% extends "projects/base.html" %}
-{% load i18n %}
-
-{% block title %}{{ block.super }} | {% blocktrans with resource.name as resource_name %}Delete {{ resource_name }}{% endblocktrans %}{% endblock %}
-
-{% block breadcrumb %}{{ block.super }} &raquo; {% blocktrans with resource.name as resource_name %}Delete <em>{{ resource_name}}</em>{% endblocktrans %}{% endblock %}
-
-{% block content_title %}
- <h2 class="pagetitle">{% blocktrans with resource.name as resource_name %}Say goodbye to <em>{{ resource_name }}</em>?{% endblocktrans %}</h2>
-{% endblock %}
-
-{% block content_main %}
-
-<p>{% blocktrans with resource.name as resource_name %}
- Are you sure you want to permanently delete the translation resource '{{ resource_name }}'?
-{% endblocktrans %}</p>
-
- <form action="{% url resource_delete project_slug=resource.project.slug resource_slug=resource.slug %}" method="post">{% csrf_token %}
- <input type="submit" class="i16 submit buttonized" value='{% trans "Yes, I am sure!" %}' />
- </form>
-
-{% endblock %}
-
-{% block content_footer %}
-
-{% endblock %}
@@ -23,6 +23,7 @@
$('.tx-form .required, .tx-form .field-helptext').each(function(){
$(this).appendTo($(this).siblings('label'));
});
+ $('a[rel*=facebox]').facebox()
});
</script>
{% endblock %}
@@ -103,8 +104,20 @@ <h3 class="sh-label">{% trans "Delete resource from Transifex" %}</h3>
<p style="margin-bottom:1em;">{% trans "By deleting the resource your translations will be lost:" %}</p>
<div>
- <a class="i16 delete buttonized buttonized_warning" href="{% url resource_delete project_slug=resource.project.slug resource_slug=resource.slug %}">{% trans "Delete resource" %}</a>
+ <a class="i16 delete buttonized buttonized_warning" rel="facebox" href="#js-delete-resource-confirm">{% trans "Delete resource" %}</a>
</div>
{% endif %}
+
+ <div id="js-delete-resource-confirm" style="display:none">
+ <div class='facebox-content'>
+ <h4>{% blocktrans with resource.name as resource_name %}Say goodbye to <em>{{ resource_name }}</em>?{% endblocktrans %}</h4>
+ <div class="warning">
+ <p>{% blocktrans with resource.name as resource_name %}Are you sure you want to permanently delete the translation resource '{{ resource_name }}'?{% endblocktrans %}</p></p>
+ </div>
+ <form action="{% url resource_delete project_slug=resource.project.slug resource_slug=resource.slug %}" method="post">{% csrf_token %}
+ <input type="submit" class="i16 submit buttonized" value='{% trans "Yes, I am sure!" %}' />
+ </form>
+ </div>
+ </div>
{% endblock %}

0 comments on commit fb41ace

Please sign in to comment.