Browse Source

nouveau nom et légende

master
vincent 3 months ago
parent
commit
6a52faed97
5 changed files with 24 additions and 3 deletions
  1. +3
    -1
      config/packages/twig.yaml
  2. +2
    -0
      config/services.yaml
  3. +10
    -1
      src/Service/TaskLifecycleManager.php
  4. +1
    -1
      templates/home/index.html.twig
  5. +8
    -0
      templates/macro.html.twig

+ 3
- 1
config/packages/twig.yaml View File

@ -2,12 +2,14 @@ twig:
file_name_pattern: '*.twig'
form_themes: ['bootstrap_5_layout.html.twig']
globals:
title: Gestionnaire de tâches simple
title: '%short_title%'
menu:
header:
- { route: 'app_project', label: 'Projets', icon: '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-folder" viewBox="0 0 16 16"><path d="M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181l-.637 7A2 2 0 0 1 13.174 14H2.826a2 2 0 0 1-1.991-1.819l-.637-7a2 2 0 0 1 .342-1.31zM2.19 4a1 1 0 0 0-.996 1.09l.637 7a1 1 0 0 0 .995.91h10.348a1 1 0 0 0 .995-.91l.637-7A1 1 0 0 0 13.81 4zm4.69-1.707A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981l.006.139q.323-.119.684-.12h5.396z"/></svg>' }
taskLifecycleManager: '@App\Service\TaskLifecycleManager'
geoJsonManager: '@App\Service\GeoJsonManager'
short_title: '%short_title%'
long_title: '%long_title%'
when@test:
twig:


+ 2
- 0
config/services.yaml View File

@ -5,6 +5,8 @@
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
parameters:
timezone: '%env(APP_TIMEZONE)%'
short_title: 'OMO'
long_title: 'Outil de Manipulation et d’Organisation'
services:
# default configuration for services in *this* file


+ 10
- 1
src/Service/TaskLifecycleManager.php View File

@ -3,6 +3,7 @@
namespace App\Service;
use App\Entity\Project;
use App\Entity\Task;
use Symfony\Component\Workflow\WorkflowInterface;
class TaskLifecycleManager
@ -13,8 +14,16 @@ class TaskLifecycleManager
) {
}
public function getProjectStats(Project $project)
public function getProjectStats($entity)
{
if ($entity instanceof Project) {
$project = $entity;
} elseif ($entity instanceof Task) {
$project = $entity->getProject();
} else {
throw new \RuntimeException();
}
$stats = [];
$places = $this->taskLifecycleStateMachine->getDefinition()->getPlaces();


+ 1
- 1
templates/home/index.html.twig View File

@ -2,7 +2,7 @@
{% block page_content %}
<div class="px-4 py-5 my-5 text-center">
<h1 class="display-5 fw-bold text-body-emphasis">Gestionnaire de tâches simple</h1>
<h1 class="display-5 fw-bold text-body-emphasis">{{ long_title }}</h1>
<div class="col-lg-6 mx-auto">
<p class="lead mb-4">L’idée c’est d’avoir un petit outil collaboratif simple et facile à administrer/utiliser pour mapper des trucs de façon coordonnée à un endroit.</p>
<div class="d-grid gap-2 d-sm-flex justify-content-sm-center">


+ 8
- 0
templates/macro.html.twig View File

@ -31,4 +31,12 @@
{% endif %}
data-map-icon-value="{{ asset('images/marker.svg') }}"
></div>
<details>
<summary>Légende</summary>
<span class="badge bg-info">Overpass</span>
{% set stats = taskLifecycleManager.getProjectStats(entity) %}
{% for place, data in stats %}
<span class="badge {{ 'bg-' ~ data.color }}">{{ data.title }}</span>
{% endfor %}
</details>
{% endmacro %}

Loading…
Cancel
Save