add support for hiding venues from /lokaler
This commit is contained in:
@ -0,0 +1,23 @@
|
|||||||
|
# Generated by Django 5.0.7 on 2024-08-09 17:18
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('venues', '0023_alter_venuepage_images'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='venuepage',
|
||||||
|
name='show_in_overview',
|
||||||
|
field=models.BooleanField(default=True, help_text='Skal lokalet vises i oversikten over lokaler på undersiden /lokaler?'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='venuepage',
|
||||||
|
name='show_as_bookable',
|
||||||
|
field=models.BooleanField(default=True, help_text='Skal lokalet vises i oversikten over lokaler som leies ut?'),
|
||||||
|
),
|
||||||
|
]
|
@ -85,7 +85,11 @@ class VenuePage(WPImportedPageMixin, Page):
|
|||||||
body = CommonStreamField
|
body = CommonStreamField
|
||||||
|
|
||||||
show_as_bookable = models.BooleanField(
|
show_as_bookable = models.BooleanField(
|
||||||
default=True, help_text="Skal lokalet dukke i oversikten over lokaler som leies ut?"
|
default=True, help_text="Skal lokalet vises i oversikten over lokaler som leies ut?"
|
||||||
|
)
|
||||||
|
show_in_overview = models.BooleanField(
|
||||||
|
default=True,
|
||||||
|
help_text="Skal lokalet vises i oversikten over lokaler på undersiden /lokaler?",
|
||||||
)
|
)
|
||||||
floor = models.CharField(
|
floor = models.CharField(
|
||||||
blank=True,
|
blank=True,
|
||||||
@ -138,6 +142,7 @@ class VenuePage(WPImportedPageMixin, Page):
|
|||||||
FieldPanel("floor", heading="Etasje"),
|
FieldPanel("floor", heading="Etasje"),
|
||||||
FieldPanel("preposition", heading="Preposisjon"),
|
FieldPanel("preposition", heading="Preposisjon"),
|
||||||
FieldPanel("show_as_bookable", heading="Vis på utleieside"),
|
FieldPanel("show_as_bookable", heading="Vis på utleieside"),
|
||||||
|
FieldPanel("show_in_overview", heading="Vis i lokaleoversikt"),
|
||||||
FieldPanel("used_for", heading="Egnet for"),
|
FieldPanel("used_for", heading="Egnet for"),
|
||||||
MultiFieldPanel(
|
MultiFieldPanel(
|
||||||
heading="Kapabiliteter",
|
heading="Kapabiliteter",
|
||||||
@ -159,6 +164,7 @@ class VenuePage(WPImportedPageMixin, Page):
|
|||||||
GraphQLString("used_for"),
|
GraphQLString("used_for"),
|
||||||
GraphQLString("tech_specs_url"),
|
GraphQLString("tech_specs_url"),
|
||||||
GraphQLBoolean("show_as_bookable"),
|
GraphQLBoolean("show_as_bookable"),
|
||||||
|
GraphQLBoolean("show_in_overview"),
|
||||||
GraphQLString("capability_audio"),
|
GraphQLString("capability_audio"),
|
||||||
GraphQLString("capability_audio_video"),
|
GraphQLString("capability_audio_video"),
|
||||||
GraphQLString("capability_bar"),
|
GraphQLString("capability_bar"),
|
||||||
|
@ -33,6 +33,7 @@ const VenueFragmentDefinition = graphql(`
|
|||||||
...Image
|
...Image
|
||||||
}
|
}
|
||||||
showAsBookable
|
showAsBookable
|
||||||
|
showInOverview
|
||||||
floor
|
floor
|
||||||
preposition
|
preposition
|
||||||
usedFor
|
usedFor
|
||||||
@ -65,6 +66,7 @@ export default async function Page() {
|
|||||||
const { data, error } = await getClient().query(venueIndexQuery, {});
|
const { data, error } = await getClient().query(venueIndexQuery, {});
|
||||||
const index = (data?.index ?? []) as VenueIndexFragment;
|
const index = (data?.index ?? []) as VenueIndexFragment;
|
||||||
const venues = (data?.venues ?? []) as VenueFragment[];
|
const venues = (data?.venues ?? []) as VenueFragment[];
|
||||||
|
const visibleVenues = venues.filter((x) => x.showInOverview);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main className="site-main" id="main">
|
<main className="site-main" id="main">
|
||||||
|
@ -30,7 +30,7 @@ const documents = {
|
|||||||
"\n query allVenueSlugs {\n pages(contentType: \"venues.VenuePage\", limit: 100) {\n id\n slug\n }\n }\n ": types.AllVenueSlugsDocument,
|
"\n query allVenueSlugs {\n pages(contentType: \"venues.VenuePage\", limit: 100) {\n id\n slug\n }\n }\n ": types.AllVenueSlugsDocument,
|
||||||
"\n query venueBySlug($slug: String!) {\n venue: page(contentType: \"venues.VenuePage\", slug: $slug) {\n ... on VenuePage {\n ...Venue\n }\n }\n }\n ": types.VenueBySlugDocument,
|
"\n query venueBySlug($slug: String!) {\n venue: page(contentType: \"venues.VenuePage\", slug: $slug) {\n ... on VenuePage {\n ...Venue\n }\n }\n }\n ": types.VenueBySlugDocument,
|
||||||
"\n fragment VenueIndex on VenueIndex {\n ... on VenueIndex {\n title\n lead\n body {\n ...Blocks\n }\n }\n }\n": types.VenueIndexFragmentDoc,
|
"\n fragment VenueIndex on VenueIndex {\n ... on VenueIndex {\n title\n lead\n body {\n ...Blocks\n }\n }\n }\n": types.VenueIndexFragmentDoc,
|
||||||
"\n fragment Venue on VenuePage {\n __typename\n id\n slug\n title\n images {\n ...Blocks\n }\n body {\n ...Blocks\n }\n featuredImage {\n ...Image\n }\n showAsBookable\n floor\n preposition\n usedFor\n techSpecsUrl\n capabilityAudio\n capabilityAudioVideo\n capabilityBar\n capabilityLighting\n capacityLegal\n capacityStanding\n capacitySitting\n }\n": types.VenueFragmentDoc,
|
"\n fragment Venue on VenuePage {\n __typename\n id\n slug\n title\n images {\n ...Blocks\n }\n body {\n ...Blocks\n }\n featuredImage {\n ...Image\n }\n showAsBookable\n showInOverview\n floor\n preposition\n usedFor\n techSpecsUrl\n capabilityAudio\n capabilityAudioVideo\n capabilityBar\n capabilityLighting\n capacityLegal\n capacityStanding\n capacitySitting\n }\n": types.VenueFragmentDoc,
|
||||||
"\n query venueIndex {\n index: venueIndex {\n ... on VenueIndex {\n ...VenueIndex\n }\n }\n venues: pages(contentType: \"venues.VenuePage\", limit: 100) {\n ... on VenuePage {\n ...Venue\n }\n }\n }\n ": types.VenueIndexDocument,
|
"\n query venueIndex {\n index: venueIndex {\n ... on VenueIndex {\n ...VenueIndex\n }\n }\n venues: pages(contentType: \"venues.VenuePage\", limit: 100) {\n ... on VenuePage {\n ...Venue\n }\n }\n }\n ": types.VenueIndexDocument,
|
||||||
"\n fragment Home on HomePage {\n ... on HomePage {\n featuredEvents {\n id\n }\n }\n }\n": types.HomeFragmentDoc,
|
"\n fragment Home on HomePage {\n ... on HomePage {\n featuredEvents {\n id\n }\n }\n }\n": types.HomeFragmentDoc,
|
||||||
"\n query home {\n events: eventIndex {\n ... on EventIndex {\n futureEvents {\n ... on EventPage {\n ...Event\n }\n }\n }\n }\n home: page(contentType: \"home.HomePage\", urlPath: \"/home/\") {\n ... on HomePage {\n ...Home\n }\n }\n news: pages(contentType: \"news.newsPage\", order: \"-first_published_at\", limit: 4) {\n ... on NewsPage {\n ...News\n }\n }\n }\n ": types.HomeDocument,
|
"\n query home {\n events: eventIndex {\n ... on EventIndex {\n futureEvents {\n ... on EventPage {\n ...Event\n }\n }\n }\n }\n home: page(contentType: \"home.HomePage\", urlPath: \"/home/\") {\n ... on HomePage {\n ...Home\n }\n }\n news: pages(contentType: \"news.newsPage\", order: \"-first_published_at\", limit: 4) {\n ... on NewsPage {\n ...News\n }\n }\n }\n ": types.HomeDocument,
|
||||||
@ -137,7 +137,7 @@ export function graphql(source: "\n fragment VenueIndex on VenueIndex {\n ..
|
|||||||
/**
|
/**
|
||||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||||
*/
|
*/
|
||||||
export function graphql(source: "\n fragment Venue on VenuePage {\n __typename\n id\n slug\n title\n images {\n ...Blocks\n }\n body {\n ...Blocks\n }\n featuredImage {\n ...Image\n }\n showAsBookable\n floor\n preposition\n usedFor\n techSpecsUrl\n capabilityAudio\n capabilityAudioVideo\n capabilityBar\n capabilityLighting\n capacityLegal\n capacityStanding\n capacitySitting\n }\n"): (typeof documents)["\n fragment Venue on VenuePage {\n __typename\n id\n slug\n title\n images {\n ...Blocks\n }\n body {\n ...Blocks\n }\n featuredImage {\n ...Image\n }\n showAsBookable\n floor\n preposition\n usedFor\n techSpecsUrl\n capabilityAudio\n capabilityAudioVideo\n capabilityBar\n capabilityLighting\n capacityLegal\n capacityStanding\n capacitySitting\n }\n"];
|
export function graphql(source: "\n fragment Venue on VenuePage {\n __typename\n id\n slug\n title\n images {\n ...Blocks\n }\n body {\n ...Blocks\n }\n featuredImage {\n ...Image\n }\n showAsBookable\n showInOverview\n floor\n preposition\n usedFor\n techSpecsUrl\n capabilityAudio\n capabilityAudioVideo\n capabilityBar\n capabilityLighting\n capacityLegal\n capacityStanding\n capacitySitting\n }\n"): (typeof documents)["\n fragment Venue on VenuePage {\n __typename\n id\n slug\n title\n images {\n ...Blocks\n }\n body {\n ...Blocks\n }\n featuredImage {\n ...Image\n }\n showAsBookable\n showInOverview\n floor\n preposition\n usedFor\n techSpecsUrl\n capabilityAudio\n capabilityAudioVideo\n capabilityBar\n capabilityLighting\n capacityLegal\n capacityStanding\n capacitySitting\n }\n"];
|
||||||
/**
|
/**
|
||||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||||
*/
|
*/
|
||||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user