Skip to content

Commit

Permalink
release(2.12.0): aggiunti alcuni template di amministrazione trasparente
Browse files Browse the repository at this point in the history
  • Loading branch information
arturu committed Jun 18, 2024
1 parent c877485 commit fc8ec92
Show file tree
Hide file tree
Showing 2 changed files with 140 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{#
/**
* @file
* Default theme implementation for a field.
*
* To override output, copy the "field.html.twig" from the templates directory
* to your theme's directory and customize it, just like customizing other
* Drupal templates such as page.html.twig or node.html.twig.
*
* Instead of overriding the theming for all fields, you can also just override
* theming for a subset of fields using
* @link themeable Theme hook suggestions. @endlink For example,
* here are some theme hook suggestions that can be used for a field_foo field
* on an article node type:
* - field--node--field-foo--article.html.twig
* - field--node--field-foo.html.twig
* - field--node--article.html.twig
* - field--field-foo.html.twig
* - field--text-with-summary.html.twig
* - field.html.twig
*
* Available variables:
* - attributes: HTML attributes for the containing element.
* - label_hidden: Whether to show the field label or not.
* - title_attributes: HTML attributes for the title.
* - label: The label for the field.
* - multiple: TRUE if a field can contain multiple items.
* - items: List of all the field items. Each item contains:
* - attributes: List of HTML attributes for each item.
* - content: The field item's content.
* - entity_type: The entity type to which the field belongs.
* - field_name: The name of the field.
* - field_type: The type of the field.
* - label_display: The display settings for the label.
* - field_container_vertical_padding: Automatic vertical padding.
* - field_container_vertical_margin: Automatic vertical margin.
* - field_view_mode: View mode.
*
* @see template_preprocess_field()
*
* @ingroup themeable
*/
#}
{% apply spaceless %}

{% set container_classes = [
'field',
'field--type-' ~ field_type|clean_class,
'field--name-' ~ field_name|clean_class,
'field--entity-' ~ entity_type|clean_class,
multiple ? 'field-multiple',
'field--label-' ~ label_display|clean_class,
field_view_mode ? 'field--view-mode-' ~ field_view_mode|clean_class,
'mb-5'
] %}

<div{{ attributes.addClass(container_classes) }}>
{% include '@bi-field/_partial.field-label.html.twig' with {
field_label_tag: 'h2',
field_label_bold: false,
field_label_separator: '',
title_attributes: title_attributes.addClass(['h4', 'fw-lighter', 'mb-0'])
} %}
<p>{{ 'Questa sezione contiene i seguenti obblighi di pubblicazione.' }}</p>

<div class="card-wrapper card-teaser-wrapper card-teaser-wrapper-3-col justify-content-start card-teaser-wrapper-equal">
{% for item in items %}
{{ item.content }}
{% endfor %}
</div>

</div>{# End main container. #}
{% endapply %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{#
/**
* @file
* Default theme implementation to display a taxonomy term.
*
* Available variables:
* - url: URL of the current term.
* - name: (optional) Name of the current term.
* - content: Items for the content of the term (fields and description).
* Use 'content' to print them all, or print a subset such as
* 'content.description'. Use the following code to exclude the
* printing of a given child element:
* @code
* {{ content|without('description') }}
* @endcode
* - attributes: HTML attributes for the wrapper.
* - page: Flag for the full page state.
* - term: The taxonomy term entity, including:
* - id: The ID of the taxonomy term.
* - bundle: Machine name of the current vocabulary.
* - view_mode: View mode, e.g. 'full', 'teaser', etc.
*
* @see template_preprocess_taxonomy_term()
*
* @ingroup themeable
*/
#}
{% apply spaceless %}
{% set _obbligo_pubblicazione = content.field_persona_responsabile[0] is iterable %}
{% embed '@bi-bcl/card/card.html.twig' with {
card_tag_container: 'article',
card_title: label,
card_text: content|without('field_persona_responsabile'),
card_shadow: true,
card_rounded: true,
card_teaser: true,
card_read_more_url: url,
card_read_more_label: 'Vai alle pubblicazioni'|t,
card_read_more_text: name[0]['#context'].value,

card_attributes: attributes
} %}
{% block cardTitle %}
{{ title_prefix }}
<h3{{ title_attributes.addClass(['card-title', 'h5', 'mb-5']) }}>
<a class="d-flex" href="{{ url }}" title="{{ 'Read more about:'|t }} {{ name[0]['#context'].value }}" rel="bookmark">
{% include '@bi-bcl/icon/icon.html.twig' with {
name: _obbligo_pubblicazione ? 'it-check' : 'icon-bookmark-solid',
size: 'xl',
color: _obbligo_pubblicazione ? 'greendark' : 'light',
icon_classes: ['me-4']
} %}
<span>
{{ name }}
{% if _obbligo_pubblicazione %}
<small class="text-greendark">Le scuole sono soggette a questo obbligo.</small>
{% else %}
<small class="text-muted">Non di pertinenza dell'istituzione scolastica.</small>
{% endif %}
</span>
</a>
</h3>
{{ title_suffix }}
{% endblock %}

{% endembed %}
{% endapply %}

0 comments on commit fc8ec92

Please sign in to comment.