Skip to content

Commit

Permalink
Merge pull request #31 from hotosm/feat/ind-rfp-and-volunteer
Browse files Browse the repository at this point in the history
individual rfp and volunteer opportunity pages
  • Loading branch information
luminaryFlowers authored Jul 16, 2024
2 parents 7b1f0d4 + 04fc652 commit dac0756
Show file tree
Hide file tree
Showing 25 changed files with 491 additions and 5 deletions.
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'),
),
]
5 changes: 1 addition & 4 deletions app/news/templates/news/individual_news_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ <h1>{{ page.title }}</h1>
<p>
{{page.get_parent.specific.authors_posted_by_text}}
{% for author in page.authors %}
<a href="{{author.value.url}}"><b class="text-black">{{author.value.title}}</b></a>
{% if not forloop.last %}
,
{% endif %}
<a href="{{author.value.url}}"><b class="text-black">{{author.value.title}}</b></a>{% if not forloop.last %}, {% endif %}
{% endfor %}
{{page.get_parent.specific.authors_posted_on_text}} {{ page.date }}
</p>
Expand Down
Empty file added app/rfp/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions app/rfp/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions app/rfp/apps.py
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'
59 changes: 59 additions & 0 deletions app/rfp/migrations/0001_initial.py
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',),
),
]
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 added app/rfp/migrations/__init__.py
Empty file.
84 changes: 84 additions & 0 deletions app/rfp/models.py
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"),
]
11 changes: 11 additions & 0 deletions app/rfp/templates/rfp/components/SidebarSection.html
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 app/rfp/templates/rfp/individual_request_for_proposal_page.html
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 %}
3 changes: 3 additions & 0 deletions app/rfp/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
3 changes: 3 additions & 0 deletions app/rfp/views.py
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.
3 changes: 3 additions & 0 deletions app/volunteer_opportunities/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
6 changes: 6 additions & 0 deletions app/volunteer_opportunities/apps.py
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'
51 changes: 51 additions & 0 deletions app/volunteer_opportunities/migrations/0001_initial.py
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.
Loading

0 comments on commit dac0756

Please sign in to comment.