Skip to content

Commit

Permalink
new empty all confirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed May 4, 2016
1 parent 04f3d80 commit c34850c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/appier_extras/parts/admin/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ def send_email_g(cls, owner, *args, **kwargs):
**kwargs
)

@classmethod
@appier.operation(name = "Empty All", level = 2)
def op_empty_s(cls):
cls.delete_c()

@classmethod
def _build(cls, model, map):
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,16 @@
<a class="button" data-window_open="#window-{{ operation.method }}">{{ operation.name }}</a>
</li>
{% else %}
<li>
<a href="{{ url_for('admin.operation_model', model = model._name(), operation = operation.method, ids = entity._id, next = location_f) }}">{{ operation.name }}</a>
</li>
{% if operation.level > 1 %}
<li>
<a href="{{ url_for('admin.operation_model', model = model._name(), operation = operation.method, ids = entity._id, next = location_f) }}"
class="link-confirm" data-message="Are you sure you want to [[{{ operation.name }}]] ?">{{ operation.name }}</a>
</li>
{% else %}
<li>
<a href="{{ url_for('admin.operation_model', model = model._name(), operation = operation.method, is_global = '1', next = location_f) }}">{{ operation.name }}</a>
</li>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
Expand Down
13 changes: 10 additions & 3 deletions src/appier_extras/parts/admin/templates/fluid/models/show.html.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,16 @@
<a class="button" data-window_open="#window-{{ operation.method }}">{{ operation.name }}</a>
</li>
{% else %}
<li>
<a href="{{ url_for('admin.operation_model', model = model._name(), operation = operation.method, is_global = '1', next = location_f) }}">{{ operation.name }}</a>
</li>
{% if operation.level > 1 %}
<li>
<a href="{{ url_for('admin.operation_model', model = model._name(), operation = operation.method, is_global = '1', next = location_f) }}"
class="link-confirm" data-message="Are you sure you want to [[{{ operation.name }}]] ?">{{ operation.name }}</a>
</li>
{% else %}
<li>
<a href="{{ url_for('admin.operation_model', model = model._name(), operation = operation.method, is_global = '1', next = location_f) }}">{{ operation.name }}</a>
</li>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
Expand Down

0 comments on commit c34850c

Please sign in to comment.