From 2a6615975f5580e8385d2f7b8f4ad705c26558d0 Mon Sep 17 00:00:00 2001 From: Yannick ROGER Date: Tue, 24 Jan 2017 16:33:22 +0100 Subject: [PATCH] EZP-26734: Accordion on main titles of ContentTypeView --- .../public/css/theme/views/serverside.css | 41 +++++++++++ Resources/translations/content_type.en.xlf | 62 +++++++++------- .../ContentType/view_content_type.html.twig | 73 +++++++++++-------- 3 files changed, 119 insertions(+), 57 deletions(-) diff --git a/Resources/public/css/theme/views/serverside.css b/Resources/public/css/theme/views/serverside.css index 34c5dee59..afc9713da 100644 --- a/Resources/public/css/theme/views/serverside.css +++ b/Resources/public/css/theme/views/serverside.css @@ -18,12 +18,53 @@ background: #FAFAFA; } +/* Hide marker on Safari and chrome */ +.ez-view-serversideview .ez-contenttype-view .ez-contenttype-summary::-webkit-details-marker { + display: none; +} + +.ez-view-serversideview .ez-contenttype-view .ez-contenttype-title { + font-size: 1.8em; +} + +.ez-view-serversideview .ez-contenttype-view .ez-contenttype-subtitle { + font-size: 1.17em; +} + +.ez-view-serversideview .ez-contenttype-view .ez-field-definition-info { + margin-left: 1em; +} + +.ez-view-serversideview .ez-contenttype-view .ez-field-definition-info-title { + color: #2b84b1; + cursor: pointer; + outline: none; + margin-bottom: 1em; +} + .ez-view-serversideview .ez-contenttype-view .ez-contenttype-title, .ez-view-serversideview .ez-contenttype-view .ez-contenttype-subtitle { background: transparent; color: #2b84b1; border: none; + outline: none; + cursor: pointer; + margin-top: 0.5em; + margin-bottom: 0.5em; border-bottom: 1px solid #2b84b1; + + /* Hide marker on Firefox */ + list-style-type: none; +} + +.ez-view-serversideview .ez-contenttype-view summary::after { + content: '\e605'; + vertical-align: bottom; +} + +.ez-view-serversideview .ez-contenttype-view details[open] > summary::after { + content: '\e602'; + vertical-align: bottom; } .ez-view-serversideview .ez-contenttype-view .ez-contenttype-metadata { diff --git a/Resources/translations/content_type.en.xlf b/Resources/translations/content_type.en.xlf index 9beca1a95..6dc677e25 100644 --- a/Resources/translations/content_type.en.xlf +++ b/Resources/translations/content_type.en.xlf @@ -1,6 +1,6 @@ - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. @@ -10,13 +10,13 @@ Container Can contain sub-items key: content_type.container - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig Content field definitions Content field definitions key: content_type.content.title - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig Content types @@ -33,43 +33,43 @@ Default availability in primary language, if translation is absent Default availability in primary language, if translation is absent key: content_type.default_availability - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig Default availability in primary language, if translation is absent Default availability in primary language, if translation is absent key: content_type.default_availability.help - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig {0} Not available|{1} Available {0} Not available|{1} Available key: content_type.default_availability.value - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig Default property for sorting chilren Default children sorting key: content_type.default_children_sorting - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig Default sort order Default sort order key: content_type.default_sort - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig Description Description key: content_type.description - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig Edit Edit key: content_type.edit - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig /Resources/views/ContentType/view_content_type_group.html.twig /Resources/views/ContentType/view_content_type_group.html.twig @@ -77,7 +77,7 @@ Edit Edit key: content_type.edit_title - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig Content type group @@ -172,14 +172,14 @@ Identifier Identifier key: content_type.identifier - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig /Resources/views/ContentType/view_content_type_group.html.twig The content type cannot be deleted because it has content items, or because you don't have permission. The content type cannot be deleted because it has content items, or because you don't have permission. key: content_type.is_in_use - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig /Resources/views/ContentType/view_content_type_group.html.twig @@ -193,7 +193,7 @@ Global properties Global properties key: content_type.metadata.title - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig Modification date @@ -205,14 +205,14 @@ Name Name key: content_type.name - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig /Resources/views/ContentType/view_content_type_group.html.twig Content name schema Content name schema key: content_type.name_schema - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig The Content type "%contentTypeName%" was successfully deleted. @@ -242,58 +242,64 @@ URL alias name pattern URL alias name pattern key: content_type.url_alias_schema - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig Description Description key: field_definition.description - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig Identifier Identifier key: field_definition.identifier - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig + + + Additional Information + Additional Information + key: field_definition.info + /Resources/views/ContentType/view_content_type.html.twig Name Name key: field_definition.name - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig Required Required key: field_definition.required - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig Searchable Searchable key: field_definition.searchable - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig Translatable Translatable key: field_definition.translatable - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig Type Type key: field_definition.type - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig {0} No|{1} Yes {0} No|{1} Yes key: yes_no - /Resources/views/ContentType/view_content_type.html.twig - /Resources/views/ContentType/view_content_type.html.twig - /Resources/views/ContentType/view_content_type.html.twig - /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig + /Resources/views/ContentType/view_content_type.html.twig diff --git a/Resources/views/ContentType/view_content_type.html.twig b/Resources/views/ContentType/view_content_type.html.twig index dbeba5593..8d4ddb24a 100644 --- a/Resources/views/ContentType/view_content_type.html.twig +++ b/Resources/views/ContentType/view_content_type.html.twig @@ -33,8 +33,11 @@ }}

