-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add new hero component and information page
- Loading branch information
Showing
17 changed files
with
348 additions
and
294 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
### Added | ||
- create project information page | ||
- hero component | ||
- contact snippets | ||
|
||
### Removed | ||
- image with aside (replaced with hero) | ||
|
||
### Changed | ||
- plan and project detail pages |
48 changes: 48 additions & 0 deletions
48
meinberlin/apps/contrib/templates/meinberlin_contrib/components/hero.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{% load i18n thumbnail %} | ||
|
||
<article class="hero {{ extra_class|default:'' }}"> | ||
<div class="hero__container"> | ||
<div class="hero__content"> | ||
<h1 class="hero__title"> | ||
{% if show_buttons %} | ||
<a href="{{ hero_link }}" class="hero__title-link">{{ content.name }}</a> | ||
{% else %} | ||
{{ content.name }} | ||
{% endif %} | ||
</h1> | ||
<div class="hero__description"> | ||
<p>{{ content.description|safe }}</p> | ||
{% if content.image_copyright %} | ||
<p class="hero__image-copyright">{% translate "Image" %}: {{ content.image_copyright }}</p> | ||
{% endif %} | ||
</div> | ||
|
||
{% if show_buttons %} | ||
<div class="hero__buttons"> | ||
<a href="{{ hero_link }}" class="button button--light"> | ||
{% translate "More information" %} | ||
</a> | ||
{% load react_follows %} | ||
{% react_follows project %} | ||
</div> | ||
{% endif %} | ||
</div> | ||
|
||
<div class="hero__media"> | ||
<figure class="hero__figure"> | ||
{% if show_buttons %} | ||
<a href="{{ hero_link }}"> | ||
{% endif %} | ||
<img | ||
class="hero__image" | ||
src="{{ content.image|thumbnail_url:'heroimage' }}" | ||
alt="{{ content.image_alt_text|default:_('Here you can find a decorative picture.') }}" | ||
loading="lazy" | ||
/> | ||
</figure> | ||
{% if show_buttons %} | ||
</a> | ||
{% endif %} | ||
</div> | ||
</div> | ||
</article> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from django import template | ||
|
||
register = template.Library() | ||
|
||
@register.simple_tag | ||
def modify_hero_content(content): | ||
"""Creates a modified copy of the content object with point_label as description""" | ||
# Create a copy of the object to avoid modifying the original | ||
from copy import copy | ||
modified_content = copy(content) | ||
# Override the description with point_label | ||
modified_content.description = content.point_label | ||
return modified_content |
20 changes: 20 additions & 0 deletions
20
meinberlin/apps/projects/templates/meinberlin_projects/includes/contact_organization.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{% load i18n %} | ||
|
||
{% if organization %} | ||
<div class="modul-contact"> | ||
<h3 id="responsible-body">{% trans 'Responsible body' %}</h3> | ||
<address aria-labelledby="responsible-body" class="mt-2"> | ||
<p>{{ organization.name }}</p> | ||
|
||
{% if organization.address %} | ||
<p>{{ organization.address|linebreaksbr }}</p> | ||
{% endif %} | ||
|
||
{% if organization.url %} | ||
<p>{% trans "Website" %}: | ||
<a href="{{ organization.url }}" target="_blank" rel="noopener noreferrer">{{ organization.url }}</a> | ||
</p> | ||
{% endif %} | ||
</address> | ||
</div> | ||
{% endif %} |
22 changes: 22 additions & 0 deletions
22
meinberlin/apps/projects/templates/meinberlin_projects/includes/contact_person.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{% load i18n %} | ||
|
||
{% if contact.has_contact_details %} | ||
<div class="modul-contact"> | ||
<h3 id="contact-questions">{% trans "Contact for questions" %}</h3> | ||
<address aria-labelledby="contact-questions" class="mt-2"> | ||
<p>{{ contact.contact_name }}</p> | ||
|
||
{% if contact.contact_email %} | ||
<p>{% trans "Email" %}: | ||
<a href="mailto:{{ contact.contact_email }}" aria-label="{% trans 'Email' %} {{ contact.contact_name }}">{{ contact.contact_email }}</a> | ||
</p> | ||
{% endif %} | ||
|
||
{% if contact.contact_phone %} | ||
<p>{% trans "Phone" %}: | ||
<a href="tel:{{ contact.contact_phone }}" aria-label="{% trans 'Call' %} {{ contact.contact_name }}">{{ contact.contact_phone }}</a> | ||
</p> | ||
{% endif %} | ||
</address> | ||
</div> | ||
{% endif %} |
Oops, something went wrong.