mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-03 21:34:59 +00:00
replace dropdown for selecting reasons and use chillEntity for reason rendering
This commit is contained in:
@@ -1,37 +1,4 @@
|
||||
services:
|
||||
chill.activity.form.type.translatableactivityreasoncategory:
|
||||
class: Chill\ActivityBundle\Form\Type\TranslatableActivityReasonCategory
|
||||
arguments:
|
||||
- "@request_stack"
|
||||
tags:
|
||||
- { name: form.type, alias: translatable_activity_reason_category }
|
||||
|
||||
chill.activity.form.type.translatableactivityreason:
|
||||
class: Chill\ActivityBundle\Form\Type\TranslatableActivityReason
|
||||
arguments:
|
||||
- "@chill.main.helper.translatable_string"
|
||||
tags:
|
||||
- { name: form.type, alias: translatable_activity_reason }
|
||||
|
||||
chill.activity.form.type.translatableactivitytype:
|
||||
class: Chill\ActivityBundle\Form\Type\TranslatableActivityType
|
||||
arguments:
|
||||
- "@chill.main.helper.translatable_string"
|
||||
- "@chill_activity.repository.activity_type"
|
||||
tags:
|
||||
- { name: form.type, alias: translatable_activity_type }
|
||||
|
||||
chill.activity.form.type.activity:
|
||||
class: Chill\ActivityBundle\Form\ActivityType
|
||||
arguments:
|
||||
- "@security.token_storage"
|
||||
- "@chill.main.security.authorization.helper"
|
||||
- "@doctrine.orm.entity_manager"
|
||||
- "@chill.main.helper.translatable_string"
|
||||
- "%chill_activity.form.time_duration%"
|
||||
tags:
|
||||
- { name: form.type, alias: chill_activitybundle_activity }
|
||||
|
||||
services:
|
||||
chill.activity.security.authorization.activity_voter:
|
||||
class: Chill\ActivityBundle\Security\Authorization\ActivityVoter
|
||||
arguments:
|
||||
|
35
Resources/config/services/form.yml
Normal file
35
Resources/config/services/form.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
services:
|
||||
chill.activity.form.type.translatableactivityreasoncategory:
|
||||
class: Chill\ActivityBundle\Form\Type\TranslatableActivityReasonCategory
|
||||
arguments:
|
||||
- "@request_stack"
|
||||
tags:
|
||||
- { name: form.type, alias: translatable_activity_reason_category }
|
||||
|
||||
chill.activity.form.type.translatableactivityreason:
|
||||
class: Chill\ActivityBundle\Form\Type\TranslatableActivityReason
|
||||
arguments:
|
||||
$translatableStringHelper: "@chill.main.helper.translatable_string"
|
||||
$reasonRender: '@Chill\ActivityBundle\Templating\Entity\ActivityReasonRender'
|
||||
tags:
|
||||
- { name: form.type, alias: translatable_activity_reason }
|
||||
|
||||
chill.activity.form.type.translatableactivitytype:
|
||||
class: Chill\ActivityBundle\Form\Type\TranslatableActivityType
|
||||
arguments:
|
||||
- "@chill.main.helper.translatable_string"
|
||||
- "@chill_activity.repository.activity_type"
|
||||
tags:
|
||||
- { name: form.type, alias: translatable_activity_type }
|
||||
|
||||
chill.activity.form.type.activity:
|
||||
class: Chill\ActivityBundle\Form\ActivityType
|
||||
arguments:
|
||||
- "@security.token_storage"
|
||||
- "@chill.main.security.authorization.helper"
|
||||
- "@doctrine.orm.entity_manager"
|
||||
- "@chill.main.helper.translatable_string"
|
||||
- "%chill_activity.form.time_duration%"
|
||||
tags:
|
||||
- { name: form.type, alias: chill_activitybundle_activity }
|
7
Resources/config/services/templating.yml
Normal file
7
Resources/config/services/templating.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
services:
|
||||
Chill\ActivityBundle\Templating\Entity\ActivityReasonRender:
|
||||
arguments:
|
||||
$translatableStringHelper: '@Chill\MainBundle\Templating\TranslatableStringHelper'
|
||||
tags:
|
||||
- { name: 'chill.render_entity' }
|
10
Resources/public/activity/activity.scss
Normal file
10
Resources/public/activity/activity.scss
Normal file
@@ -0,0 +1,10 @@
|
||||
@import '~ChillMainSass/custom/config/colors';
|
||||
@import '~ChillMainSass/custom/mixins/entity';
|
||||
|
||||
.chill-entity.chill-entity__activity-reason {
|
||||
@include entity($chill-pink, white);
|
||||
}
|
||||
|
||||
.activity {
|
||||
color: $chill-green;
|
||||
}
|
1
Resources/public/index.js
Normal file
1
Resources/public/index.js
Normal file
@@ -0,0 +1 @@
|
||||
require('./activity/activity.scss');
|
@@ -16,8 +16,6 @@
|
||||
#}
|
||||
{% extends "ChillPersonBundle::layout.html.twig" %}
|
||||
|
||||
{% import 'ChillActivityBundle:ActivityReason:macro.html.twig' as m %}
|
||||
|
||||
{% set activeRouteKey = 'chill_activity_activity_list' %}
|
||||
|
||||
{% block title %}{{ 'Activity list' |trans }}{% endblock title %}
|
||||
@@ -47,10 +45,15 @@
|
||||
<td>{% if activity.date %}{{ activity.date|localizeddate('long', 'none') }}{% endif %}</td>
|
||||
<td>{{ activity.durationTime|date('H:i') }}</td>
|
||||
<td>
|
||||
{% if activity.remark is not empty %}
|
||||
<blockquote class="chill-user-quote">
|
||||
{{ activity.remark|truncate(250, true) }}
|
||||
</blockquote>
|
||||
{% endif %}
|
||||
{%- if activity.reasons is empty -%}
|
||||
{{ 'No reason associated'|trans }}
|
||||
{%- else -%}
|
||||
{% for r in activity.reasons %}{{ m.reason(r) }} {% endfor %}
|
||||
{% for r in activity.reasons %}{{ r|chill_entity_render_box }} {% endfor %}
|
||||
{%- endif -%}
|
||||
</td>
|
||||
<td>{{ activity.type.name | localize_translatable_string }}</td>
|
||||
|
@@ -35,7 +35,7 @@
|
||||
{%- if entity.reasons is empty -%}
|
||||
<dd><span class="chill-no-data-statement">{{ 'No reason associated'|trans }}</span></dd>
|
||||
{%- else -%}
|
||||
<dd>{% for r in entity.reasons %}{{ m.reason(r) }} {% endfor %}</dd>
|
||||
<dd>{% for r in entity.reasons %}{{ r|chill_entity_render_box }} {% endfor %}</dd>
|
||||
{%- endif -%}
|
||||
|
||||
</dl>
|
||||
|
@@ -20,7 +20,7 @@
|
||||
{%- if activity.reasons is empty -%}
|
||||
<dd><span class="chill-no-data-statement">{{ 'No reason associated'|trans }}</span></dd>
|
||||
{%- else -%}
|
||||
<dd>{% for r in activity.reasons %}{{ m.reason(r) }} {% endfor %}</dd>
|
||||
<dd>{% for r in activity.reasons %}{{ r|chill_entity_render_box }} {% endfor %}</dd>
|
||||
{%- endif -%}
|
||||
|
||||
</dl>
|
||||
|
Reference in New Issue
Block a user