-
-

{{ 'content_type.metadata.title'|trans|desc("Global properties")}}

+
+ + {{ 'content_type.metadata.title'|trans|desc("Global properties")}} + + -
+ -
-

{{ 'content_type.content.title'|trans|desc('Content field definitions') }}

+
+ + {{ 'content_type.content.title'|trans|desc('Content field definitions') }} + {% for group, field_definitions in fielddefinitions_by_group %} -
-

{{ group|trans([], 'ezplatform_fields_groups') }}

+ +
+ + {{ group|trans([], 'ezplatform_fields_groups') }} + + @@ -103,34 +112,40 @@ {% endfor %}
-
    -
  • -
    {{ 'field_definition.description'|trans|desc("Description") }}
    -
    {#{ field_definition.description(language_code) }#}
    -
  • -
  • -
    {{ 'field_definition.required'|trans|desc("Required") }}
    -
    {{ 'yes_no'|transchoice(field_definition.isRequired)|desc("{0} No|{1} Yes") }}
    -
  • -
  • -
    {{ 'field_definition.searchable'|trans|desc("Searchable") }}
    -
    {{ 'yes_no'|transchoice(field_definition.isSearchable)|desc("{0} No|{1} Yes") }}
    -
  • -
  • -
    {{ 'field_definition.translatable'|trans|desc("Translatable") }}
    -
    {{ 'yes_no'|transchoice(field_definition.isTranslatable)|desc("{0} No|{1} Yes") }}
    -
  • -
- - {{ ez_render_fielddefinition_settings(field_definition) }} +
+ + {{ "field_definition.info"|trans|desc("Additional Information") }} + +
    +
  • +
    {{ 'field_definition.description'|trans|desc("Description") }}
    +
    {#{ field_definition.description(language_code) }#}
    +
  • +
  • +
    {{ 'field_definition.required'|trans|desc("Required") }}
    +
    {{ 'yes_no'|transchoice(field_definition.isRequired)|desc("{0} No|{1} Yes") }}
    +
  • +
  • +
    {{ 'field_definition.searchable'|trans|desc("Searchable") }}
    +
    {{ 'yes_no'|transchoice(field_definition.isSearchable)|desc("{0} No|{1} Yes") }}
    +
  • +
  • +
    {{ 'field_definition.translatable'|trans|desc("Translatable") }}
    +
    {{ 'yes_no'|transchoice(field_definition.isTranslatable)|desc("{0} No|{1} Yes") }}
    +
  • +
+ + {{ ez_render_fielddefinition_settings(field_definition) }} + +
-
+
{% endfor %} -
+
{% if can_edit %}