mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
activity list: badges for issues, actions and reasons
This commit is contained in:
@@ -28,7 +28,7 @@ div.activity-list {
|
||||
div.item-row.main {
|
||||
div.item-col {
|
||||
&:first-child {
|
||||
flex-basis: 27%;
|
||||
flex-basis: 15%;
|
||||
}
|
||||
ul.list-content {
|
||||
li.social-issues, li.social-actions {
|
||||
@@ -127,3 +127,13 @@ div.flex-bloc.concerned-groups {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// CHILL ENTITY RENDER BOX
|
||||
.chill-entity {
|
||||
|
||||
/// ACTIVITY-REASON
|
||||
&.entity-activity-reason {
|
||||
margin-right: 0.3em;
|
||||
font-size: 120%;
|
||||
}
|
||||
}
|
||||
|
@@ -50,7 +50,8 @@
|
||||
<ul class="list-content">
|
||||
{% if activity.user and t.userVisible %}
|
||||
<li>
|
||||
<b>{{ 'by'|trans }}{{ activity.user.usernameCanonical }}</b>
|
||||
<abbr class="referrer" title="{{ 'Referrer'|trans }}">ref:</abbr>
|
||||
<b>{{ activity.user.usernameCanonical }}</b>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
@@ -98,7 +99,7 @@
|
||||
<li class="social-actions">
|
||||
{%- if activity.socialActions is not empty -%}
|
||||
{% for r in activity.socialActions %}
|
||||
<span class="badge bg-primary">{{ r.title|localize_translatable_string }}</span>
|
||||
{{ r|chill_entity_render_box }}
|
||||
{% endfor %}
|
||||
{%- endif -%}
|
||||
</li>
|
||||
@@ -133,6 +134,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#
|
||||
{% if activity.comment.comment is not empty
|
||||
or activity.persons|length > 0
|
||||
or activity.thirdParties|length > 0
|
||||
@@ -140,7 +142,11 @@
|
||||
%}
|
||||
<div class="item-row details">
|
||||
<div class="item-col">
|
||||
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {'context': context, 'with_display': 'row', 'entity': activity } %}
|
||||
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {
|
||||
'context': context,
|
||||
'with_display': 'row',
|
||||
'entity': activity
|
||||
} %}
|
||||
</div>
|
||||
|
||||
{% if activity.comment.comment is not empty %}
|
||||
@@ -154,6 +160,7 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
#}
|
||||
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
@@ -35,35 +35,37 @@ class ActivityReasonRender extends AbstractChillEntityRender
|
||||
* @var TranslatableStringHelper
|
||||
*/
|
||||
protected $translatableStringHelper;
|
||||
|
||||
|
||||
public function __construct(TranslatableStringHelper $translatableStringHelper)
|
||||
{
|
||||
$this->translatableStringHelper = $translatableStringHelper;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function renderBox($entity, array $options): string
|
||||
{
|
||||
return
|
||||
$this->getDefaultOpeningBox('activity-reason').
|
||||
'<span class="badge bg-chill-pink">'.
|
||||
'<i class="fa fa-question-circle"></i> '.
|
||||
'<span class="activity-reason__category">'.
|
||||
'<span class="category">'.
|
||||
$this->translatableStringHelper->localize(
|
||||
$entity->getCategory()->getName()
|
||||
).
|
||||
'</span>'.
|
||||
'<span class="activity-reason__separator"> > </span>'.
|
||||
'<span class="activity-reason__reason">'.
|
||||
'<span class="separator"> > </span>'.
|
||||
'<span class="reason">'.
|
||||
$this->translatableStringHelper->localize(
|
||||
$entity->getName()
|
||||
).
|
||||
'</span>'.
|
||||
'</span>'.
|
||||
$this->getDefaultClosingBox()
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param ActivityReason $entity
|
||||
* @param array $options
|
||||
* @return string
|
||||
@@ -71,12 +73,12 @@ class ActivityReasonRender extends AbstractChillEntityRender
|
||||
public function renderString($entity, array $options): string
|
||||
{
|
||||
$category = '';
|
||||
|
||||
|
||||
if (null !== $entity->getCategory()) {
|
||||
$category = $this->translatableStringHelper->localize(
|
||||
$entity->getCategory()->getName()). ' > ';
|
||||
}
|
||||
|
||||
|
||||
return $category .
|
||||
$this->translatableStringHelper->localize(
|
||||
$entity->getName()
|
||||
|
Reference in New Issue
Block a user