forked from pallets-eco/flask-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request pallets-eco#1046 from pawl/move_file_admin_templates
File-admin - combine mkdir, rename, edit, and upload templates
- Loading branch information
Showing
9 changed files
with
93 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,7 @@ | ||
{%- if not modal -%} | ||
{% extends 'admin/master.html' %} | ||
{%- endif -%} | ||
{% extends 'admin/master.html' %} | ||
{% import 'admin/lib.html' as lib with context %} | ||
|
||
{% block body %} | ||
{%- if modal -%} | ||
{{ lib.render_form(form, dir_url, action=request.url, is_modal=True) }} | ||
{%- else -%} | ||
<h3>{{ header_text }}</h3> | ||
{{ lib.render_form(form, dir_url) }} | ||
{%- endif -%} | ||
{% endblock %} | ||
|
||
{% block tail %} | ||
{%- if modal -%} | ||
<script> | ||
// fill the header of modal dynamically | ||
$('.modal-header h3').html('{{ header_text }}'); | ||
|
||
// fixes "remote modal shows same content every time" | ||
$('.modal').on('hidden', function() { | ||
$(this).removeData('modal'); | ||
}); | ||
</script> | ||
{%- endif -%} | ||
{% block header %}<h3>{{ header_text }}</h3>{% endblock %} | ||
{{ lib.render_form(form, dir_url) }} | ||
{% endblock %} |
16 changes: 16 additions & 0 deletions
16
flask_admin/templates/bootstrap2/admin/file/modals/form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{% import 'admin/static.html' as admin_static with context %} | ||
{% import 'admin/lib.html' as lib with context %} | ||
|
||
{% block body %} | ||
{# content added to modal-content #} | ||
{{ lib.render_form(form, dir_url, action=request.url, is_modal=True) }} | ||
{% endblock %} | ||
|
||
{% block tail %} | ||
<script src="{{ admin_static.url(filename='admin/js/bs2_modal.js', v='1.0.0') }}"></script> | ||
|
||
<script> | ||
// fill the header of modal dynamically | ||
$('.modal-header h3').html('{% block header %}{{ header_text }}{% endblock %}'); | ||
</script> | ||
{% endblock %} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,7 @@ | ||
{%- if not modal -%} | ||
{% extends 'admin/master.html' %} | ||
{%- endif -%} | ||
{% extends 'admin/master.html' %} | ||
{% import 'admin/lib.html' as lib with context %} | ||
|
||
{% block body %} | ||
{%- if modal -%} | ||
{# content added to modal-content #} | ||
<div class="modal-header"> | ||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | ||
<h3>{{ header_text }}</h3> | ||
</div> | ||
<div class="modal-body"> | ||
{{ lib.render_form(form, dir_url, action=request.url, is_modal=True) }} | ||
</div> | ||
{%- else -%} | ||
<h3>{{ header_text }}</h3> | ||
{{ lib.render_form(form, dir_url) }} | ||
{%- endif -%} | ||
|
||
{% endblock %} | ||
|
||
{% block tail %} | ||
{%- if modal -%} | ||
<script> | ||
// fixes "remote modal shows same content every time", avoiding the flicker | ||
$('body').on('hidden.bs.modal', '.modal', function() { | ||
$(this).removeData('bs.modal').find(".modal-content").empty(); | ||
}); | ||
</script> | ||
{%- endif -%} | ||
{% block header %}<h3>{{ header_text }}</h3>{% endblock %} | ||
{{ lib.render_form(form, dir_url) }} | ||
{% endblock %} |
17 changes: 17 additions & 0 deletions
17
flask_admin/templates/bootstrap3/admin/file/modals/form.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% import 'admin/static.html' as admin_static with context %} | ||
{% import 'admin/lib.html' as lib with context %} | ||
|
||
{% block body %} | ||
{# content added to modal-content #} | ||
<div class="modal-header"> | ||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> | ||
{% block header %}<h3>{{ header_text }}</h3>{% endblock %} | ||
</div> | ||
<div class="modal-body"> | ||
{{ lib.render_form(form, dir_url, action=request.url, is_modal=True) }} | ||
</div> | ||
{% endblock %} | ||
|
||
{% block tail %} | ||
<script src="{{ admin_static.url(filename='admin/js/bs3_modal.js', v='1.0.0') }}"></script> | ||
{% endblock %} |
This file was deleted.
Oops, something went wrong.