Skip to content

Commit 7c13b10

Browse files
committed
Sponsor brochure updates
1 parent 2e8497e commit 7c13b10

File tree

10 files changed

+85
-37
lines changed

10 files changed

+85
-37
lines changed

backend/api/conferences/types.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ def is_running(self, info: Info) -> bool:
378378

379379
@strawberry.field
380380
def sponsor_benefits(self) -> list[SponsorBenefit]:
381-
benefits = self.sponsor_benefits.all()
381+
benefits = self.sponsor_benefits.order_by("order").all()
382382

383383
return [
384384
SponsorBenefit(
@@ -391,9 +391,13 @@ def sponsor_benefits(self) -> list[SponsorBenefit]:
391391

392392
@strawberry.field
393393
def sponsor_levels(self) -> list[SponsorLevel]:
394-
levels = SponsorLevelModel.objects.filter(conference=self).prefetch_related(
395-
"sponsorlevelbenefit_set",
396-
"sponsorlevelbenefit_set__benefit",
394+
levels = (
395+
SponsorLevelModel.objects.filter(conference=self)
396+
.prefetch_related(
397+
"sponsorlevelbenefit_set",
398+
"sponsorlevelbenefit_set__benefit",
399+
)
400+
.order_by("order")
397401
)
398402

399403
return [
@@ -416,7 +420,7 @@ def sponsor_levels(self) -> list[SponsorLevel]:
416420

417421
@strawberry.field
418422
def sponsor_special_options(self) -> list[SponsorSpecialOption]:
419-
options = self.sponsor_special_options.all()
423+
options = self.sponsor_special_options.order_by("order").all()
420424

421425
return [
422426
SponsorSpecialOption(

backend/sponsors/admin.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ class SponsorAdmin(OrderedModelAdmin):
2222

2323

2424
@admin.register(SponsorBenefit)
25-
class SponsorBenefitAdmin(admin.ModelAdmin):
26-
list_display = ("name", "conference", "category")
27-
list_filter = ("category",)
25+
class SponsorBenefitAdmin(OrderedModelAdmin, admin.ModelAdmin):
26+
list_display = ("name", "conference", "category", "order", "move_up_down_links")
27+
list_filter = (
28+
"conference",
29+
"category",
30+
)
2831

2932

3033
class SponsorLevelBenefitInline(admin.TabularInline):
@@ -43,8 +46,8 @@ class SponsorLevelAdmin(OrderedModelAdmin):
4346

4447

4548
@admin.register(SponsorSpecialOption)
46-
class SponsorSpecialOptionAdmin(admin.ModelAdmin):
47-
list_display = ("name", "conference", "price")
49+
class SponsorSpecialOptionAdmin(OrderedModelAdmin, admin.ModelAdmin):
50+
list_display = ("name", "conference", "price", "move_up_down_links")
4851
list_filter = ("conference",)
4952

5053

backend/sponsors/management/commands/fill_sponsor_data.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,43 +25,43 @@ def handle(self, *args, **kwargs):
2525
levels = [
2626
{
2727
"name": "Keystone",
28-
"price": "€ 10,000",
28+
"price": 10_000,
2929
"slots": 1,
3030
"highlight_color": "blue",
3131
},
3232
{
3333
"name": "Gold",
34-
"price": "€ 7,000",
34+
"price": 7_000,
3535
"slots": 2,
3636
"highlight_color": "yellow",
3737
},
3838
{
3939
"name": "Silver",
40-
"price": "€ 5,000",
40+
"price": 5_000,
4141
"slots": 5,
4242
"highlight_color": "gray",
4343
},
4444
{
4545
"name": "Bronze",
46-
"price": "€ 3,000",
46+
"price": 3_000,
4747
"slots": 0,
4848
"highlight_color": "brown",
4949
},
5050
{
5151
"name": "Patron",
52-
"price": "€ 1,000",
52+
"price": 2_000,
5353
"slots": 0,
5454
"highlight_color": "purple",
5555
},
5656
{
5757
"name": "Startup",
58-
"price": "€ 500",
58+
"price": 500,
5959
"slots": 0,
6060
"highlight_color": "green",
6161
},
6262
{
6363
"name": "Diversity",
64-
"price": "€ 1,000",
64+
"price": 1_000,
6565
"slots": 0,
6666
"highlight_color": "pink",
6767
},
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Generated by Django 5.1.1 on 2024-11-09 18:30
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('sponsors', '0013_sponsorlevel_price_sponsorlevel_slots_and_more'),
10+
]
11+
12+
operations = [
13+
migrations.AlterModelOptions(
14+
name='sponsorbenefit',
15+
options={'ordering': ('order',), 'verbose_name': 'sponsor benefit', 'verbose_name_plural': 'sponsor benefits'},
16+
),
17+
migrations.AlterModelOptions(
18+
name='sponsorspecialoption',
19+
options={'ordering': ('order',), 'verbose_name': 'special option', 'verbose_name_plural': 'special options'},
20+
),
21+
migrations.AddField(
22+
model_name='sponsorbenefit',
23+
name='order',
24+
field=models.PositiveIntegerField(db_index=True, default=0, editable=False, verbose_name='order'),
25+
preserve_default=False,
26+
),
27+
migrations.AddField(
28+
model_name='sponsorspecialoption',
29+
name='order',
30+
field=models.PositiveIntegerField(db_index=True, default=0, editable=False, verbose_name='order'),
31+
preserve_default=False,
32+
),
33+
]

backend/sponsors/models.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,7 @@ class Meta(OrderedModel.Meta):
7171
unique_together = ["name", "conference"]
7272

7373

74-
class SponsorBenefit(TimeStampedModel):
75-
conference = models.ForeignKey(
76-
"conferences.Conference",
77-
on_delete=models.CASCADE,
78-
related_name="sponsor_benefits",
79-
)
80-
74+
class SponsorBenefit(OrderedModel, TimeStampedModel):
8175
class Category(models.TextChoices):
8276
CONTENT = "content", _("Sponsored Content")
8377
BOOTH = "booth", _("Booth")
@@ -86,11 +80,19 @@ class Category(models.TextChoices):
8680
RECRUITING = "recruiting", _("Recruiting")
8781
ATTENDEE_INTERACTION = "attendee_interaction", _("Attendee Interaction")
8882

83+
conference = models.ForeignKey(
84+
"conferences.Conference",
85+
on_delete=models.CASCADE,
86+
related_name="sponsor_benefits",
87+
)
88+
8989
name = I18nCharField(_("name"), max_length=100)
9090
category = models.CharField(_("category"), max_length=100, choices=Category.choices)
9191
description = I18nTextField(_("description"), blank=True)
9292

93-
class Meta:
93+
order_with_respect_to = "conference"
94+
95+
class Meta(OrderedModel.Meta):
9496
unique_together = ["name", "conference"]
9597
verbose_name = _("sponsor benefit")
9698
verbose_name_plural = _("sponsor benefits")
@@ -119,7 +121,7 @@ def __str__(self):
119121
return f"{self.sponsor_level} - {self.benefit} ({self.value})"
120122

121123

122-
class SponsorSpecialOption(models.Model):
124+
class SponsorSpecialOption(OrderedModel, models.Model):
123125
conference = models.ForeignKey(
124126
"conferences.Conference",
125127
on_delete=models.CASCADE,
@@ -128,8 +130,9 @@ class SponsorSpecialOption(models.Model):
128130
name = models.CharField(_("name"), max_length=255)
129131
description = models.TextField(_("description"))
130132
price = models.DecimalField(_("price"), max_digits=10, decimal_places=2)
133+
order_with_respect_to = "conference"
131134

132-
class Meta:
135+
class Meta(OrderedModel.Meta):
133136
verbose_name = _("special option")
134137
verbose_name_plural = _("special options")
135138
unique_together = ["name", "conference"]

frontend/src/components/brochure/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ export function Brochure({
5555
/>
5656
<OptionsPage
5757
options={conference.sponsorBenefits}
58-
title="Options"
58+
title="Services Details"
5959
background="bg-yellow"
6060
/>
6161
<OptionsPage
6262
options={conference.sponsorSpecialOptions}
63-
title="Special Options"
63+
title="Available Upgrades"
6464
background="bg-green"
6565
/>
6666
<TestimonialsPage testimonials={testimonials} />

frontend/src/components/brochure/options-page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import clsx from "clsx";
2+
import { humanizeText } from "./utils";
23

34
export const OptionsPage = ({
45
title,
@@ -17,7 +18,7 @@ export const OptionsPage = ({
1718
{options.map((option) => (
1819
<div key={option.name}>
1920
<dt className="font-bold break-after-avoid pt-[0.3cm]">
20-
{option.name}
21+
{humanizeText(option.name)}
2122
{option.price && (
2223
<span className="text-sm font-normal"> - {option.price}</span>
2324
)}

frontend/src/components/brochure/pricing-page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import clsx from "clsx";
2+
import { humanizeText } from "./utils";
23

34
export type Benefit = {
45
name: string;
@@ -35,7 +36,7 @@ const TableSection = ({
3536
return (
3637
<tr>
3738
<td className="uppercase font-bold text-coral px-[0.5cm] pt-[0.5cm] bg-cream">
38-
{title}
39+
{humanizeText(title)}
3940
</td>
4041
{new Array(totalPackages).fill(null).map((_, i) => (
4142
<td className={clsx("border-l", getBackgroundColor(i))} />
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const humanizeText = (text: string) => {
2+
return text.replace("_", " ").toLowerCase();
3+
};

frontend/src/pages/brochure/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ const testimonials = [
1717
];
1818

1919
const stats = {
20-
attendees: "800+",
20+
attendees: "1000+",
2121
speakers: "100+",
2222
talks: "100+",
2323
uniqueOnlineVisitors: "10000+",
2424
sponsorsAndPartners: "50+",
25-
grantsGiven: "10+",
26-
coffees: "1000+",
25+
grantsGiven: "15+",
26+
coffees: "10000+",
2727
};
2828

2929
const introduction = `
30-
**PyCon Italia** is the official Italian event about Python, but nowadays it's one of the most important pythonic events in all of Europe. More than 800 people gather from all over the world to attend, learn, code, speak, support, and meet other fellow pythonistas in Florence.
30+
**PyCon Italia** is the official Italian event about Python, but nowadays its one of the most important pythonic events in all of Europe. More than 1000 people gather from all over the world to attend, learn, code, speak, support, and meet other fellow pythonistas in Bologna.
3131
3232
Our care for the quality of every aspect of PyCon Italia results in a wonderful gathering for growing together.
3333
@@ -50,7 +50,7 @@ Bologna is one of the most charming cities of Italy, and we love it. Many of our
5050
5151
Included in the UNESCO Creative Cities Network as a City of Music, the historic center of Bologna is a treasure trove of art and architecture.
5252
53-
It has to be told that the PyCon Italia venue is located very close to the city center (10 minutes by walk) and many initiatives will be announced for sharing this treasure with our attendees.
53+
The PyCon Italia venue is located close to the city center (~25’ walk) and many initiatives will be announced for sharing this treasure with our attendees.
5454
`.trim(),
5555

5656
country: "Italy",
@@ -60,7 +60,7 @@ It has to be told that the PyCon Italia venue is located very close to the city
6060
"https://images.unsplash.com/photo-1671794646570-cba0e7dc162b?q=80&w=2670&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
6161
};
6262
const community = `
63-
PyCon Italia is aimed at everyone in the Python community, of all skill levels, both users and programmers. It is a great meeting event: ~800 attendees are expected from all over the world. Professionals, companies and students will meet for learning, collaborate and grow together. The delegates are a mix of Python users and developers (~60%), students (~20%), PMs (~8%), researchers (~7%), CTOs (~5%) as well as individuals whose businesses rely on the use of Python.
63+
PyCon Italia is aimed at everyone in the Python community, of all skill levels, both users and programmers. It is a great meeting event: ~1000attendees are expected from all over the world. Professionals, companies and students will meet for learning, collaborate and grow together. The delegates are a mix of Python users and developers (~60%), students (~20%), PMs (~8%), researchers (~7%), CTOs (~5%) as well as individuals whose businesses rely on the use of Python.
6464
`.trim();
6565

6666
const whySponsor = {

0 commit comments

Comments
 (0)