Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8471] apps/contrib/templates: add template file for alerts #5729

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions changelog/_8471.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
### Fixed

- fixed linting in: `project_bplan_detail.html`, `project_detail.html`, `module_detail.html`, `base.html`

### Changed

- moved `/components/_alert.scss` to components_dashboard folder

### Added
- introduced a reusable snippet `alerts.html` to enhance consistency and maintainability across alerts and prevent code duplication.
- added snippet to `project_detail.html`, `module_detail.html`, `base.html`, `idea_create_form.html`, `idea_update_form.html`, `image_upload_widget.html`, `topic_create_form.html`, `topic_update_form.html`, `proposal_create_form.html`, `proposal_update_form.html`, `mapidea_create_form.html` ,`mapidea_update_form.html`
- added alert__headline, .alert__content and alert__text to `/components_user_facing/_alert.scss`

### Removed

- removed messages class, @use "sass:color", $messages-margin-bottom form `/components_user_facing/_alert.scss`
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
{% extends "base.html" %}
{% load i18n %}

{% block title %}{% translate 'Create a new proposal' %} — {{ block.super }}{% endblock %}
{% block breadcrumbs %}
<div id="content-header">
<nav class="breadcrumb" aria-label="{% translate 'You are here:' %}">
<ol>
<li><a href="{% url 'wagtail_serve' '' %}">meinBerlin</a></li>
<li><a href="{% url 'meinberlin_plans:plan-list' %}">{% translate 'Project Overview' %}</a></li>
<li><a href="{% url 'project-detail' project.slug %}">{{ project.name|truncatechars:50 }}</a></li>
{% if module.is_in_module_cluster %}
<li><a href="{{ module.get_detail_url }}">{{ module.name|truncatechars:50 }}</a></li>
{% endif %}
<li class="active" aria-current="page">{% translate 'Submit a new proposal for this project' %}</li>
</ol>
</nav>
</div>
{% endblock %}
{% block content %}
<div id="layout-grid__area--maincontent">
<h1>{% translate 'Submit a new proposal for this project' %}</h1>

{% if form.errors %}
<div class="alert alert--danger" aria-live="assertive" aria-atomic="true" id="alert">
{% translate 'An error occurred while evaluating your data. Please check the data you entered again.' %}
</div>
{% endif %}

{% include "meinberlin_budgeting/includes/proposal_form.html" with proposal=proposal cancel=module.get_detail_url %}
</div>
{% endblock %}
{% extends "base.html" %}
{% load i18n %}

{% block title %}{% translate 'Create a new proposal' %} - {{ block.super }}{% endblock title %}
{% block breadcrumbs %}
<div id="content-header">
<nav class="breadcrumb" aria-label="{% translate 'You are here:' %}">
<ol>
<li><a href="{% url 'wagtail_serve' '' %}">meinBerlin</a></li>
<li><a href="{% url 'meinberlin_plans:plan-list' %}">{% translate 'Project Overview' %}</a></li>
<li><a href="{% url 'project-detail' project.slug %}">{{ project.name|truncatechars:50 }}</a></li>
{% if module.is_in_module_cluster %}
<li><a href="{{ module.get_detail_url }}">{{ module.name|truncatechars:50 }}</a></li>
{% endif %}
<li class="active" aria-current="page">{% translate 'Submit a new proposal for this project' %}</li>
</ol>
</nav>
</div>
{% endblock breadcrumbs %}
{% block content %}
<div id="layout-grid__area--maincontent">
<h1>{% translate 'Submit a new proposal for this project' %}</h1>

{% if form.errors %}
{% include 'meinberlin_contrib/components/alert.html' with alert_message='Error during validation. Please check your entries.' alert_type='danger' %}
{% endif %}

