diff --git a/css/GridField.css b/css/GridField.css index d17ce34a2..3cd59c8bb 100644 --- a/css/GridField.css +++ b/css/GridField.css @@ -76,6 +76,7 @@ .cms table.ss-gridfield-table tr th span.non-sortable { padding: 1em 1em; display: block; } .cms table.ss-gridfield-table tr td { border-right: 1px solid rgba(0, 0, 0, 0.1); padding: 6.4px 12px; color: #666666; } .cms table.ss-gridfield-table tr td.bottom-all { -moz-border-radius-bottomleft: 7px; -webkit-border-bottom-left-radius: 7px; -o-border-bottom-left-radius: 7px; -ms-border-bottom-left-radius: 7px; -khtml-border-bottom-left-radius: 7px; border-bottom-left-radius: 7px; -moz-border-radius-bottomright: 7px; -webkit-border-bottom-right-radius: 7px; -o-border-bottom-right-radius: 7px; -ms-border-bottom-right-radius: 7px; -khtml-border-bottom-right-radius: 7px; border-bottom-right-radius: 7px; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #b1c0c5), color-stop(100%, #7f9198)); background-image: -webkit-linear-gradient(#b1c0c5, #7f9198); background-image: -moz-linear-gradient(#b1c0c5, #7f9198); background-image: -o-linear-gradient(#b1c0c5, #7f9198); background-image: -ms-linear-gradient(#b1c0c5, #7f9198); background-image: linear-gradient(#b1c0c5, #7f9198); } +.cms table.ss-gridfield-table tr td.bottom-all .datagrid-footer-message { text-align: center; padding-top: 6px; color: white; } .cms table.ss-gridfield-table tr td.bottom-all .datagrid-pagination { padding-top: 2px; position: absolute; left: 50%; margin-left: -116px; } .cms table.ss-gridfield-table tr td.bottom-all .datagrid-pagination .pagination-page-number { color: white; } .cms table.ss-gridfield-table tr td.bottom-all .datagrid-pagination .pagination-page-number input { width: 35px; height: 18px; margin-bottom: -6px; padding: 0px; } diff --git a/forms/gridfield/GridFieldFooter.php b/forms/gridfield/GridFieldFooter.php new file mode 100644 index 000000000..b9baaeb89 --- /dev/null +++ b/forms/gridfield/GridFieldFooter.php @@ -0,0 +1,42 @@ +message = $message; + } + + + public function getHTMLFragments($gridField) { + $count = $gridField->getList()->count(); + + $forTemplate = new ArrayData(array( + 'Message' => $this->message, + 'FirstShownRecord' => 1, + 'LastShownRecord' => $count, + 'NumRecords' => $count + )); + + return array( + 'footer' => $forTemplate->renderWith('GridFieldFooter', array('Colspan'=>count($gridField->getColumns()))), + ); + } +} diff --git a/scss/GridField.scss b/scss/GridField.scss index 6ad3838e3..dcb0f808f 100644 --- a/scss/GridField.scss +++ b/scss/GridField.scss @@ -471,6 +471,11 @@ $gf_grid_x: 16px; &.bottom-all { @include border-bottom-radius($gf_border_radius); @include background-image(linear-gradient($gf_colour_gradient_light, $gf_colour_gradient_dark)); + .datagrid-footer-message { + text-align: center; + padding-top: 6px; + color:$color-text-light; + } .datagrid-pagination { padding-top:2px; position:absolute; diff --git a/templates/Includes/GridFieldFooter.ss b/templates/Includes/GridFieldFooter.ss new file mode 100644 index 000000000..97060c7d4 --- /dev/null +++ b/templates/Includes/GridFieldFooter.ss @@ -0,0 +1,9 @@ + + + $FirstShownRecord - $LastShownRecord of $NumRecords + + <% if Message %> + + <% end_if %> + + \ No newline at end of file