Skip to content

Commit 7d6fa20

Browse files
Merge pull request #1495 from IFRCGo/develop
Fewer editor features, response-activity event search
2 parents 00e80e4 + 8d6ebc4 commit 7d6fa20

File tree

6 files changed

+43
-16
lines changed

6 files changed

+43
-16
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## Unreleased
88

9+
## 1.1.448
10+
11+
### Added
12+
- Fewer editor features on admin (sync with frontend)
13+
- Fix response-activity event search on 3w form
14+
915
## 1.1.447
1016
## 1.1.446
1117

@@ -2016,7 +2022,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
20162022

20172023
## 0.1.20
20182024

2019-
[Unreleased]: https://github.com/IFRCGo/go-api/compare/1.1.447...HEAD
2025+
[Unreleased]: https://github.com/IFRCGo/go-api/compare/1.1.448...HEAD
2026+
[1.1.448]: https://github.com/IFRCGo/go-api/compare/1.1.447...1.1.448
20202027
[1.1.447]: https://github.com/IFRCGo/go-api/compare/1.1.446...1.1.447
20212028
[1.1.446]: https://github.com/IFRCGo/go-api/compare/1.1.445...1.1.446
20222029
[1.1.445]: https://github.com/IFRCGo/go-api/compare/1.1.444...1.1.445

api/drf_views.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,10 @@ def get_queryset(self, *args, **kwargs):
389389
if self.action == 'mini_events':
390390
# return Event.objects.filter(parent_event__isnull=True).select_related('dtype')
391391
return qset.filter(parent_event__isnull=True).select_related('dtype')
392+
if self.action == 'response_activity_events':
393+
return qset.filter(parent_event__isnull=True).filter(
394+
Q(auto_generated=False) | Q(auto_generated_source='New field report')
395+
).select_related('dtype')
392396
return (
393397
# Event.objects.filter(parent_event__isnull=True)
394398
qset.filter(parent_event__isnull=True).select_related('dtype')
@@ -448,6 +452,10 @@ def retrieve(self, request, pk=None, *args, **kwargs):
448452
def mini_events(self, request):
449453
return super().list(request)
450454

455+
@action(methods=['get'], detail=False, url_path='response-activity')
456+
def response_activity_events(self, request):
457+
return super().list(request)
458+
451459

452460
class EventSnippetFilter(filters.FilterSet):
453461
event = filters.NumberFilter(field_name='event', lookup_expr='exact')

eap/migrations/0001_initial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class Migration(migrations.Migration):
7676
name='EarlyAction',
7777
fields=[
7878
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
79-
('sector', enumfields.fields.EnumIntegerField(enum=deployments.models.Sectors, verbose_name='sector')),
79+
('sector', models.IntegerField(choices=[(0, 'Shelter, Housing And Settlements'), (1, 'Livelihoods'), (2, 'Multi-purpose Cash'), (3, 'Health And Care'), (4, 'Water, Sanitation And Hygiene'), (5, 'Protection, Gender And Inclusion'), (6, 'Education'), (7, 'Migration'), (8, 'Risk Reduction, Climate Adaptation And Recovery'), (9, 'Community Engagement And Accountability'), (10, 'Environment Sustainability'), (11, 'Shelter Cluster Coordination')], verbose_name='sector')),
8080
('budget_per_sector', models.IntegerField(blank=True, null=True, verbose_name='Budget per sector (CHF)')),
8181
('prioritized_risk', models.TextField(blank=True, null=True, verbose_name='Prioritized risk')),
8282
('targeted_people', models.IntegerField(blank=True, null=True, verbose_name='Targeted people')),

eap/models.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from main.enums import TextChoices
66
from deployments.models import Sectors
7-
from enumfields import EnumIntegerField
7+
from main.enums import IntegerChoices
88
from api.models import (
99
Country,
1010
District,
@@ -32,7 +32,23 @@ def __str__(self):
3232

3333

3434
class EarlyAction(models.Model):
35-
sector = EnumIntegerField(Sectors, verbose_name=_('sector'))
35+
class Sector(IntegerChoices):
36+
SHELTER_HOUSING_AND_SETTLEMENTS = 0, _('Shelter, Housing And Settlements')
37+
LIVELIHOODS = 1, _('Livelihoods')
38+
MULTI_PURPOSE_CASH = 2, _('Multi-purpose Cash')
39+
HEALTH_AND_CARE = 3, _('Health And Care')
40+
WATER_SANITATION_AND_HYGIENE = 4, _('Water, Sanitation And Hygiene')
41+
PROTECTION_GENDER_AND_INCLUSION = 5, _('Protection, Gender And Inclusion')
42+
EDUCATION = 6, _('Education')
43+
MIGRATION = 7, _('Migration')
44+
RISK_REDUCTION_CLIMATE_ADAPTATION_AND_RECOVERY = \
45+
8, _('Risk Reduction, Climate Adaptation And Recovery')
46+
COMMUNITY_ENGAGEMENT_AND_ACCOUNTABILITY = \
47+
9, _('Community Engagement And Accountability')
48+
ENVIRONMENT_SUSTAINABILITY = 10, _('Environment Sustainability')
49+
SHELTER_CLUSTER_COORDINATION = 11, _('Shelter Cluster Coordination')
50+
51+
sector = models.IntegerField(choices=Sector.choices, verbose_name=_('sector'))
3652
budget_per_sector = models.IntegerField(verbose_name=_('Budget per sector (CHF)'), null=True, blank=True)
3753
indicators = models.ManyToManyField(EarlyActionIndicator, verbose_name=_('Indicators'), blank=True)
3854

main/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
from .celery import app as celery_app
44

55
__all__ = ['celery_app']
6-
__version__ = '1.1.447'
6+
__version__ = '1.1.448'

main/settings.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -265,27 +265,23 @@
265265
'selector': 'textarea',
266266
'theme': 'modern',
267267
'plugins': '''
268-
textcolor save link image media preview codesample contextmenu
269-
table code lists fullscreen insertdatetime nonbreaking
270-
contextmenu directionality searchreplace wordcount visualblocks
271-
visualchars code fullscreen autolink lists charmap print hr
272-
anchor pagebreak
268+
anchor autolink charmap code codesample contextmenu directionality
269+
fullscreen hr image insertdatetime link lists media nonbreaking
270+
pagebreak preview print save searchreplace table textcolor
271+
visualblocks visualchars
273272
''',
274273
'toolbar1': '''
275-
bold italic underline fontsizeselect
274+
bold italic underline superscript subscript fontsizeselect
276275
| forecolor | alignleft alignright | aligncenter alignjustify
277276
| indent outdent | bullist numlist |
278277
| link visualchars charmap hr nonbreaking | code preview fullscreen
279278
''',
280-
'toolbar2': '''
281-
media embed
282-
''',
283279
'force_p_newlines': True,
284280
'force_br_newlines': True,
285281
'forced_root_block': '',
286282
'contextmenu': 'formats | link',
287-
'menubar': True,
288-
'statusbar': True,
283+
'menubar': False,
284+
'statusbar': False,
289285
# https://www.tiny.cloud/docs/configure/content-filtering/#invalid_styles
290286
'invalid_styles': {
291287
'*': 'opacity' # Global invalid style

0 commit comments

Comments
 (0)