Skip to content

Commit

Permalink
rfps and opportunities that are expired will not show up, and they ca…
Browse files Browse the repository at this point in the history
…n also be made inactive
  • Loading branch information
luminaryFlowers committed Jul 17, 2024
1 parent e934706 commit 6251650
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.7 on 2024-07-17 17:26

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('rfp', '0004_requestforproposalownerpage_no_rfps_description_and_more'),
]

operations = [
migrations.AddField(
model_name='individualrequestforproposalpage',
name='is_active',
field=models.BooleanField(default=True),
),
]
5 changes: 5 additions & 0 deletions app/rfp/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.db import models
from django.utils import timezone

from wagtail.admin.panels import FieldPanel, MultiFieldPanel
from wagtail.fields import RichTextField, StreamField
Expand All @@ -11,6 +12,7 @@ def get_context(self, request, *args, **kwargs):
context = super().get_context(request, *args, **kwargs)

rfps = IndividualRequestForProposalPage.objects.live().filter(locale=context['page'].locale)
rfps = rfps.filter(application_close_date__gte=timezone.now().date(), is_active=True)

context['rfps'] = rfps
return context
Expand Down Expand Up @@ -113,6 +115,8 @@ class IndividualRequestForProposalPage(Page):
'rfp.RequestForProposalOwnerPage'
]

is_active = models.BooleanField(default=True)

posters = StreamField([('poster', PageChooserBlock(page_type="members.IndividualMemberPage"))], use_json_field=True, null=True, blank=True)
post_date = models.DateField(blank=True, null=True)

Expand All @@ -132,6 +136,7 @@ class IndividualRequestForProposalPage(Page):
submission_email = models.EmailField(blank=True)

content_panels = Page.content_panels + [
FieldPanel('is_active'),
FieldPanel('posters'),
FieldPanel('post_date'),
FieldPanel('intro'),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.7 on 2024-07-17 17:26

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('volunteer_opportunities', '0004_volunteeropportunityownerpage_no_opportunities_description_and_more'),
]

operations = [
migrations.AddField(
model_name='individualvolunteeropportunitypage',
name='is_active',
field=models.BooleanField(default=True),
),
]
5 changes: 5 additions & 0 deletions app/volunteer_opportunities/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.db import models
from django.utils import timezone

from wagtail.admin.panels import FieldPanel, MultiFieldPanel
from wagtail.fields import RichTextField, StreamField
Expand All @@ -11,6 +12,7 @@ def get_context(self, request, *args, **kwargs):
context = super().get_context(request, *args, **kwargs)

opportunities = IndividualVolunteerOpportunityPage.objects.live().filter(locale=context['page'].locale)
opportunities = opportunities.filter(application_date__gte=timezone.now().date(), is_active=True)

context['opportunities'] = opportunities
return context
Expand Down Expand Up @@ -110,6 +112,8 @@ class IndividualVolunteerOpportunityPage(Page):
'volunteer_opportunities.VolunteerOpportunityOwnerPage'
]

is_active = models.BooleanField(default=True)

posters = StreamField([('poster', PageChooserBlock(page_type="members.IndividualMemberPage"))], use_json_field=True, null=True, blank=True)

intro = RichTextField(blank=True)
Expand All @@ -125,6 +129,7 @@ class IndividualVolunteerOpportunityPage(Page):
location_text = models.CharField(blank=True)

content_panels = Page.content_panels + [
FieldPanel('is_active'),
FieldPanel('posters'),
FieldPanel('intro'),
FieldPanel('article_body'),
Expand Down

0 comments on commit 6251650

Please sign in to comment.