Skip to content

Commit

Permalink
8785: replace project overview with kiezradar without translations
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh authored and partizipation committed Jan 27, 2025
1 parent ca7db8e commit 16792f2
Show file tree
Hide file tree
Showing 23 changed files with 45 additions and 38 deletions.
7 changes: 7 additions & 0 deletions changelog/_0003.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Changed

- `imghdr` support was deprecated in python, so now we use `python-magic` and built-in `mime` to check the filetype of images files for bplans created using the API.

### Fixed

- Bug where tile_image was being used instead of image_url.
2 changes: 1 addition & 1 deletion meinberlin/apps/bplan/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ def create(self, validated_data):

tile_image = validated_data.pop("tile_image", None)
if tile_image:
print(tile_image)
validated_data["tile_image"] = self._create_image_from_base64(tile_image)

image_url = validated_data.pop("image_url", None)
Expand Down Expand Up @@ -329,6 +328,7 @@ def _generate_image_filename(self, url_path, file):

root_path, extension = posixpath.splitext(url_path)
if file:
file.seek(0)
file_mime = magic.from_buffer(file.read(), mime=True)
extension = mimetypes.guess_extension(file_mime) or "jpeg"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<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 'meinberlin_plans:plan-list' %}">{% translate 'Kiezradar' %}</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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<nav class="breadcrumb" aria-label="{% translate 'You are here:' %}">
<ol>
<li>
<a href="{% url 'meinberlin_plans:plan-list' %}">{% translate 'Project Overview' %}</a>
<a href="{% url 'meinberlin_plans:plan-list' %}">{% translate 'Kiezradar' %}</a>
</li>
<li>
<a href="{% url 'project-detail' project.slug %}">{{ project.name|truncatechars:50 }}</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<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 'meinberlin_plans:plan-list' %}">{% translate 'Kiezradar' %}</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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{# <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 'meinberlin_plans:plan-list' %}">{% translate 'Kiezradar' %}</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>#}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<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 'meinberlin_plans:plan-list' %}">{% translate 'Kiezradar' %}</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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<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 'meinberlin_plans:plan-list' %}">{% translate 'Kiezradar' %}</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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<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 'meinberlin_plans:plan-list' %}">{% translate 'Kiezradar' %}</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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@
{% block extra_js %}
{{ block.super }}
<script type="text/javascript" src="{% static 'map_display_point.js' %}"></script>
{% endblock %}
{% endblock extra_js %}

{% block extra_css %}
{{ block.super }}
<link type="text/css" href="{% static 'map_display_point.css'%}" rel="stylesheet" />
{% endblock %}
<link type="text/css" href="{% static 'map_display_point.css' %}" rel="stylesheet" />
{% endblock extra_css %}

{% block title %}{{object.name}} &mdash; {{ block.super }}{% endblock %}
{% block title %}{{ object.name }} {{ 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 'meinberlin_plans:plan-list' %}">{% translate 'Kiezradar' %}</a></li>
<li><a href="{% url 'project-detail' project.slug %}">{{ project.name|truncatechars:50 }}</a></li>
{% if module.is_in_module_cluster %}
{% 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">{{ object.name }}</li>
</ol>
</nav>
</div>
{% endblock %}
{% endblock breadcrumbs %}

{% block content %}
<div id="layout-grid__area--maincontent">
Expand All @@ -38,7 +38,7 @@ <h1 class="item-detail__title">{{ object.name }}</h1>

<div class="item-detail__content">
<div class="item-detail__basic-content">
<img class="item-detail__hero-image" src="{% thumbnail object.image 'item_image' %}" alt="">
<img class="item-detail__hero-image" src="{% thumbnail object.image 'item_image' %}" alt="" width="" height="">
<div class="ck-content">
{{ object.description | richtext }}
</div>
Expand Down Expand Up @@ -69,4 +69,4 @@ <h2 class="visually-hidden">{% translate 'Comments' %}</h2>
{% react_comments_async object %}
</section>
</div>
{% endblock %}
{% endblock content %}
6 changes: 3 additions & 3 deletions meinberlin/apps/plans/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class Meta:
),
"point": _(
"If you locate your plan, it will be shown "
"on the map in the project overview in addition "
"on the map in the Kiezradar in addition "
"to the list. To set a pin, click inside the "
"highlighted area or enter an address. Once a "
"pin is set you can move it by dragging it."
Expand Down Expand Up @@ -112,9 +112,9 @@ class Meta:
"overview projects can be "
"filtered according to topics."
),
"status": _("In the project overview projects can be filtered by status."),
"status": _("In the Kiezradar projects can be filtered by status."),
"participation": _(
"In the project overview "
"In the Kiezradar "
"projects can be filtered "
"according to the level of "
"participation."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ <h2 class="form__subheading">{% translate 'Contact for questions' %}</h2>
{% include 'a4forms/includes/form_field.html' with field=form.contact_phone %}
{% include 'a4forms/includes/form_field.html' with field=form.contact_url %}

<h2 class="form__subheading">{% translate 'Presentation in Project Overview' %}</h2>
<h2 class="form__subheading">{% translate 'Presentation in Kiezradar' %}</h2>
<p class="form-hint form-hint--margin">
{% translate 'The following information affects the presentation of the project in the general project overview.' %}
{% translate 'The following information affects the presentation of the project in the Kiezradar.' %}
</p>

{% include 'a4forms/includes/form_field.html' with field=form.tile_image %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<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 'meinberlin_plans:plan-list' %}">{% translate 'Kiezradar' %}</a></li>
<li class="active" aria-current="page">{{ object.title|truncatechars:50 }}</li>
</ol>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion meinberlin/apps/plans/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
views.PlanDetailView.as_view(),
name="plan-detail",
),
path("projekte/", views.PlanListView.as_view(), name="plan-list"),
path("kiezradar/", views.PlanListView.as_view(), name="plan-list"),
]
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<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 'meinberlin_plans:plan-list' %}">{% translate 'Kiezradar' %}</a></li>
<li class="active" aria-current="page">{{ project.name|truncatechars:50 }}</li>
</ol>
</nav>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<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 'meinberlin_plans:plan-list' %}">{% translate "Kiezradar" %}</a></li>
<li class="active" aria-current="page">{{ project.name|truncatechars:50 }}</li>
</ol>
</nav>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{% extends "base.html" %}
{% load i18n rules react_comments_async module_tags react_ratings wagtailcore_tags thumbnail %}

