diff options
author | luxagraf <sng@luxagraf.net> | 2018-06-04 20:27:23 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2018-06-04 20:27:23 -0500 |
commit | 5a3d3d2e9d2ab67218144f7c2e35d70f47f9ad93 (patch) | |
tree | e57821443383b158e640d7afc8c2b40375c5c3cb /app/utils/widgets.py | |
parent | 8f4bbcbc391f318adb6eca5c538add126811feee (diff) |
converted jrnl entry to use image for featured image
Diffstat (limited to 'app/utils/widgets.py')
-rw-r--r-- | app/utils/widgets.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/utils/widgets.py b/app/utils/widgets.py index eac4631..2b76f6b 100644 --- a/app/utils/widgets.py +++ b/app/utils/widgets.py @@ -99,6 +99,11 @@ def thumbnail(image_path): return '<img style="max-width: 400px" src="%s" alt="%s" />' % (absolute_url, image_path) +class ImageRadioSelect(forms.RadioSelect): + template_name = 'horizontal_select.html' + + + class AdminImageWidget(AdminFileWidget): """ A FileField Widget that displays an image instead of a file path @@ -124,6 +129,7 @@ class LGEntryForm(forms.ModelForm): class Meta: widgets = { 'body_markdown': forms.Textarea(attrs={'rows': 40, 'cols': 100}), + 'featured_image': ImageRadioSelect, } @@ -132,6 +138,8 @@ class LGEntryFormSmall(forms.ModelForm): widgets = { 'body_markdown': forms.Textarea(attrs={'rows': 12, 'cols': 100}), } + + class OLAdminBase(OSMGeoAdmin): default_lon = -9285175 default_lat = 4025046 |