From fbb154b93a7017979174daf26cc77a1efaa3d5e5 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Tue, 9 Nov 2010 04:59:14 -0500 Subject: [PATCH] improve :first-child hack --- metaform/style.css | 19 +++++++++++++++++-- metaform/template.php | 6 +++--- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/metaform/style.css b/metaform/style.css index ded770c..8d31357 100644 --- a/metaform/style.css +++ b/metaform/style.css @@ -26,11 +26,26 @@ div.error { background: #fdd; } -:first-child, .first { +/* hack so that vertical margins are only between siblings for the most part */ +td > :first-child, +th > :first-child, +legend + :first-child, +article > :first-child, +section > :first-child, +nav > :first-child, +div > :first-child, +.first { padding-top: 0px; margin-top: 0px; } -:last-child, .last { +td > :last-child, +th > :last-child, +fieldset > :last-child, +article > :last-child, +section > :last-child, +nav > :last-child, +div > :last-child, +.last { padding-bottom: 0px; margin-bottom: 0px; } diff --git a/metaform/template.php b/metaform/template.php index 1bb7e65..bb85036 100644 --- a/metaform/template.php +++ b/metaform/template.php @@ -90,12 +90,12 @@ function ~file_name~_display_main() { message('Error: Broken link'); return './~file_name~'; } - $row = db_get_assoc('~table_name~', 'id,'.~file_name upper~_DB_FIELDS, 'where id=%i', $id); - if(!$row) { + $data = db_get_assoc('~table_name~', 'id,'.~file_name upper~_DB_FIELDS, 'where id=%i', $id); + if(!$data) { message('Error: ~singular cap~ not found'); return './~file_name~'; } - tem_set('display', $row); + tem_set('display', $data); } function ~file_name~_edit_main() { -- 1.7.10.4