diff --git a/config/sync/views.view.admin_nodes.yml b/config/sync/views.view.admin_nodes.yml index c05ef048..9fa60cda 100644 --- a/config/sync/views.view.admin_nodes.yml +++ b/config/sync/views.view.admin_nodes.yml @@ -3170,8 +3170,8 @@ display: click_sort_column: value type: timestamp settings: - date_format: html_date - custom_date_format: '' + date_format: custom + custom_date_format: y-m-d timezone: '' tooltip: date_format: '' @@ -3182,6 +3182,7 @@ display: past_format: '@interval ago' granularity: 2 refresh: 60 + description: '' group_column: value group_columns: { } group_rows: true @@ -3246,8 +3247,8 @@ display: click_sort_column: value type: timestamp settings: - date_format: html_date - custom_date_format: '' + date_format: custom + custom_date_format: y-m-d timezone: '' tooltip: date_format: '' @@ -3258,6 +3259,7 @@ display: past_format: '@interval ago' granularity: 2 refresh: 60 + description: '' group_column: value group_columns: { } group_rows: true diff --git a/web/modules/custom/materio_admin/css/admin-tables.css b/web/modules/custom/materio_admin/css/admin-tables.css new file mode 100644 index 00000000..a0f0d0a2 --- /dev/null +++ b/web/modules/custom/materio_admin/css/admin-tables.css @@ -0,0 +1,37 @@ +/** + * Admin views tables: compact paddings + width constraint. + * + * Transposed from the retired matminimal theme, adapted for Gin. + */ + +/* General: compact paddings on all admin views tables. */ +.views-table th, +.views-table td { + padding: 0.3rem 0.45rem; +} +.views-table td { + vertical-align: top; + overflow-wrap: anywhere; +} + +/* Hard constraint for the materials admin view: fixed layout forces the + table to fit 100% of the available width, whatever the content. + Column widths must sum to 100%. */ +.view-id-admin_nodes .views-table { + table-layout: fixed; + width: 100%; +} +.view-id-admin_nodes .views-table th.views-field-views-bulk-operations-bulk-form { width: 2.5%; } +.view-id-admin_nodes .views-table th.views-field-title { width: 8%; } +.view-id-admin_nodes .views-table th.views-field-field-thesaurus { width: 9%; } +.view-id-admin_nodes .views-table th.views-field-field-tags { width: 9%; } +.view-id-admin_nodes .views-table th.views-field-field-manufacturer { width: 7%; } +.view-id-admin_nodes .views-table th.views-field-field-linked-materials { width: 8%; } +.view-id-admin_nodes .views-table th.views-field-field-linked-articles { width: 8%; } +.view-id-admin_nodes .views-table th.views-field-field-samples { width: 6%; } +.view-id-admin_nodes .views-table th.views-field-field-attachments { width: 6%; } +.view-id-admin_nodes .views-table th.views-field-field-workflow { width: 6%; } +.view-id-admin_nodes .views-table th.views-field-field-memo { width: 16%; } +.view-id-admin_nodes .views-table th.views-field-changed { width: 6%; } +.view-id-admin_nodes .views-table th.views-field-created { width: 6%; } +.view-id-admin_nodes .views-table th.views-field-field-index { width: 2.5%; } diff --git a/web/modules/custom/materio_admin/materio_admin.libraries.yml b/web/modules/custom/materio_admin/materio_admin.libraries.yml index 5bf23ca8..716c14b5 100644 --- a/web/modules/custom/materio_admin/materio_admin.libraries.yml +++ b/web/modules/custom/materio_admin/materio_admin.libraries.yml @@ -3,3 +3,9 @@ term_reference_tree: css: theme: css/term-reference-tree.css: {} + +admin_tables: + version: 1.0 + css: + theme: + css/admin-tables.css: {} diff --git a/web/modules/custom/materio_admin/materio_admin.module b/web/modules/custom/materio_admin/materio_admin.module index 199bf6af..b3d1fd4b 100644 --- a/web/modules/custom/materio_admin/materio_admin.module +++ b/web/modules/custom/materio_admin/materio_admin.module @@ -23,3 +23,15 @@ function materio_admin_field_widget_single_element_form_alter(array &$element, \ $element['#attached']['library'][] = 'materio_admin/term_reference_tree'; } } + +/** + * Implements hook_page_attachments(). + * + * Loads the general admin table styling on every admin route (compact + * paddings + constrained widths, replacing the old matminimal rules). + */ +function materio_admin_page_attachments(array &$attachments) { + if (\Drupal::service('router.admin_context')->isAdminRoute()) { + $attachments['#attached']['library'][] = 'materio_admin/admin_tables'; + } +}