-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from hotosm/feat/ind-rfp-and-volunteer
individual rfp and volunteer opportunity pages
- Loading branch information
Showing
25 changed files
with
491 additions
and
5 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
app/members/migrations/0013_alter_membergroupownerpage_sort_by_titlea_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 4.2.7 on 2024-07-15 17:03 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('members', '0012_membergroupownerpage_view_all_text'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='membergroupownerpage', | ||
name='sort_by_titlea', | ||
field=models.CharField(default='Sort by Name Alphabetical'), | ||
), | ||
migrations.AlterField( | ||
model_name='membergroupownerpage', | ||
name='sort_by_titlez', | ||
field=models.CharField(default='Sort by Name Reverse Alphabetical'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class RfpConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'app.rfp' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Generated by Django 4.2.7 on 2024-07-15 20:55 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import wagtail.blocks | ||
import wagtail.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
('wagtailcore', '0089_log_entry_data_json_null_to_object'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='IndividualRequestForProposalPage', | ||
fields=[ | ||
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')), | ||
('posters', wagtail.fields.StreamField([('poster', wagtail.blocks.PageChooserBlock(page_type=['members.IndividualMemberPage']))], blank=True, null=True, use_json_field=True)), | ||
('intro', wagtail.fields.RichTextField(blank=True)), | ||
('article_body', wagtail.fields.StreamField([('text_block', wagtail.blocks.RichTextBlock(features=['h1', 'h2', 'h3', 'h4', 'bold', 'italic', 'link', 'ol', 'ul', 'hr', 'document-link', 'image', 'embed', 'code', 'blockquote']))], blank=True, null=True, use_json_field=True)), | ||
('role', models.CharField(blank=True)), | ||
('application_close_date', models.DateField(blank=True)), | ||
('project_duration', models.CharField(blank=True)), | ||
('work_location', models.CharField(blank=True)), | ||
('contract_type', models.CharField(blank=True)), | ||
('direct_contact', models.CharField(blank=True)), | ||
('submission_email', models.EmailField(blank=True, max_length=254)), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
bases=('wagtailcore.page',), | ||
), | ||
migrations.CreateModel( | ||
name='RequestForProposalOwnerPage', | ||
fields=[ | ||
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')), | ||
('posted_by_prefix_text', models.CharField(default='Posted by')), | ||
('terms_of_reference_title', models.CharField(default='Terms of Reference')), | ||
('role_title', models.CharField(default='Role:')), | ||
('application_close_title', models.CharField(default='Application Close Date:')), | ||
('project_duration_title', models.CharField(default='Duration of Project:')), | ||
('work_location_title', models.CharField(default='Work Location:')), | ||
('contract_type_title', models.CharField(default='Type of Contract:')), | ||
('direct_contact_title', models.CharField(default='Direct Contact:')), | ||
('cta_title', models.CharField(blank=True)), | ||
('submission_email_button', models.CharField(default='Submission Email')), | ||
('go_back_text', models.CharField(default='Go Back to Request for Proposals')), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
bases=('wagtailcore.page',), | ||
), | ||
] |
23 changes: 23 additions & 0 deletions
23
app/rfp/migrations/0002_individualrequestforproposalpage_post_date_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 4.2.7 on 2024-07-15 20:59 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('rfp', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='individualrequestforproposalpage', | ||
name='post_date', | ||
field=models.DateField(blank=True, null=True), | ||
), | ||
migrations.AlterField( | ||
model_name='individualrequestforproposalpage', | ||
name='application_close_date', | ||
field=models.DateField(blank=True, null=True), | ||
), | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
from django.db import models | ||
|
||
from wagtail.admin.panels import FieldPanel, MultiFieldPanel | ||
from wagtail.fields import RichTextField, StreamField | ||
from wagtail.blocks import CharBlock, StreamBlock, StructBlock, URLBlock, RichTextBlock, PageChooserBlock | ||
from wagtail.models import Page | ||
|
||
|
||
class RequestForProposalOwnerPage(Page): | ||
subpage_types = [ | ||
'rfp.IndividualRequestForProposalPage' | ||
] | ||
|
||
max_count = 1 | ||
|
||
posted_by_prefix_text = models.CharField(default="Posted by") | ||
|
||
terms_of_reference_title = models.CharField(default="Terms of Reference") | ||
role_title = models.CharField(default="Role:") | ||
application_close_title = models.CharField(default="Application Close Date:") | ||
project_duration_title = models.CharField(default="Duration of Project:") | ||
work_location_title = models.CharField(default="Work Location:") | ||
contract_type_title = models.CharField(default="Type of Contract:") | ||
direct_contact_title = models.CharField(default="Direct Contact:") | ||
cta_title = models.CharField(blank=True) | ||
submission_email_button = models.CharField(default="Submission Email") | ||
|
||
go_back_text = models.CharField(default="Go Back to Request for Proposals") | ||
|
||
content_panels = Page.content_panels + [ | ||
FieldPanel('posted_by_prefix_text'), | ||
MultiFieldPanel([ | ||
FieldPanel('terms_of_reference_title'), | ||
FieldPanel('role_title'), | ||
FieldPanel('application_close_title'), | ||
FieldPanel('project_duration_title'), | ||
FieldPanel('work_location_title'), | ||
FieldPanel('contract_type_title'), | ||
FieldPanel('direct_contact_title'), | ||
FieldPanel('cta_title'), | ||
FieldPanel('submission_email_button'), | ||
], heading="Sidebar"), | ||
FieldPanel('go_back_text'), | ||
] | ||
|
||
|
||
class IndividualRequestForProposalPage(Page): | ||
parent_page_type = [ | ||
'rfp.RequestForProposalOwnerPage' | ||
] | ||
|
||
posters = StreamField([('poster', PageChooserBlock(page_type="members.IndividualMemberPage"))], use_json_field=True, null=True, blank=True) | ||
post_date = models.DateField(blank=True, null=True) | ||
|
||
intro = RichTextField(blank=True) | ||
article_body = StreamField([ | ||
('text_block', RichTextBlock(features=[ | ||
'h1', 'h2', 'h3', 'h4', 'bold', 'italic', 'link', 'ol', 'ul', 'hr', 'document-link', 'image', 'embed', 'code', 'blockquote' | ||
])) | ||
], use_json_field=True, null=True, blank=True) | ||
|
||
role = models.CharField(blank=True) | ||
application_close_date = models.DateField(blank=True, null=True) | ||
project_duration = models.CharField(blank=True) | ||
work_location = models.CharField(blank=True) | ||
contract_type = models.CharField(blank=True) | ||
direct_contact = models.CharField(blank=True) | ||
submission_email = models.EmailField(blank=True) | ||
|
||
content_panels = Page.content_panels + [ | ||
FieldPanel('posters'), | ||
FieldPanel('post_date'), | ||
FieldPanel('intro'), | ||
FieldPanel('article_body'), | ||
MultiFieldPanel([ | ||
FieldPanel('role'), | ||
FieldPanel('application_close_date'), | ||
FieldPanel('project_duration'), | ||
FieldPanel('work_location'), | ||
FieldPanel('contract_type'), | ||
FieldPanel('direct_contact'), | ||
FieldPanel('submission_email'), | ||
], heading="Sidebar"), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<div class="text-intro"> | ||
{% if not no_divider %} | ||
<hr /> | ||
{% endif %} | ||
<h2 class="font-bold mb-2"> | ||
{{ title }} | ||
</h2> | ||
<p> | ||
{{ text }} | ||
</p> | ||
</div> |
67 changes: 67 additions & 0 deletions
67
app/rfp/templates/rfp/individual_request_for_proposal_page.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{% extends "base.html" %} | ||
{% load static %} | ||
{% load wagtailcore_tags %} | ||
{% load wagtailimages_tags %} | ||
{% load compress %} | ||
{% block body_class %}template-individualrequestforproposalpage{% endblock %} | ||
{% block extra_css %} | ||
{% compress css %} | ||
{% endcompress css %} | ||
{% endblock extra_css %} | ||
|
||
{% block content %} | ||
<div class="max-w-7xl mx-auto"> | ||
{% comment %} HEADER {% endcomment %} | ||
<div class="base-article px-6 md:px-10 py-5"> | ||
<h1>{{ page.title }} </h1> | ||
<p> | ||
{{page.get_parent.specific.posted_by_prefix_text}} | ||
{% for poster in page.posters %} | ||
<a href="{{poster.value.url}}"><b class="text-black">{{poster.value.title}}</b></a>{% if not forloop.last %}, {% endif %} | ||
{% endfor %} | ||
<span class="text-hot-red"> • </span>{{ page.post_date }} | ||
</p> | ||
</div> | ||
|
||
<div class="grid grid-cols-1 lg:grid-cols-3 gap-12 px-6 md:px-10"> | ||
{% comment %} BODY {% endcomment %} | ||
<div class="py-5 col-span-2 base-article-m"> | ||
<div class="text-intro font-medium mb-4"> | ||
{{ page.intro|safe }} | ||
</div> | ||
{{ page.article_body }} | ||
</div> | ||
|
||
{% comment %} SIDEBAR {% endcomment %} | ||
<div class="py-5 sidebar [&>div]:my-12 [&_div:first-child_hr]:hidden [&_hr]:mb-8 md:w-1/2 lg:w-auto"> | ||
<div> | ||
<h1 class="text-h2 font-bold"> | ||
{{ page.get_parent.specific.terms_of_reference_title }} | ||
</h1> | ||
</div> | ||
|
||
{% include "./components/SidebarSection.html" with title=page.get_parent.specific.role_title text=page.role no_divider=True %} | ||
{% include "./components/SidebarSection.html" with title=page.get_parent.specific.application_close_title text=page.application_close_date %} | ||
{% include "./components/SidebarSection.html" with title=page.get_parent.specific.project_duration_title text=page.project_duration %} | ||
{% include "./components/SidebarSection.html" with title=page.get_parent.specific.work_location_title text=page.work_location %} | ||
{% include "./components/SidebarSection.html" with title=page.get_parent.specific.contract_type_title text=page.contract_type %} | ||
{% include "./components/SidebarSection.html" with title=page.get_parent.specific.direct_contact_title text=page.direct_contact %} | ||
|
||
<div class="bg-hot-off-white p-6"> | ||
<h1 class="text-h2 font-bold mb-6"> | ||
{{page.get_parent.specific.cta_title}} | ||
</h1> | ||
<a href="mailto:{{page.submission_email}}"> | ||
{% include "components/branded_elements/button.html" with text=page.get_parent.specific.submission_email_button %} | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="px-6 md:px-10mt-10 mb-20"> | ||
<p class="text-intro"> | ||
{% include "ui/components/BaseLink.html" with linktext=page.get_parent.specific.go_back_text linkurl=page.get_parent.url %} | ||
</p> | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.shortcuts import render | ||
|
||
# Create your views here. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class VolunteerOpportunitiesConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'app.volunteer_opportunities' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Generated by Django 4.2.7 on 2024-07-15 18:06 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import wagtail.blocks | ||
import wagtail.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
('wagtailcore', '0089_log_entry_data_json_null_to_object'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='IndividualVolunteerOpportunityPage', | ||
fields=[ | ||
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')), | ||
('posters', wagtail.fields.StreamField([('poster', wagtail.blocks.PageChooserBlock(page_type=['members.IndividualMemberPage']))], blank=True, null=True, use_json_field=True)), | ||
('intro', wagtail.fields.RichTextField(blank=True)), | ||
('article_body', wagtail.fields.StreamField([('text_block', wagtail.blocks.RichTextBlock(features=['h1', 'h2', 'h3', 'h4', 'bold', 'italic', 'link', 'ol', 'ul', 'hr', 'document-link', 'image', 'embed', 'code', 'blockquote']))], blank=True, null=True, use_json_field=True)), | ||
('contact_description', wagtail.fields.RichTextField(blank=True)), | ||
('application_description', wagtail.fields.RichTextField(blank=True)), | ||
('application_date', models.DateField()), | ||
('location_text', models.CharField(blank=True)), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
bases=('wagtailcore.page',), | ||
), | ||
migrations.CreateModel( | ||
name='VolunteerOpportunityOwnerPage', | ||
fields=[ | ||
('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')), | ||
('posted_by_prefix_text', models.CharField(default='Posted by')), | ||
('contact_title', models.CharField(default='Contact')), | ||
('application_date_title', models.CharField(default='Application Date')), | ||
('location_title', models.CharField(default='Location')), | ||
('share_text', models.CharField(default='Share')), | ||
('go_back_text', models.CharField(default='Go Back to Volunteer Opportunities')), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
bases=('wagtailcore.page',), | ||
), | ||
] |
Empty file.
Oops, something went wrong.