Commit 19f66acd by Kálmán Viktor

network: translation support and minor change to confirmation

parent c485b7d3
...@@ -4,18 +4,21 @@ ...@@ -4,18 +4,21 @@
{% block content %} {% block content %}
<div class="page-header"> <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> </div>
<form action="" method="post">{% csrf_token %} <form action="" method="post">{% csrf_token %}
{% if deps %} {% if deps %}
<div class="alert alert-warning"> <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 %} {% for dep in deps %}
<div class="alert"> <div class="alert">
<strong>{{ dep.name }}</strong> <strong>{% trans dep.name %}</strong>
<ul class=""> <ul class="">
{{ dep.data|unordered_list }} {{ dep.data|unordered_list }}
</ul> </ul>
...@@ -24,20 +27,19 @@ ...@@ -24,20 +27,19 @@
</div> </div>
{% else %} {% else %}
<div class="alert alert-success"> <div class="alert alert-success">
No dependencies, safe to delete! {% trans 'No dependencies, "safe" to delete!' %}
</div> </div>
{% endif %} {% endif %}
<form action="" method="post">{% csrf_token %} <form action="" method="post">{% csrf_token %}
<input type="hidden" value="{{ request.GET.from }}" name="next" /> <input type="hidden" value="{{ request.GET.from }}" name="next" />
{% if confirmation %} {% if confirmation %}
<label><p> <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 }}"/> <input type="text" name="confirm" class="form-control" placeholder="{{ object }}"/>
</p></label> </p></label>
{% else %} {% else %}
{% endif %} {% 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> </form>
{% endblock %} {% endblock %}
...@@ -93,7 +93,7 @@ class BlacklistDelete(DeleteView): ...@@ -93,7 +93,7 @@ class BlacklistDelete(DeleteView):
context = super(BlacklistDelete, self).get_context_data(**kwargs) context = super(BlacklistDelete, self).get_context_data(**kwargs)
if 'pk' in self.kwargs: if 'pk' in self.kwargs:
to_delete = Blacklist.objects.get(pk=self.kwargs['pk']) to_delete = Blacklist.objects.get(pk=self.kwargs['pk'])
context['to_delete'] = "%s - %s - %s" % (to_delete.ipv4, context['object'] = "%s - %s - %s" % (to_delete.ipv4,
to_delete.reason, to_delete.reason,
to_delete.type) to_delete.type)
return context return context
......
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