-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] add map to admin's change list (WIP - DO NOT MERGE) #124
base: master
Are you sure you want to change the base?
Conversation
@@ -55,3 +56,6 @@ class LeafletMap(self.widget): | |||
map_height = self.map_height | |||
display_raw = self.display_raw | |||
return LeafletMap | |||
|
|||
|
|||
change_list_template = 'leaflet/admin/change_list_geo.html' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a rather radical change, I would do another admin class instead, at least the time to stabilize the whole thing
@@ -0,0 +1,99 @@ | |||
{% extends 'admin/change_list.html' %} | |||
{% load leaflet_tags %} | |||
{% load admin_list_leaflet %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
This file "admin_list_leaflet" haven’t in the commit and templatetags. Where does it come from? I am interested in this feature, it’s a good idea.
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
I'm not sure anymore (didn't look at it for some time), maybe it was a mistake ? did you try to remove that line ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
96ea661
to
854ac59
Compare
f6487c7
to
0376c15
Compare
Hi,
This PR allows to display a map at top of admin's change list of LeafletGeoAdmins.
It's a quick draft and I'm new to Django, so it's not ready for merge and needs review.
Please let me know what you think.
Features
How it works
It works by setting LeafletGeoAdmin's
change_list_template
to a custom template which features a map before the list.The map knows which field to use to display the features thanks to a new
list_geom_field
parameter on LeafletGeoAdmin. By default, it's set to None, in which case no map is displayed.How to use
To do