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

This commit is contained in:
Kevin MacMartin 2016-12-20 23:26:10 -05:00
parent 5336c21a93
commit 6ec9531074
3 changed files with 18 additions and 2 deletions

View file

@ -79,7 +79,7 @@ First add a function to generate the page:
* `heading`: The title that will appear for this page * `heading`: The title that will appear for this page
* `model`: The model that will be accessed on 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 * `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 * `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` * `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` * `create`: A `new` button will appear in the heading if this is set to `true`

View file

@ -249,6 +249,12 @@ body {
padding-top: 6px; padding-top: 6px;
padding-bottom: 6px; padding-bottom: 6px;
padding-left: 0px; padding-left: 0px;
font-family: "Lucida Console", Monaco, monospace;
.column {
float: left;
margin-right: 10px;
}
} }
.button-column { .button-column {

View file

@ -23,7 +23,17 @@
<i class="fa fa-bars sort-icon" title="Click and drag to reorder"></i> <i class="fa fa-bars sort-icon" title="Click and drag to reorder"></i>
@endif @endif
@if(is_array($column))
@foreach($column as $col)
<div class="column">{{ $row[$col] }}</div>
@if(!$loop->last)
<div class="column">|</div>
@endif
@endforeach
@else
{{ $row[$column] }} {{ $row[$column] }}
@endif
</div> </div>
<div class="col-xs-3 button-column"> <div class="col-xs-3 button-column">