Skip to content

Commit

Permalink
Final big edit for index page.
Browse files Browse the repository at this point in the history
  • Loading branch information
petrus-jvrensburg committed Jul 4, 2015
1 parent e237119 commit a935d7a
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 127 deletions.
44 changes: 43 additions & 1 deletion doc/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,49 @@ And your classes could be made to use this template by setting the appropriate c

The three available properties are simply called `list_template`, `create_template` and `edit_template`.

If you want to use your own base template, then pass the name of the template to
the admin constructor during initialization::

admin = Admin(app, base_template='my_master.html')

Available Template Blocks
****************************

Flask-Admin defines one *base* template at `admin/master.html` that all the other admin templates are derived
from. This template is a proxy which points to `admin/base.html`, which defines
the following blocks:

============== ========================================================================
Block Name Description
============== ========================================================================
head_meta Page metadata in the header
title Page title
head_css Various CSS includes in the header
head Empty block in HTML head, in case you want to put something there
page_body Page layout
brand Logo in the menu bar
main_menu Main menu
menu_links Links menu
access_control Section to the right of the menu (can be used to add login/logout buttons)
messages Alerts and various messages
body Content (that's where your view will be displayed)
tail Empty area below content
============== ========================================================================

In addition to all of the blocks that are inherited from `admin/master.html`, the `admin/model/list.html` template
also contains the following blocks:

======================= ============================================
Block Name Description
======================= ============================================
model_menu_bar Menu bar
model_list_table Table container
list_header Table header row
list_row_actions_header Actions header
list_row Single row
list_row_actions Row action cell with edit/remove/etc buttons
empty_list_message Message that will be displayed if there are no models found
======================= ============================================

Replacing Individual Form Fields
------------------------------------------
Expand Down Expand Up @@ -695,6 +737,6 @@ Usage Tips
Initialisation: As an alternative to passing a Flask application object to the Admin constructor, you can also call the
:meth:`~flask_admin.base.Admin.init_app` function, after the Admin instance has been initialized::

admin = Admin(name='My App', template_mode='bootstrap3')
admin = Admin(name='microblog', template_mode='bootstrap3')
# Add views here
admin.init_app(app)
Loading

0 comments on commit a935d7a

Please sign in to comment.