Skip to content

Commit

Permalink
Town6: Restyling of newsletter
Browse files Browse the repository at this point in the history
Some style improvements of the newsletter and added images of events if there are any

TYPE: Feature
LINK: OGC-1788
  • Loading branch information
BreathingFlesh authored Oct 8, 2024
1 parent 3b733fb commit 981242f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
4 changes: 4 additions & 0 deletions src/onegov/town6/templates/mail_layout.pt
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@
margin-top: 20px;
}

hr.gray {
border: 1px solid #ddd;
}

hr.large {
Margin-top: 20px;
}
Expand Down
32 changes: 18 additions & 14 deletions src/onegov/town6/templates/mail_newsletter.pt
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,39 @@

<tal:b condition="news">
<h2 i18n:translate>Latest news</h2>

<tal:b repeat="item news">
<strong><a href="${request.link(item)}"><h3>${item.title}</h3></a></strong>
<img tal:condition="item.page_image and item.show_preview_image" style="width: 100%; padding-bottom: 55%; background-image: url(${item.page_image}); background-size: cover;"></img>
<p><strong>${layout.with_hashtags(item.lead)}</strong></p>
<hr>
<strong><a href="${request.link(item)}"><h3>${item.title}</h3></a></strong>
<img tal:condition="item.page_image and item.show_preview_image" style="width: 100%; padding-bottom: 55%; background-image: url(${item.page_image}); background-size: cover;"></img>
<p><strong>${layout.with_hashtags(item.lead)}</strong></p>
<p tal:content="item.text">

<hr>
</tal:b>
</tal:b>
</tal:b>

<tal:b condition="publications">
<h2 i18n:translate>Publications</h2>

<tal:b repeat="publication publications">
<tal:b condition="publications">
<hr>
<h2 i18n:translate>Publications</h2>
<tal:b repeat="publication publications">
<strong><a href="${request.link(publication)}">${name_without_extension(publication.name)}</a></strong>
<ul class="flat">
<li>${layout.format_date(publication.created, 'date')}</li>
</ul>
</tal:b>
</tal:b>

<tal:b condition="occurrences">
<hr>
<h2 i18n:translate>Events</h2>

<tal:b repeat="occurrence occurrences">
<strong><a href="${request.link(occurrence)}">${occurrence.title}</a></strong>
<hr class="gray">
<strong><a href="${request.link(occurrence)}"><h3>${occurrence.title}</h3></a></strong>
<img tal:condition="occurrence.event.image" style="width: 50%; padding-bottom: 30%; background-image: url(${request.link(occurrence.event.image)}); background-size: cover; border-radius: .7rem;"></img>
<ul class="flat">
<li>${layout.format_date(occurrence.localized_start, 'date')} ${layout.format_date(occurrence.localized_start, 'time')} - ${layout.format_date(occurrence.localized_end, 'time')}</li>
<li><b>${layout.format_date(occurrence.localized_start, 'date')} ${layout.format_date(occurrence.localized_start, 'time')} - ${layout.format_date(occurrence.localized_end, 'time')}</b></li>
<li>${occurrence.location}</li>
</ul>
</tal:b>
Expand Down

0 comments on commit 981242f

Please sign in to comment.