From 6ec9531074abc6eb020aff71f6f58f2060222698 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Tue, 20 Dec 2016 23:26:10 -0500 Subject: [PATCH] Allow edit-list title-columns to be specified as arrays for multiple items and use monospaced fonts so the same number of characters will take the same amount of space --- readme.md | 2 +- resources/assets/sass/dashboard.scss | 6 ++++++ resources/views/dashboard/edit-list.blade.php | 12 +++++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 44e494a..62818c5 100644 --- a/readme.md +++ b/readme.md @@ -79,7 +79,7 @@ First add a function to generate the page: * `heading`: The title that will appear for this page * `model`: The model that will be accessed on this page * `rows`: A function returning an array containing the data to be shown on this page -* `column`: The column name in the array that contains the data to display in each row +* `column`: The column name in the array that contains the data to display in each row (an array can be used to specify multiple columns) * `sortcol`: The name of the column containing the sort order or `false` to disable * `delete`: A `delete` button will appear in the list if this is set to `true` * `create`: A `new` button will appear in the heading if this is set to `true` diff --git a/resources/assets/sass/dashboard.scss b/resources/assets/sass/dashboard.scss index e95db6e..1f3838d 100644 --- a/resources/assets/sass/dashboard.scss +++ b/resources/assets/sass/dashboard.scss @@ -249,6 +249,12 @@ body { padding-top: 6px; padding-bottom: 6px; padding-left: 0px; + font-family: "Lucida Console", Monaco, monospace; + + .column { + float: left; + margin-right: 10px; + } } .button-column { diff --git a/resources/views/dashboard/edit-list.blade.php b/resources/views/dashboard/edit-list.blade.php index 2d9d1a7..1a1bc3a 100644 --- a/resources/views/dashboard/edit-list.blade.php +++ b/resources/views/dashboard/edit-list.blade.php @@ -23,7 +23,17 @@ @endif - {{ $row[$column] }} + @if(is_array($column)) + @foreach($column as $col) +
{{ $row[$col] }}
+ + @if(!$loop->last) +
|
+ @endif + @endforeach + @else + {{ $row[$column] }} + @endif