From ba4e6668aadb5d3eb444b4e39316516a28a8d451 Mon Sep 17 00:00:00 2001 From: naomi Date: Sun, 5 Dec 2021 19:16:39 +0000 Subject: [PATCH] css and removing the "left" and "right" classes from templates --- css/opencase.css | 14 ++++++-------- modules/opencase_cases/src/Entity/OCCase.php | 10 ++-------- .../templates/oc_case.html.twig | 17 +++-------------- .../src/Entity/OCActivity.php | 4 ++-- .../templates/oc_activity.html.twig | 18 +++--------------- .../templates/oc_actor.html.twig | 19 +++---------------- 6 files changed, 19 insertions(+), 63 deletions(-) diff --git a/css/opencase.css b/css/opencase.css index 139f20a..3ba48e0 100644 --- a/css/opencase.css +++ b/css/opencase.css @@ -32,16 +32,14 @@ body { font-size: 100% !important; } -.field--type-entity-reference-revisions .field__items { - margin-left: 2em; +.field.field--type-entity-reference { + margin: inherit; } -.field--type-entity-reference-revisions .field__items .field{ - margin-top: 0; -} -.field--type-entity-reference-revisions .field__items .paragraph{ - margin-top: 0.5em; - margin-bottom: 0.5em; +.field { + width: 30%; + display: inline-block; + padding: 0.4em; } /* remove this confusing thing from user creation page */ diff --git a/modules/opencase_cases/src/Entity/OCCase.php b/modules/opencase_cases/src/Entity/OCCase.php index 6aad6a4..2b422b2 100644 --- a/modules/opencase_cases/src/Entity/OCCase.php +++ b/modules/opencase_cases/src/Entity/OCCase.php @@ -275,18 +275,12 @@ class OCCase extends RevisionableContentEntityBase implements OCCaseInterface { $fields['created'] = BaseFieldDefinition::create('created') ->setLabel(t('Created on')) ->setDescription(t('When the case was created.')) - ->setDisplayOptions('view', [ - 'label' => 'above', - 'weight' => 80, - ]); + ->setDisplayConfigurable('view', true); $fields['changed'] = BaseFieldDefinition::create('changed') ->setLabel(t('Last updated')) ->setDescription(t('When the case was last edited.')) - ->setDisplayOptions('view', [ - 'label' => 'above', - 'weight' => 80, - ]); + ->setDisplayConfigurable('view', true); $fields['revision_translation_affected'] = BaseFieldDefinition::create('boolean') ->setLabel(t('Revision translation affected')) diff --git a/modules/opencase_cases/templates/oc_case.html.twig b/modules/opencase_cases/templates/oc_case.html.twig index 50376f8..299f447 100644 --- a/modules/opencase_cases/templates/oc_case.html.twig +++ b/modules/opencase_cases/templates/oc_case.html.twig @@ -16,18 +16,7 @@ */ #} -

{{ title }}

-
-
- {{ base_fields.actors_involved }} - {{ base_fields.changed }} - {{ base_fields.created }} - {{ base_fields.user_id }} -
-
- {% for field in other_fields %} - {{ field }} - {% endfor %} -
-
+ {% if content %} + {{- content -}} + {% endif %} diff --git a/modules/opencase_entities/src/Entity/OCActivity.php b/modules/opencase_entities/src/Entity/OCActivity.php index b3a700b..c9c50af 100644 --- a/modules/opencase_entities/src/Entity/OCActivity.php +++ b/modules/opencase_entities/src/Entity/OCActivity.php @@ -246,10 +246,10 @@ class OCActivity extends RevisionableContentEntityBase implements OCActivityInte ->setSetting('target_type', 'user') ->setSetting('handler', 'default') ->setTranslatable(TRUE) + ->setDisplayConfigurable('view', true) ->setDisplayOptions('view', [ - 'label' => 'inline', + 'label' => 'above', 'type' => 'author', - 'weight' => -4, ]); $fields['name'] = BaseFieldDefinition::create('string') diff --git a/modules/opencase_entities/templates/oc_activity.html.twig b/modules/opencase_entities/templates/oc_activity.html.twig index e37bb16..20fa995 100644 --- a/modules/opencase_entities/templates/oc_activity.html.twig +++ b/modules/opencase_entities/templates/oc_activity.html.twig @@ -16,19 +16,7 @@ */ #} -

{{ title }}

-
-
- {{ base_fields.actors_involved }} - {{ base_fields.activity_date_time }} - {{ base_fields.description }} - {{ base_fields.time_taken }} - {{ base_fields.user_id }} -
-
- {% for field in other_fields %} - {{ field }} - {% endfor %} -
-
+ {% if content %} + {{- content -}} + {% endif %} diff --git a/modules/opencase_entities/templates/oc_actor.html.twig b/modules/opencase_entities/templates/oc_actor.html.twig index a04e68d..e92f6da 100644 --- a/modules/opencase_entities/templates/oc_actor.html.twig +++ b/modules/opencase_entities/templates/oc_actor.html.twig @@ -16,20 +16,7 @@ */ #} -
-
- {% for field in fields_other_than_contact_details %} - {{ field }} - {% endfor %} -
-
-
-

Contact Details

- See history - {% for field in contact_details %} - {{ field }} - {% endfor %} -
-
-
+ {% if content %} + {{- content -}} + {% endif %}