Commit 0fa65bad authored by Petrus J.v.Rensburg's avatar Petrus J.v.Rensburg

Merge branch 'master' of github.com:mrjoes/flask-admin into examples

parents 2a8690f0 8f51c9c2
...@@ -20,3 +20,4 @@ examples/sqla-inline/static ...@@ -20,3 +20,4 @@ examples/sqla-inline/static
examples/file/files examples/file/files
.DS_Store .DS_Store
.idea/ .idea/
*.sqlite
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
{% macro form(actions, url) %} {% macro form(actions, url) %}
{% if actions %} {% if actions %}
<form id="action_form" action="{{ url }}" method="POST" style="display: none"> <form id="action_form" action="{{ url }}" method="POST" style="display: none">
{% if csrf_token %}
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
{% endif %}
<input type="hidden" id="action" name="action" /> <input type="hidden" id="action" name="action" />
</form> </form>
{% endif %} {% endif %}
......
...@@ -112,6 +112,9 @@ ...@@ -112,6 +112,9 @@
{% if form.hidden_tag is defined %} {% if form.hidden_tag is defined %}
{{ form.hidden_tag() }} {{ form.hidden_tag() }}
{% else %} {% else %}
{% if csrf_token %}
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
{% endif %}
{% for f in form if f.type == 'HiddenField' %} {% for f in form if f.type == 'HiddenField' %}
{{ f }} {{ f }}
{% endfor %} {% endfor %}
......
...@@ -107,6 +107,9 @@ ...@@ -107,6 +107,9 @@
{%- endif -%} {%- endif -%}
{%- if admin_view.can_delete -%} {%- if admin_view.can_delete -%}
<form class="icon" method="POST" action="{{ url_for('.delete_view', id=get_pk_value(row), url=return_url) }}"> <form class="icon" method="POST" action="{{ url_for('.delete_view', id=get_pk_value(row), url=return_url) }}">
{% if csrf_token %}
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
{% endif %}
<button onclick="return confirm('{{ _gettext('You sure you want to delete this item?') }}');"> <button onclick="return confirm('{{ _gettext('You sure you want to delete this item?') }}');">
<i class="icon-trash"></i> <i class="icon-trash"></i>
</button> </button>
......
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 to comment