diff --git a/changelog/8573.md b/changelog/8573.md
new file mode 100644
index 0000000000..385e4d1dfd
--- /dev/null
+++ b/changelog/8573.md
@@ -0,0 +1,3 @@
+### Added
+- UI states for upcoming and ending projects on project tiles
+- adapted UI for plan tiles
diff --git a/meinberlin/assets/scss/components_user_facing/_project-tile.scss b/meinberlin/assets/scss/components_user_facing/_project-tile.scss
index 34be164dea..f4f8034a6d 100644
--- a/meinberlin/assets/scss/components_user_facing/_project-tile.scss
+++ b/meinberlin/assets/scss/components_user_facing/_project-tile.scss
@@ -96,12 +96,17 @@ a.project-tile {
.project-tile__status {
margin-top: auto;
+ margin-bottom: .5em;
+ font-size: $font-size-sm;
+ color: $text-base;
+}
+
+.project-tile__status__bar {
width: 100%;
height: .3em;
appearance: none;
background: $message-light-green;
border: none;
- margin-bottom: .5em;
&::-moz-progress-bar {
background: $primary;
@@ -118,7 +123,9 @@ a.project-tile {
}
.project-tile__timespan {
- font-size: $font-size-sm;
font-weight: 400;
- color: $text-base;
+}
+
+.project-tile__plan__count {
+ margin-right: .25em;
}
diff --git a/meinberlin/react/projects/ProjectTile.jsx b/meinberlin/react/projects/ProjectTile.jsx
index 0711a84ef2..d2bacbcc92 100644
--- a/meinberlin/react/projects/ProjectTile.jsx
+++ b/meinberlin/react/projects/ProjectTile.jsx
@@ -1,13 +1,17 @@
/* global django */
import React, { useId } from 'react'
-import { classNames } from '../contrib/helpers'
-import ProjectTopics from './ProjectTopics'
+import { classNames, toLocaleDate } from '../contrib/helpers'
+import ProjectTilePills from './ProjectTopics'
import getTimespan from './get-timespan'
import ImageWithPlaceholder from '../contrib/ImageWithPlaceholder'
const copyrightMissingStr = django.gettext('copyright missing')
const copyrightStr = django.gettext('copyright by')
const altImgStr = django.gettext('Here you can find a decorative picture.')
+const participationEndedStr = django.gettext('Participation ended.')
+const beginsOnStr = django.gettext('Begins on the')
+const participationProjectsStr = django.gettext('Participation projects')
+const participationProjectStr = django.gettext('Participation project')
function truncateText (item) {
if (item.length > 170) {
@@ -22,6 +26,16 @@ const ProjectTile = ({ project, isHorizontal, topicChoices, isMapTile }) => {
const describedById = useId()
const statusId = useId()
const statusBarProgress = project.active_phase ? project.active_phase[0] + '%' : null
+ let state = 'past'
+
+ // Plans are always active since we dont change state for them, we only show
+ // projects belonging to them.
+ if (project.active_phase || project.type === 'plan') {
+ state = 'active'
+ } else if (project.future_phase) {
+ state = 'future'
+ }
+ console.log(project)
return (
{
{!isMapTile && {project.district}}
{project.topics?.length > 0 &&
{project.title}
{project.description && !isMapTile && (
@@ -60,24 +74,39 @@ const ProjectTile = ({ project, isHorizontal, topicChoices, isMapTile }) => {
+ + + {project.published_projects_count} + {project.published_projects_count === 1 + ? participationProjectStr + : participationProjectsStr} +
+ )} + {state === 'past' &&{participationEndedStr}
} + {state === 'future' &&{beginsOnStr} {toLocaleDate(project.future_phase, undefined, { month: 'numeric', year: 'numeric', day: 'numeric' })}
} +