Skip to content

Commit

Permalink
Merge pull request #8042 from cfpb/event-clear-field-labels
Browse files Browse the repository at this point in the history
Changing labels for Event page field panels
  • Loading branch information
csebianlander authored Dec 1, 2023
2 parents 1832b7e + 1276c94 commit 71e77ad
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 89 deletions.
60 changes: 0 additions & 60 deletions cfgov/v1/jinja2/v1/events/_macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -243,63 +243,3 @@ <h2>Agenda</h2>
</table>
</div>
{% endmacro %}

{# ==========================================================================

event_media()

==========================================================================

Description:

Create event archive media markup when given:

event: An event from a query result.

========================================================================== #}

{% macro event_media( event ) %}
{% set col_classes = 'content-l_col
content-l_col-1-2
block
block__padded-top
block__flush-top
block__flush-bottom'
%}

{% if event.speech_transcript or event.video_transcript or event.flickr_url %}
<div class="block block__border-top block__padded-top">
{% if event.flickr_url %}
<p>
<h4>Photography</h4>
<a class="a-link
a-link__jump
a-link__external-link"
href="{{ event.flickr_url }}">
See the album for the event
</a>
</p>
{% endif %}
{% if event.speech_transcript %}
<p>
<h4>Speech text</h4>
<a href="{{ event.speech_transcript.url }}"
class="a-link
a-link__jump">
Download speech
</a>
</p>
{% endif %}
{% if event.video_transcript %}
<p>
<h4>Video transcript</h4>
<a href="{{ event.video_transcript.url }}"
class="a-link
a-link__jump">
Download transcript
</a>
</p>
{% endif %}
</div>
{% endif %}
{% endmacro %}
4 changes: 0 additions & 4 deletions cfgov/v1/jinja2/v1/events/event.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@

{% block content_main %}
{% include 'v1/events/_event-detail.html' %}
{% from 'v1/events/_macros.html' import event_media as event_media with context %}
{% if event_state and event_state != 'future' %}
{{ event_media(page) }}
{% endif %}

{% if page.agenda_items %}
{% from 'v1/events/_macros.html' import event_agenda as event_agenda with context%}
Expand Down
25 changes: 25 additions & 0 deletions cfgov/v1/migrations/0012_event_page_cleanup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 3.2.23 on 2023-12-01 20:45

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('v1', '0011_wagtail_image_field_update'),
]

operations = [
migrations.RemoveField(
model_name='eventpage',
name='flickr_url',
),
migrations.RemoveField(
model_name='eventpage',
name='speech_transcript',
),
migrations.RemoveField(
model_name='eventpage',
name='video_transcript',
),
]
34 changes: 9 additions & 25 deletions cfgov/v1/models/learn_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,21 +186,6 @@ class EventPage(AbstractFilterPage):
on_delete=models.SET_NULL,
related_name="+",
)
video_transcript = models.ForeignKey(
"wagtaildocs.Document",
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name="+",
)
speech_transcript = models.ForeignKey(
"wagtaildocs.Document",
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name="+",
)
flickr_url = models.URLField("Flickr URL", blank=True)
archive_video_id = models.CharField(
"YouTube video ID (archive)",
null=True,
Expand Down Expand Up @@ -299,27 +284,26 @@ class EventPage(AbstractFilterPage):
FieldPanel("end_dt", classname="col6"),
]
),
FieldPanel("future_body", heading="Content visible before event"),
FieldPanel("live_body", heading="Content visible during event"),
MultiFieldPanel(
[
FieldPanel("archive_body"),
FieldPanel("archive_image"),
FieldPanel("video_transcript"),
FieldPanel("speech_transcript"),
FieldPanel("flickr_url"),
FieldPanel(
"archive_body", heading="Content visible after event"
),
FieldPanel("archive_image", heading="Image shown after event"),
FieldPanel("archive_video_id"),
],
heading="Archive Information",
heading="Body and information visible after event",
),
FieldPanel("live_body"),
FieldPanel("future_body"),
FieldPanel("persistent_body"),
FieldPanel("persistent_body", heading="Content visible at all times"),
MultiFieldPanel(
[
FieldPanel("live_stream_availability"),
FieldPanel("live_video_id"),
FieldPanel("live_stream_date"),
],
heading="Live Stream Information",
heading="Livestream information",
),
]
# Venue content tab
Expand Down

0 comments on commit 71e77ad

Please sign in to comment.