mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-03 21:34:59 +00:00
An activity may have multiple reasons
The relationship between Activity and Reasons is now many-to-many. Some improvement in show activity layout. refs #4 #7
This commit is contained in:
@@ -18,12 +18,23 @@
|
||||
|
||||
{% set activeRouteKey = 'chill_activity_activity_list' %}
|
||||
|
||||
{% block title %}{{ 'Activity edit' |trans }}{% endblock title %}
|
||||
{% block title 'Update activity'|trans %}
|
||||
|
||||
{% block personcontent %}
|
||||
<h1>{{ "Update activity"|trans }}</h1>
|
||||
|
||||
{{ form_start(edit_form) }}
|
||||
|
||||
{{ form_row(edit_form.user) }}
|
||||
{{ form_row(edit_form.scope) }}
|
||||
|
||||
<h2>{{ 'Activity data'|trans }}</h2>
|
||||
{{ form_row(edit_form.date) }}
|
||||
{{ form_row(edit_form.durationTime) }}
|
||||
{{ form_row(edit_form.remark) }}
|
||||
{{ form_row(edit_form.attendee) }}
|
||||
{{ form_row(edit_form.reasons) }}
|
||||
{{ form_row(edit_form.type) }}
|
||||
|
||||
{{ form_widget(edit_form) }}
|
||||
<div class="grid-12 centered sticky-form-buttons">
|
||||
|
@@ -16,6 +16,8 @@
|
||||
#}
|
||||
{% 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 %}
|
||||
@@ -26,10 +28,9 @@
|
||||
<tr>
|
||||
<th class="chill-red">{{'Date' | trans }}</th>
|
||||
<th class="chill-green">{{'Duration Time' | trans }}</th>
|
||||
<th class="chill-orange">{{'Reason' | trans}}</th>
|
||||
<th class="chill-orange">{{'Reasons' | trans}}</th>
|
||||
<th>{{'Type' | trans}}</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -37,13 +38,22 @@
|
||||
<tr>
|
||||
<td>{% if activity.date %}{{ activity.date|localizeddate('long', 'none') }}{% endif %}</td>
|
||||
<td>{{ activity.durationTime|date('H:i') }}</td>
|
||||
<td>{{ activity.reason.name | localize_translatable_string }}</td>
|
||||
<td>
|
||||
{%- if activity.reasons is empty -%}
|
||||
{{ 'No reason associated'|trans }}
|
||||
{%- else -%}
|
||||
{% for r in activity.reasons %}{{ m.reason(r) }} {% endfor %}
|
||||
{%- endif -%}
|
||||
</td>
|
||||
<td>{{ activity.type.name | localize_translatable_string }}</td>
|
||||
<td>
|
||||
<a href="{{ path('chill_activity_activity_show', { 'id': activity.id, 'person_id': person.id }) }}" class="sc-button black">{{ 'Show' | trans }}</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ path('chill_activity_activity_edit', { 'id': activity.id, 'person_id': person.id }) }}" class="sc-button bt-update">{{ 'Edit' | trans }}</a>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ path('chill_activity_activity_show', { 'id': activity.id, 'person_id': person.id }) }}" class="sc-button">{{ 'show'|trans|capitalize }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ path('chill_activity_activity_edit', { 'id': activity.id, 'person_id': person.id }) }}" class="sc-button bt-update">{{ 'Edit' | trans }}</a>
|
||||
</li>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
@@ -2,28 +2,43 @@
|
||||
|
||||
{% set activeRouteKey = 'chill_activity_activity_list' %}
|
||||
|
||||
{% block title 'Activity'|trans %}
|
||||
|
||||
{% import 'ChillActivityBundle:ActivityReason:macro.html.twig' as m %}
|
||||
|
||||
{% block personcontent -%}
|
||||
<h2 class="chill-red">{{ "Activity"|trans }}</h1>
|
||||
<h1 >{{ "Activity"|trans }}</h1>
|
||||
|
||||
<dl>
|
||||
<dt class="inline">{{ 'Person'|trans }}</dt>
|
||||
<dd>{{ entity.person }}</dd>
|
||||
<dl class="chill_view_data">
|
||||
<dt class="inline">{{ 'User'|trans }}</dt>
|
||||
<dd>{{ entity.user }}</dd>
|
||||
<dt class="inline">{{ 'Scope'|trans }}</dt>
|
||||
<dd><span class="scope">{{ entity.scope.name|localize_translatable_string }}</span></dd>
|
||||
|
||||
<h2 class="chill-red">{{ 'Activity data'|trans }}</h2>
|
||||
<dt class="inline">{{ 'Person'|trans }}</dt>
|
||||
<dd>{{ entity.person }}</dd>
|
||||
|
||||
<dt class="inline">{{ 'Date'|trans }}</dt>
|
||||
<dd>{{ entity.date|localizeddate('long', 'none') }}</dd>
|
||||
<dt class="inline">{{ 'Duration Time'|trans }}</dt>
|
||||
<dd>{{ entity.durationTime|date('H:i') }}</dd>
|
||||
<dt class="inline">{{ 'User'|trans }}</dt>
|
||||
<dd>{{ entity.user }}</dd>
|
||||
<dt class="inline">{{ 'Reason'|trans }}</dt>
|
||||
<dd>{{ entity.reason.name | localize_translatable_string }}</dd>
|
||||
<dt class="inline">{{ 'Type'|trans }}</dt>
|
||||
<dd>{{ entity.type.name | localize_translatable_string }}</dd>
|
||||
<dt class="inline">{{ 'Remark'|trans }}</dt>
|
||||
<dd>{% if entity.remark is empty %}{{ 'No remarks'|trans }}{% else %}<blockquote class="chill-user-quote">{{ entity.remark|nl2br }}</blockquote>{% endif %}</dd>
|
||||
|
||||
<dt class="inline">{{ 'Attendee'|trans }}</dt>
|
||||
<dd>{% if entity.attendee is not null %}{% if entity.attendee %}{{ 'present'|trans|capitalize }} {% else %} {{ 'not present'|trans|capitalize }}{% endif %}{% else %}{{ 'None'|trans|capitalize }}{% endif %}</dd>
|
||||
<dt class="inline">{{ 'Remark'|trans }}</dt>
|
||||
<dd>{% if entity.remark is empty %}{{ 'No remarks'|trans }}{% else %}<pre>{{ entity.remark }}</pre>{% endif %}</dd>
|
||||
|
||||
<dt class="inline">{{ 'Reasons'|trans }}</dt>
|
||||
{%- 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>
|
||||
{%- endif -%}
|
||||
|
||||
<dt class="inline">{{ 'Type'|trans }}</dt>
|
||||
<dd>{{ entity.type.name | localize_translatable_string }}</dd>
|
||||
|
||||
<dt class="inline">{{ ''|trans }}</dt>
|
||||
<dd></dd>
|
||||
<dt class="inline">{{ ''|trans }}</dt>
|
||||
|
3
Resources/views/ActivityReason/macro.html.twig
Normal file
3
Resources/views/ActivityReason/macro.html.twig
Normal file
@@ -0,0 +1,3 @@
|
||||
{%- macro reason(r) -%}
|
||||
<span class="entity entity-activity activity-reason"><i class="fa fa-question-circle"></i> {{ r.name | localize_translatable_string }}</span>
|
||||
{%- endmacro -%}
|
Reference in New Issue
Block a user