{% include "meinberlin_budgeting/includes/proposal_form.html" with proposal=proposal cancel=module.get_detail_url %}
</div>
{% endblock content %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{% load i18n %}

<div class="alert alert--{{ alert_type }}"
role="alert"
aria-live="{% if alert_type == 'danger' %}assertive{% else %}polite{% endif %}"
aria-describedby="{% if alert_headline %}alert__headline{% endif %} alert__text"
aria-atomic="true"
>
<div class="a4-alert__container">
<div class="a4-alert__content">
{% if alert_headline %}
<h3 class="alert__headline">
{% translate alert_headline %}
</h3>
{% endif %}
<p class="alert__text">
{% translate alert_message %}
</p>
</div>
<button type="button" class="alert__close" data-bs-dismiss="alert" aria-label="{% translate 'Close' %}"><i class="fa fa-times" aria-hidden="true"></i></button>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
{% extends "base.html" %}
{% load i18n meinberlin_project_tags %}

{% block title %}{% translate 'Create a new proposal' %} &mdash; {{ block.super }}{% endblock %}

{% block breadcrumbs %}
<div id="content-header">
<nav class="breadcrumb" aria-label="{% translate 'You are here:' %}">
<ol>
<li><a href="{% url 'wagtail_serve' '' %}">meinBerlin</a></li>
<li><a href="{% url 'meinberlin_plans:plan-list' %}">{% translate 'Project Overview' %}</a></li>
<li><a href="{% url 'project-detail' project.slug %}">{{ project.name|truncatechars:50 }}</a></li>
{% if module.is_in_module_cluster %}
<li><a href="{{ module.get_detail_url }}">{{ module.name|truncatechars:50 }}</a></li>
{% endif %}
<li class="active" aria-current="page">{% translate 'Submit a new idea for this project '%}</li>
</ol>
</nav>
</div>
{% endblock %}

{% block content %}
<div id="layout-grid__area--maincontent">
<h1>{% translate 'Submit a new idea for this project' %}</h1>

{% if form.errors %}
<div class="alert alert--danger" aria-live="assertive" aria-atomic="true" id="alert">{% translate 'An error occurred while evaluating your data. Please check the data you entered again.' %}</div>
{% endif %}

<div class="u-bottom-divider">
<h3>{{ module.name }}</h3>
{% if module.description %}
<p>{{ module.description }}</p>
{% else %}
<p>{{ project.description }}</p>
{% endif %}
</div>
{% include "meinberlin_ideas/includes/idea_form.html" with idea=idea cancel=module.get_detail_url %}
</div>
{% endblock %}
{% extends "base.html" %}
{% load i18n meinberlin_project_tags %}
{% block title %}{% translate 'Create a new proposal' %} - {{ block.super }}{% endblock title %}
{% block breadcrumbs %}
<div id="content-header">
<nav class="breadcrumb" aria-label="{% translate 'You are here:' %}">
<ol>
<li><a href="{% url 'wagtail_serve' '' %}">meinBerlin</a></li>
<li><a href="{% url 'meinberlin_plans:plan-list' %}">{% translate 'Project Overview' %}</a></li>
<li><a href="{% url 'project-detail' project.slug %}">{{ project.name|truncatechars:50 }}</a></li>
{% if module.is_in_module_cluster %}
<li><a href="{{ module.get_detail_url }}">{{ module.name|truncatechars:50 }}</a></li>
{% endif %}
<li class="active" aria-current="page">{% translate 'Submit a new idea for this project ' %}</li>
</ol>
</nav>
</div>
{% endblock breadcrumbs %}
{% block content %}
<div id="layout-grid__area--maincontent">
<h1>{% translate 'Submit a new idea for this project' %}</h1>
{% if form.errors %}
{% include 'meinberlin_contrib/components/alert.html' with alert_message='Error during validation. Please check your entries.' alert_type='danger' %}
{% endif %}
<div class="u-bottom-divider">
<h3>{{ module.name }}</h3>
{% if module.description %}
<p>{{ module.description }}</p>
{% else %}
<p>{{ project.description }}</p>
{% endif %}
</div>
{% include "meinberlin_ideas/includes/idea_form.html" with idea=idea cancel=module.get_detail_url %}
</div>
{% endblock content %}
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{% extends "base.html" %}
{% load i18n %}

{% block title %}{% blocktranslate with title=object.name %}Edit {{ title }}{% endblocktranslate %} &mdash; {{ block.super }}{% endblock %}

{% block breadcrumbs %}
<div id="content-header">
<nav class="breadcrumb" aria-label="{% translate 'You are here:' %}">
<ol>
<li><a href="{% url 'wagtail_serve' '' %}">meinBerlin</a></li>
<li><a href="{% url 'meinberlin_plans:plan-list' %}">{% translate 'Project Overview' %}</a></li>
<li><a href="{% url 'project-detail' project.slug %}">{{ project.name|truncatechars:50 }}</a></li>
{% if module.is_in_module_cluster %}
<li><a href="{{ module.get_detail_url }}">{{ module.name|truncatechars:50 }}</a></li>
{% endif %}
<li><a href="{{ object.get_absolute_url }}">{% translate 'Idea' %}</a></li>
<li class="active" aria-current="page">{% translate 'Edit idea' %}</li>
</ol>
</nav>
</div>
{% endblock %}

{% block content %}
<div id="layout-grid__area--maincontent">
<h1>{% translate 'Edit idea' %}</h1>

{% if form.errors %}
<div class="alert alert--danger" aria-live="assertive" aria-atomic="true" id="alert">{% translate 'An error occurred while evaluating your data. Please check the data you entered again.' %}</div>
{% endif %}

{% include "meinberlin_ideas/includes/idea_form.html" with idea=idea cancel=object.get_absolute_url %}
</div>
{% endblock %}
{% extends "base.html" %}
{% load i18n %}
{% block title %}{% blocktranslate with title=object.name %}Edit {{ title }}{% endblocktranslate %} - {{ block.super }}{% endblock title %}
{% block breadcrumbs %}
<div id="content-header">
<nav class="breadcrumb" aria-label="{% translate 'You are here:' %}">
<ol>
<li><a href="{% url 'wagtail_serve' '' %}">meinBerlin</a></li>
<li><a href="{% url 'meinberlin_plans:plan-list' %}">{% translate 'Project Overview' %}</a></li>
<li><a href="{% url 'project-detail' project.slug %}">{{ project.name|truncatechars:50 }}</a></li>
{% if module.is_in_module_cluster %}
<li><a href="{{ module.get_detail_url }}">{{ module.name|truncatechars:50 }}</a></li>
{% endif %}
<li><a href="{{ object.get_absolute_url }}">{% translate 'Idea' %}</a></li>
<li class="active" aria-current="page">{% translate 'Edit idea' %}</li>
</ol>
</nav>
</div>
{% endblock breadcrumbs %}
{% block content %}
<div id="layout-grid__area--maincontent">
<h1>{% translate 'Edit idea' %}</h1>
{% if form.errors %}
{% include 'meinberlin_contrib/components/alert.html' with alert_message='Error during validation. Please check your entries.' alert_type='danger' %}
{% endif %}
{% include "meinberlin_ideas/includes/idea_form.html" with idea=idea cancel=object.get_absolute_url %}
</div>
{% endblock content %}
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
{% extends "base.html" %}
{% load i18n %}

{% block title %}{% translate 'Create a new proposal' %}{% endblock %}
{% block breadcrumbs %}
<div id="content-header">
<nav class="breadcrumb" aria-label="{% translate 'You are here:' %}">
<ol>
<li><a href="{% url 'wagtail_serve' '' %}">meinBerlin</a></li>
<li><a href="{% url 'meinberlin_plans:plan-list' %}">{% translate 'Project Overview' %}</a></li>
<li><a href="{% url 'project-detail' project.slug %}">{{ project.name|truncatechars:50 }}</a></li>
{% if module.is_in_module_cluster %}
<li><a href="{{ module.get_detail_url }}">{{ module.name|truncatechars:50 }}</a></li>
{% endif %}
<li class="active" aria-current="page">{% translate 'Submit a new proposal for this project' %}</li>
</ol>
</nav>
</div>
{% endblock %}
{% block content %}
<div id="layout-grid__area--maincontent">
<h1>{% translate 'Submit a new proposal for this project' %}</h1>

{% if form.errors %}
<div class="alert alert--danger" aria-live="assertive" aria-atomic="true" id="alert">
{% translate 'An error occurred while evaluating your data. Please check the data you entered again.' %}
</div>
{% endif %}

{% include "meinberlin_kiezkasse/includes/proposal_form.html" with proposal=proposal cancel=module.get_detail_url %}
</div>
{% endblock %}
{% extends "base.html" %}
{% load i18n %}

{% block title %}{% translate 'Create a new proposal' %}{% endblock title %}
{% block breadcrumbs %}
<div id="content-header">
<nav class="breadcrumb" aria-label="{% translate 'You are here:' %}">
<ol>
<li><a href="{% url 'wagtail_serve' '' %}">meinBerlin</a></li>
<li><a href="{% url 'meinberlin_plans:plan-list' %}">{% translate 'Project Overview' %}</a></li>
<li><a href="{% url 'project-detail' project.slug %}">{{ project.name|truncatechars:50 }}</a></li>
{% if module.is_in_module_cluster %}
<li><a href="{{ module.get_detail_url }}">{{ module.name|truncatechars:50 }}</a></li>
{% endif %}
<li class="active" aria-current="page">{% translate 'Submit a new proposal for this project' %}</li>
</ol>
</nav>
</div>
{% endblock breadcrumbs %}
{% block content %}
<div id="layout-grid__area--maincontent">
<h1>{% translate 'Submit a new proposal for this project' %}</h1>
{% if form.errors %}
{% include 'meinberlin_contrib/components/alert.html' with alert_message='Error during validation. Please check your entries.' alert_type='danger' %}
{% endif %}

{% include "meinberlin_kiezkasse/includes/proposal_form.html" with proposal=proposal cancel=module.get_detail_url %}
</div>
{% endblock content %}
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
{% extends "base.html" %}
{% load i18n %}

{% block title %}{% blocktranslate with title=object.name %}Edit {{ title }}{% endblocktranslate %} &mdash; {{ block.super }}{% endblock %}

{% block breadcrumbs %}
<div id="content-header">
<nav class="breadcrumb" aria-label="{% translate 'You are here:' %}">
<ol>
<li><a href="{% url 'wagtail_serve' '' %}">meinBerlin</a></li>
<li><a href="{% url 'meinberlin_plans:plan-list' %}">{% translate 'Project Overview' %}</a></li>
<li><a href="{% url 'project-detail' project.slug %}">{{ project.name|truncatechars:50 }}</a></li>
{% if module.is_in_module_cluster %}
<li><a href="{{ module.get_detail_url }}">{{ module.name|truncatechars:50 }}</a></li>
{% endif %}
<li><a href="{{ object.get_absolute_url }}">{% translate 'Proposal' %}</a></li>
<li class="active" aria-current="page">{% translate 'Edit proposal' %}</li>
</ol>
</nav>
</div>
{% endblock %}

{% block content %}
<div id="layout-grid__area--maincontent">
<h1>{% translate 'Edit proposal' %}</h1>

{% if form.errors %}
<div class="alert alert--danger" aria-live="assertive" aria-atomic="true" id="alert">
{% translate 'An error occurred while evaluating your data. Please check the data you entered again.' %}
</div>
{% endif %}

{% include "meinberlin_kiezkasse/includes/proposal_form.html" with proposal=proposal cancel=object.get_absolute_url %}
</div>
{% endblock %}
{% extends "base.html" %}
{% load i18n %}

{% block title %}{% blocktranslate with title=object.name %}Edit {{ title }}{% endblocktranslate %} - {{ block.super }}{% endblock title %}

{% block breadcrumbs %}
<div id="content-header">
<nav class="breadcrumb" aria-label="{% translate 'You are here:' %}">
<ol>
<li><a href="{% url 'wagtail_serve' '' %}">meinBerlin</a></li>
<li><a href="{% url 'meinberlin_plans:plan-list' %}">{% translate 'Project Overview' %}</a></li>
<li><a href="{% url 'project-detail' project.slug %}">{{ project.name|truncatechars:50 }}</a></li>
{% if module.is_in_module_cluster %}
<li><a href="{{ module.get_detail_url }}">{{ module.name|truncatechars:50 }}</a></li>
{% endif %}
<li><a href="{{ object.get_absolute_url }}">{% translate 'Proposal' %}</a></li>
<li class="active" aria-current="page">{% translate 'Edit proposal' %}</li>
</ol>
</nav>
</div>
{% endblock breadcrumbs %}

{% block content %}
<div id="layout-grid__area--maincontent">
<h1>{% translate 'Edit proposal' %}</h1>

{% if form.errors %}
{% include 'meinberlin_contrib/components/alert.html' with alert_message='Error during validation. Please check your entries.' alert_type='danger' %}
{% endif %}

{% include "meinberlin_kiezkasse/includes/proposal_form.html" with proposal=proposal cancel=object.get_absolute_url %}
</div>
{% endblock content %}
Loading
Loading