Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
flask-admin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
flask-admin
Commits
0e0dd4e8
Commit
0e0dd4e8
authored
Mar 20, 2012
by
Serge S. Koval
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documentation fixes.
parent
1e0c4211
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
8 deletions
+17
-8
TODO.txt
TODO.txt
+1
-0
quickstart.rst
doc/quickstart.rst
+9
-1
master.html
flask_adminex/templates/admin/master.html
+3
-3
list.html
flask_adminex/templates/admin/model/list.html
+4
-4
No files found.
TODO.txt
View file @
0e0dd4e8
- Core
- Core
- Right-side menu items (auth?)
- Pregenerate URLs for menu
- Pregenerate URLs for menu
- Model Admin
- Model Admin
- Ability to sort by fields that are not visible?
- Ability to sort by fields that are not visible?
...
...
doc/quickstart.rst
View file @
0e0dd4e8
...
@@ -47,9 +47,15 @@ You must create `Admin` class and associate it with the `Flask` application::
...
@@ -47,9 +47,15 @@ You must create `Admin` class and associate it with the `Flask` application::
app.run()
app.run()
If you will run this application and will navigate to `http://localhost:5000/admin/ <http://localhost:5000/admin/`_,
If you will run this application and will navigate to `http://localhost:5000/admin/ <http://localhost:5000/admin/
>
`_,
you should see lonely Home page with a navigation bar on top.
you should see lonely Home page with a navigation bar on top.
You can change application name by passing `name` parameter to the `Admin` class constructor::
admin = Admin(name='My App')
admin.setup_app(app)
Adding first view
Adding first view
-----------------
-----------------
...
@@ -182,6 +188,8 @@ you can do something like this::
...
@@ -182,6 +188,8 @@ you can do something like this::
It is very easy to add support for different database backends (Mongo, etc) by inheriting from `BaseModelView`
It is very easy to add support for different database backends (Mongo, etc) by inheriting from `BaseModelView`
class and implementing database-related methods.
class and implementing database-related methods.
Please refer to documentation on how to customize behavior of model-based administrative views.
Examples
Examples
--------
--------
...
...
flask_adminex/templates/admin/master.html
View file @
0e0dd4e8
...
@@ -26,11 +26,11 @@
...
@@ -26,11 +26,11 @@
{% if item.is_category() %}
{% if item.is_category() %}
{% set children = item.get_children() %}
{% set children = item.get_children() %}
{% if children %}
{% if children %}
{% if item.is_active(view) %}
<li
class=
"active dropdown"
>
{% else %}
<li
class=
"dropdown"
>
{% endif %}
{% if item.is_active(
admin_
view) %}
<li
class=
"active dropdown"
>
{% else %}
<li
class=
"dropdown"
>
{% endif %}
<a
class=
"dropdown-toggle"
data-toggle=
"dropdown"
href=
"#"
>
{{ item.name }}
<b
class=
"caret"
></b></a>
<a
class=
"dropdown-toggle"
data-toggle=
"dropdown"
href=
"#"
>
{{ item.name }}
<b
class=
"caret"
></b></a>
<ul
class=
"dropdown-menu"
>
<ul
class=
"dropdown-menu"
>
{% for child in children %}
{% for child in children %}
{% if child.is_active(view) %}
<li
class=
"active"
>
{% else %}
<li>
{% endif %}
{% if child.is_active(
admin_
view) %}
<li
class=
"active"
>
{% else %}
<li>
{% endif %}
<a
href=
"{{ child.get_url() }}"
>
{{ child.name }}
</a>
<a
href=
"{{ child.get_url() }}"
>
{{ child.name }}
</a>
</li>
</li>
{% endfor %}
{% endfor %}
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
{% endif %}
{% endif %}
{% else %}
{% else %}
{% if item.is_accessible() %}
{% if item.is_accessible() %}
{% if item.is_active(view) %}
<li
class=
"active"
>
{% else %}
<li>
{% endif %}
{% if item.is_active(
admin_
view) %}
<li
class=
"active"
>
{% else %}
<li>
{% endif %}
<a
href=
"{{ item.get_url() }}"
>
{{ item.name }}
</a>
<a
href=
"{{ item.get_url() }}"
>
{{ item.name }}
</a>
</li>
</li>
{% endif %}
{% endif %}
...
...
flask_adminex/templates/admin/model/list.html
View file @
0e0dd4e8
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
{% set column = 0 %}
{% set column = 0 %}
{% for c, name in list_columns %}
{% for c, name in list_columns %}
<th>
<th>
{% if admin_.is_sortable(c) %}
{% if admin_
view
.is_sortable(c) %}
{% if sort_column == column %}
{% if sort_column == column %}
<a
href=
"{{ sort_url(column, True) }}"
>
<a
href=
"{{ sort_url(column, True) }}"
>
{{ name }}
{{ name }}
...
@@ -33,12 +33,12 @@
...
@@ -33,12 +33,12 @@
{% for row in data %}
{% for row in data %}
<tr>
<tr>
<td>
<td>
{%- if admin_.can_edit -%}
{%- if admin_
view
.can_edit -%}
<a
href=
"{{ url_for('.edit_view', id=row.id, return=return_url) }}"
>
<a
href=
"{{ url_for('.edit_view', id=row.id, return=return_url) }}"
>
<i
class=
"icon-pencil"
></i>
<i
class=
"icon-pencil"
></i>
</a>
</a>
{%- endif -%}
{%- endif -%}
{%- if admin_.can_delete -%}
{%- if admin_
view
.can_delete -%}
<a
href=
"{{ url_for('.delete_view', id=row.id, return=return_url) }}"
onclick=
"return confirm('You sure you want to delete this item?')"
>
<a
href=
"{{ url_for('.delete_view', id=row.id, return=return_url) }}"
onclick=
"return confirm('You sure you want to delete this item?')"
>
<i
class=
"icon-remove"
></i>
<i
class=
"icon-remove"
></i>
</a>
</a>
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
{% endfor %}
{% endfor %}
</table>
</table>
{{ lib.pager(page, num_pages, pager_url) }}
{{ lib.pager(page, num_pages, pager_url) }}
{% if admin_.can_create %}
{% if admin_
view
.can_create %}
<a
class=
"btn btn-primary btn-large"
href=
"{{ url_for('.create_view', return=return_url) }}"
>
Create New
</a>
<a
class=
"btn btn-primary btn-large"
href=
"{{ url_for('.create_view', return=return_url) }}"
>
Create New
</a>
{% endif %}
{% endif %}
{% endblock %}
{% endblock %}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment