Commit 19f66acd by Kálmán Viktor

network: translation support and minor change to confirmation

parent c485b7d3
......@@ -4,18 +4,21 @@
{% block content %}
<div class="page-header">
<h2>Are you sure you want to delete <strong>"{% if to_delete %}{{ to_delete }}{% else %}{{ object }}{% endif %}"</strong>?</h2>
<h2>
{% blocktrans %}
Are you sure you want to delete
<strong>"{{ object }}"</strong>?
{% endblocktrans %}
</h2>
</div>
<form action="" method="post">{% csrf_token %}
{% if deps %}
<div class="alert alert-warning">
This action also <strong>removes</strong> the following
{% trans "This action also <strong>removes</strong> the following" %}
{% for dep in deps %}
<div class="alert">
<strong>{{ dep.name }}</strong>
<strong>{% trans dep.name %}</strong>
<ul class="">
{{ dep.data|unordered_list }}
</ul>
......@@ -24,20 +27,19 @@
</div>
{% else %}
<div class="alert alert-success">
No dependencies, safe to delete!
{% trans 'No dependencies, "safe" to delete!' %}
</div>
{% endif %}
<form action="" method="post">{% csrf_token %}
<input type="hidden" value="{{ request.GET.from }}" name="next" />
{% if confirmation %}
<label><p>
If you are really sure, type in the object's name!
{% trans "If you are really sure, type in the object's name!" %}
<input type="text" name="confirm" class="form-control" placeholder="{{ object }}"/>
</p></label>
{% else %}
{% endif %}
<input type="submit" class="btn btn-danger btn-lg pull-right" value="Yes delete it!" />
<input type="submit" class="btn btn-danger btn-lg pull-right" value="{% trans "Yes, delete it!" %}"/>
</form>
{% endblock %}
......@@ -93,9 +93,9 @@ class BlacklistDelete(DeleteView):
context = super(BlacklistDelete, self).get_context_data(**kwargs)
if 'pk' in self.kwargs:
to_delete = Blacklist.objects.get(pk=self.kwargs['pk'])
context['to_delete'] = "%s - %s - %s" % (to_delete.ipv4,
to_delete.reason,
to_delete.type)
context['object'] = "%s - %s - %s" % (to_delete.ipv4,
to_delete.reason,
to_delete.type)
return context
def get_success_url(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment