Skip to content

Commit dac0756

Browse files
Merge pull request #31 from hotosm/feat/ind-rfp-and-volunteer
individual rfp and volunteer opportunity pages
2 parents 7b1f0d4 + 04fc652 commit dac0756

25 files changed

+491
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Generated by Django 4.2.7 on 2024-07-15 17:03
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('members', '0012_membergroupownerpage_view_all_text'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='membergroupownerpage',
15+
name='sort_by_titlea',
16+
field=models.CharField(default='Sort by Name Alphabetical'),
17+
),
18+
migrations.AlterField(
19+
model_name='membergroupownerpage',
20+
name='sort_by_titlez',
21+
field=models.CharField(default='Sort by Name Reverse Alphabetical'),
22+
),
23+
]

app/news/templates/news/individual_news_page.html

+1-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ <h1>{{ page.title }}</h1>
1717
<p>
1818
{{page.get_parent.specific.authors_posted_by_text}}
1919
{% for author in page.authors %}
20-
<a href="{{author.value.url}}"><b class="text-black">{{author.value.title}}</b></a>
21-
{% if not forloop.last %}
22-
,
23-
{% endif %}
20+
<a href="{{author.value.url}}"><b class="text-black">{{author.value.title}}</b></a>{% if not forloop.last %}, {% endif %}
2421
{% endfor %}
2522
{{page.get_parent.specific.authors_posted_on_text}} {{ page.date }}
2623
</p>

app/rfp/__init__.py

Whitespace-only changes.

app/rfp/admin.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.

app/rfp/apps.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class RfpConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'app.rfp'

app/rfp/migrations/0001_initial.py

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Generated by Django 4.2.7 on 2024-07-15 20:55
2+
3+
from django.db import migrations, models
4+
import django.db.models.deletion
5+
import wagtail.blocks
6+
import wagtail.fields
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
initial = True
12+
13+
dependencies = [
14+
('wagtailcore', '0089_log_entry_data_json_null_to_object'),
15+
]
16+
17+
operations = [
18+
migrations.CreateModel(
19+
name='IndividualRequestForProposalPage',
20+
fields=[
21+
('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')),
22+
('posters', wagtail.fields.StreamField([('poster', wagtail.blocks.PageChooserBlock(page_type=['members.IndividualMemberPage']))], blank=True, null=True, use_json_field=True)),
23+
('intro', wagtail.fields.RichTextField(blank=True)),
24+
('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)),
25+
('role', models.CharField(blank=True)),
26+
('application_close_date', models.DateField(blank=True)),
27+
('project_duration', models.CharField(blank=True)),
28+
('work_location', models.CharField(blank=True)),
29+
('contract_type', models.CharField(blank=True)),
30+
('direct_contact', models.CharField(blank=True)),
31+
('submission_email', models.EmailField(blank=True, max_length=254)),
32+
],
33+
options={
34+
'abstract': False,
35+
},
36+
bases=('wagtailcore.page',),
37+
),
38+
migrations.CreateModel(
39+
name='RequestForProposalOwnerPage',
40+
fields=[
41+
('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')),
42+
('posted_by_prefix_text', models.CharField(default='Posted by')),
43+
('terms_of_reference_title', models.CharField(default='Terms of Reference')),
44+
('role_title', models.CharField(default='Role:')),
45+
('application_close_title', models.CharField(default='Application Close Date:')),
46+
('project_duration_title', models.CharField(default='Duration of Project:')),
47+
('work_location_title', models.CharField(default='Work Location:')),
48+
('contract_type_title', models.CharField(default='Type of Contract:')),
49+
('direct_contact_title', models.CharField(default='Direct Contact:')),
50+
('cta_title', models.CharField(blank=True)),
51+
('submission_email_button', models.CharField(default='Submission Email')),
52+
('go_back_text', models.CharField(default='Go Back to Request for Proposals')),
53+
],
54+
options={
55+
'abstract': False,
56+
},
57+
bases=('wagtailcore.page',),
58+
),
59+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Generated by Django 4.2.7 on 2024-07-15 20:59
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('rfp', '0001_initial'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='individualrequestforproposalpage',
15+
name='post_date',
16+
field=models.DateField(blank=True, null=True),
17+
),
18+
migrations.AlterField(
19+
model_name='individualrequestforproposalpage',
20+
name='application_close_date',
21+
field=models.DateField(blank=True, null=True),
22+
),
23+
]

app/rfp/migrations/__init__.py

Whitespace-only changes.

app/rfp/models.py

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
from django.db import models
2+
3+
from wagtail.admin.panels import FieldPanel, MultiFieldPanel
4+
from wagtail.fields import RichTextField, StreamField
5+
from wagtail.blocks import CharBlock, StreamBlock, StructBlock, URLBlock, RichTextBlock, PageChooserBlock
6+
from wagtail.models import Page
7+
8+
9+
class RequestForProposalOwnerPage(Page):
10+
subpage_types = [
11+
'rfp.IndividualRequestForProposalPage'
12+
]
13+
14+
max_count = 1
15+
16+
posted_by_prefix_text = models.CharField(default="Posted by")
17+
18+
terms_of_reference_title = models.CharField(default="Terms of Reference")
19+
role_title = models.CharField(default="Role:")
20+
application_close_title = models.CharField(default="Application Close Date:")
21+
project_duration_title = models.CharField(default="Duration of Project:")
22+
work_location_title = models.CharField(default="Work Location:")
23+
contract_type_title = models.CharField(default="Type of Contract:")
24+
direct_contact_title = models.CharField(default="Direct Contact:")
25+
cta_title = models.CharField(blank=True)
26+
submission_email_button = models.CharField(default="Submission Email")
27+
28+
go_back_text = models.CharField(default="Go Back to Request for Proposals")
29+
30+
content_panels = Page.content_panels + [
31+
FieldPanel('posted_by_prefix_text'),
32+
MultiFieldPanel([
33+
FieldPanel('terms_of_reference_title'),
34+
FieldPanel('role_title'),
35+
FieldPanel('application_close_title'),
36+
FieldPanel('project_duration_title'),
37+
FieldPanel('work_location_title'),
38+
FieldPanel('contract_type_title'),
39+
FieldPanel('direct_contact_title'),
40+
FieldPanel('cta_title'),
41+
FieldPanel('submission_email_button'),
42+
], heading="Sidebar"),
43+
FieldPanel('go_back_text'),
44+
]
45+
46+
47+
class IndividualRequestForProposalPage(Page):
48+
parent_page_type = [
49+
'rfp.RequestForProposalOwnerPage'
50+
]
51+
52+
posters = StreamField([('poster', PageChooserBlock(page_type="members.IndividualMemberPage"))], use_json_field=True, null=True, blank=True)
53+
post_date = models.DateField(blank=True, null=True)
54+
55+
intro = RichTextField(blank=True)
56+
article_body = StreamField([
57+
('text_block', RichTextBlock(features=[
58+
'h1', 'h2', 'h3', 'h4', 'bold', 'italic', 'link', 'ol', 'ul', 'hr', 'document-link', 'image', 'embed', 'code', 'blockquote'
59+
]))
60+
], use_json_field=True, null=True, blank=True)
61+
62+
role = models.CharField(blank=True)
63+
application_close_date = models.DateField(blank=True, null=True)
64+
project_duration = models.CharField(blank=True)
65+
work_location = models.CharField(blank=True)
66+
contract_type = models.CharField(blank=True)
67+
direct_contact = models.CharField(blank=True)
68+
submission_email = models.EmailField(blank=True)
69+
70+
content_panels = Page.content_panels + [
71+
FieldPanel('posters'),
72+
FieldPanel('post_date'),
73+
FieldPanel('intro'),
74+
FieldPanel('article_body'),
75+
MultiFieldPanel([
76+
FieldPanel('role'),
77+
FieldPanel('application_close_date'),
78+
FieldPanel('project_duration'),
79+
FieldPanel('work_location'),
80+
FieldPanel('contract_type'),
81+
FieldPanel('direct_contact'),
82+
FieldPanel('submission_email'),
83+
], heading="Sidebar"),
84+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<div class="text-intro">
2+
{% if not no_divider %}
3+
<hr />
4+
{% endif %}
5+
<h2 class="font-bold mb-2">
6+
{{ title }}
7+
</h2>
8+
<p>
9+
{{ text }}
10+
</p>
11+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{% extends "base.html" %}
2+
{% load static %}
3+
{% load wagtailcore_tags %}
4+
{% load wagtailimages_tags %}
5+
{% load compress %}
6+
{% block body_class %}template-individualrequestforproposalpage{% endblock %}
7+
{% block extra_css %}
8+
{% compress css %}
9+
{% endcompress css %}
10+
{% endblock extra_css %}
11+
12+
{% block content %}
13+
<div class="max-w-7xl mx-auto">
14+
{% comment %} HEADER {% endcomment %}
15+
<div class="base-article px-6 md:px-10 py-5">
16+
<h1>{{ page.title }} </h1>
17+
<p>
18+
{{page.get_parent.specific.posted_by_prefix_text}}
19+
{% for poster in page.posters %}
20+
<a href="{{poster.value.url}}"><b class="text-black">{{poster.value.title}}</b></a>{% if not forloop.last %}, {% endif %}
21+
{% endfor %}
22+
<span class="text-hot-red"></span>{{ page.post_date }}
23+
</p>
24+
</div>
25+
26+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-12 px-6 md:px-10">
27+
{% comment %} BODY {% endcomment %}
28+
<div class="py-5 col-span-2 base-article-m">
29+
<div class="text-intro font-medium mb-4">
30+
{{ page.intro|safe }}
31+
</div>
32+
{{ page.article_body }}
33+
</div>
34+
35+
{% comment %} SIDEBAR {% endcomment %}
36+
<div class="py-5 sidebar [&>div]:my-12 [&_div:first-child_hr]:hidden [&_hr]:mb-8 md:w-1/2 lg:w-auto">
37+
<div>
38+
<h1 class="text-h2 font-bold">
39+
{{ page.get_parent.specific.terms_of_reference_title }}
40+
</h1>
41+
</div>
42+
43+
{% include "./components/SidebarSection.html" with title=page.get_parent.specific.role_title text=page.role no_divider=True %}
44+
{% include "./components/SidebarSection.html" with title=page.get_parent.specific.application_close_title text=page.application_close_date %}
45+
{% include "./components/SidebarSection.html" with title=page.get_parent.specific.project_duration_title text=page.project_duration %}
46+
{% include "./components/SidebarSection.html" with title=page.get_parent.specific.work_location_title text=page.work_location %}
47+
{% include "./components/SidebarSection.html" with title=page.get_parent.specific.contract_type_title text=page.contract_type %}
48+
{% include "./components/SidebarSection.html" with title=page.get_parent.specific.direct_contact_title text=page.direct_contact %}
49+
50+
<div class="bg-hot-off-white p-6">
51+
<h1 class="text-h2 font-bold mb-6">
52+
{{page.get_parent.specific.cta_title}}
53+
</h1>
54+
<a href="mailto:{{page.submission_email}}">
55+
{% include "components/branded_elements/button.html" with text=page.get_parent.specific.submission_email_button %}
56+
</a>
57+
</div>
58+
</div>
59+
</div>
60+
61+
<div class="px-6 md:px-10mt-10 mb-20">
62+
<p class="text-intro">
63+
{% include "ui/components/BaseLink.html" with linktext=page.get_parent.specific.go_back_text linkurl=page.get_parent.url %}
64+
</p>
65+
</div>
66+
</div>
67+
{% endblock %}

app/rfp/tests.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.test import TestCase
2+
3+
# Create your tests here.

app/rfp/views.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.shortcuts import render
2+
3+
# Create your views here.

app/volunteer_opportunities/__init__.py

Whitespace-only changes.

app/volunteer_opportunities/admin.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.

app/volunteer_opportunities/apps.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class VolunteerOpportunitiesConfig(AppConfig):
5+
default_auto_field = 'django.db.models.BigAutoField'
6+
name = 'app.volunteer_opportunities'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Generated by Django 4.2.7 on 2024-07-15 18:06
2+
3+
from django.db import migrations, models
4+
import django.db.models.deletion
5+
import wagtail.blocks
6+
import wagtail.fields
7+
8+
9+
class Migration(migrations.Migration):
10+
11+
initial = True
12+
13+
dependencies = [
14+
('wagtailcore', '0089_log_entry_data_json_null_to_object'),
15+
]
16+
17+
operations = [
18+
migrations.CreateModel(
19+
name='IndividualVolunteerOpportunityPage',
20+
fields=[
21+
('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')),
22+
('posters', wagtail.fields.StreamField([('poster', wagtail.blocks.PageChooserBlock(page_type=['members.IndividualMemberPage']))], blank=True, null=True, use_json_field=True)),
23+
('intro', wagtail.fields.RichTextField(blank=True)),
24+
('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)),
25+
('contact_description', wagtail.fields.RichTextField(blank=True)),
26+
('application_description', wagtail.fields.RichTextField(blank=True)),
27+
('application_date', models.DateField()),
28+
('location_text', models.CharField(blank=True)),
29+
],
30+
options={
31+
'abstract': False,
32+
},
33+
bases=('wagtailcore.page',),
34+
),
35+
migrations.CreateModel(
36+
name='VolunteerOpportunityOwnerPage',
37+
fields=[
38+
('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')),
39+
('posted_by_prefix_text', models.CharField(default='Posted by')),
40+
('contact_title', models.CharField(default='Contact')),
41+
('application_date_title', models.CharField(default='Application Date')),
42+
('location_title', models.CharField(default='Location')),
43+
('share_text', models.CharField(default='Share')),
44+
('go_back_text', models.CharField(default='Go Back to Volunteer Opportunities')),
45+
],
46+
options={
47+
'abstract': False,
48+
},
49+
bases=('wagtailcore.page',),
50+
),
51+
]

app/volunteer_opportunities/migrations/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)