Skip to content
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

Social share #90

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions REQUIREMENTS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Django==4.2.8
django-appconf==1.0.3
django-extensions==3.1.5
django-imagekit==5.0.0
django-social-share==2.3.0
django-tinymce==3.6.1
django-user-visit==0.5.1
django-webpack-loader==2.0.1
Expand Down
21 changes: 21 additions & 0 deletions qgisfeedproject/qgisfeed/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from .languages import LANGUAGES
from django.utils import timezone
from django.contrib.auth.models import User
import json

class HomePageFilterForm(forms.Form):
"""
Expand Down Expand Up @@ -165,3 +166,23 @@ def get_approvers_choices(self):
email__isnull=False
).exclude(email='') if u.has_perm("qgisfeed.publish_qgisfeedentry")
)


class ReadOnlyFeedItemForm(forms.ModelForm):
class Meta:
model = QgisFeedEntry
fields = ['spatial_filter']

def __init__(self, *args, **kwargs):
super(ReadOnlyFeedItemForm, self).__init__(*args, **kwargs)
self.fields['spatial_filter'].widget = MapWidget(attrs={
'geom_type': 'Polygon',
'default_lat': 0,
'default_lon': 0,
'default_zoom': 2,
'map_options': json.dumps({
'editable': False,
'readonly': True,
'draggable': False,
})
})
Loading
Loading