admin display improvements

This commit is contained in:
2026-09-23 21:14:58 +02:00
parent 0e59bf5129
commit 5bb35aa1ec
4 changed files with 61 additions and 4 deletions
@@ -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%; }
@@ -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: {}
@@ -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';
}
}