{% block title %}{{object.name}} &mdash; {{ block.super }}{% endblock %}
{% block title %}{{ object.name }} {{ 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 'meinberlin_plans:plan-list' %}">{% translate 'Kiezradar' %}</a></li>
<li><a href="{% url 'project-detail' project.slug %}">{{ project.name|truncatechars:50 }}</a></li>
{% if module.is_in_module_cluster %}
{% 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">{{ object.name }}</li>
</ol>
</nav>
</div>
{% endblock %}
{% endblock breadcrumbs %}

{% block content %}
<div id="layout-grid__area--maincontent">
Expand All @@ -28,7 +28,7 @@ <h1 class="item-detail__title">{{ object.name }}</h1>

<div class="item-detail__content">
<div class="item-detail__basic-content">
<img class="item-detail__hero-image" src="{% thumbnail object.image 'item_image' %}" alt="">
<img class="item-detail__hero-image" src="{% thumbnail object.image 'item_image' %}" alt="" width="" height="">
<div class="ck-content">
{{ object.description | richtext }}
</div>
Expand All @@ -55,4 +55,4 @@ <h2 class="visually-hidden">{% translate 'Comments' %}</h2>
{% react_comments_async object %}
</section>
</div>
{% endblock %}
{% endblock content %}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ If you have any questions, please contact {{ contact_email }}.
{% endblock %}

{% block cta_url %}{{ email.get_host }}{% url 'meinberlin_plans:plan-list' %}{% endblock %}
{% block cta_label %}To project overview{% endblock %}
{% block cta_label %}To Kiezradar{% endblock %}

{% block reason %}This e-mail was sent to {{ user.email }}. You have received the e-mail because you have registered on {{ site.name }}.{% endblock %}
2 changes: 1 addition & 1 deletion meinberlin/react/plans/FilterNav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const FilterButton = require('./FilterButton')
const FilterSecondary = require('./FilterSecondary')
const React = require('react')
const allStr = django.gettext('all')
const filterBarStr = django.gettext('Filter bar for Project overview')
const filterBarStr = django.gettext('Filter bar for Kiezradar')
const interestedInProjectsStr = django.gettext('I am interested in projects from')
const allDistrictsStr = django.gettext('„ all Districts “')
const whichDistrictsStr = django.gettext('Which district are you interested in?')
Expand Down
2 changes: 1 addition & 1 deletion meinberlin/react/projects/ProjectsListMapBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
getDefaultState
} from './getDefaultState'

const pageHeader = django.gettext('Project overview')
const pageHeader = django.gettext('Kiezradar')
const showMapStr = django.gettext('Show map')
const nothingStr = django.gettext('Unfortunately, there are no projects matching your search. Please adjust the search criteria.')
const showMapAriaStr = django.gettext('show map')
Expand Down
2 changes: 1 addition & 1 deletion meinberlin/templates/a4modules/module_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<nav class="breadcrumb" aria-label="{% translate 'You are here:' %}">
<ol>
<li>
<a href="{% url 'meinberlin_plans:plan-list' %}">{% translate 'Project Overview' %}</a>
<a href="{% url 'meinberlin_plans:plan-list' %}">{% translate 'Kiezradar' %}</a>
</li>
<li>
<a href="{% url 'project-detail' project.slug %}">{{ project.name|truncatechars:50 }}</a>
Expand Down
2 changes: 1 addition & 1 deletion meinberlin/templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<ul>
<li class="{% if request.path == project_list %}active{% endif %}">
{% url 'meinberlin_plans:plan-list' as project_list %}
<a href="{% url 'meinberlin_plans:plan-list' %}">{% translate 'Project Overview' %}</a>
<a href="{% url 'meinberlin_plans:plan-list' %}">{% translate 'Kiezradar' %}</a>
</li>
{% get_header_menu "topnav" as topnav %}
{% for item in topnav %}
Expand Down
2 changes: 1 addition & 1 deletion meinberlin/templates/navigation_primary.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<h3 class="aural">{% translate 'Page navigation' %}</h3>
<ul class="navigation-tree">
<li class="{% if request.path == project_list %}active{% endif %}">
<a href="{% url 'meinberlin_plans:plan-list' %}">{% translate 'Project Overview' %}</a>
<a href="{% url 'meinberlin_plans:plan-list' %}">{% translate 'Kiezradar' %}</a>
</li>
{% if settings.meinberlin_cms.HeaderPages.help_page %}
<li class="{% if request.path == settings.meinberlin_cms.HeaderPages.help_page.get_url %}active{% endif %}">
Expand Down

0 comments on commit 16792f2

Please sign in to comment.