mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
NEW: GridFieldPageCount control for displaying the current page count/total in the gridview header. Designed to complement a functional pager in the grid footer.
NEW: GridFieldPageCount widget to default config settings FIX: @extend .col_buttons in GridField.scss which was raising a warning
This commit is contained in:
parent
b22a7afc03
commit
f265595c1e
@ -17,6 +17,7 @@
|
||||
.cms .ss-gridfield p button#action_export .ui-button-text { padding-left: 26px; }
|
||||
.cms .ss-gridfield .right { float: right; }
|
||||
.cms .ss-gridfield .right > * { float: right; margin-left: 5px; font-size: 14.4px; }
|
||||
.cms .ss-gridfield .right .pagination-records-number { font-size: 1.0em; padding: 6px 3px 6px 0; color: white; text-shadow: 0px -1px 0 rgba(0, 0, 0, 0.2); font-weight: normal; }
|
||||
.cms .ss-gridfield .left { float: left; }
|
||||
.cms .ss-gridfield .left > * { margin-right: 5px; float: left; font-size: 14.4px; }
|
||||
.cms .ss-gridfield .grid-levelup { text-indent: -9999em; margin-bottom: 6px; }
|
||||
@ -29,8 +30,8 @@
|
||||
.cms table.ss-gridfield-table thead { color: #323e46; background: transparent; }
|
||||
.cms table.ss-gridfield-table thead tr.filter-header .fieldgroup { max-width: 512px; }
|
||||
.cms table.ss-gridfield-table thead tr.filter-header .fieldgroup .fieldgroup-field { padding: 0; }
|
||||
.cms table.ss-gridfield-table thead tr:first-child th:first-child { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -ms-border-top-left-radius: 5px; -o-border-top-left-radius: 5px; border-top-left-radius: 5px; }
|
||||
.cms table.ss-gridfield-table thead tr:first-child th:last-child { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; -ms-border-top-right-radius: 5px; -o-border-top-right-radius: 5px; border-top-right-radius: 5px; }
|
||||
.cms table.ss-gridfield-table thead tr:first-child th:first-child { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; }
|
||||
.cms table.ss-gridfield-table thead tr:first-child th:last-child { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; }
|
||||
.cms table.ss-gridfield-table tbody { background: #FFF; }
|
||||
.cms table.ss-gridfield-table tbody tr { cursor: pointer; }
|
||||
.cms table.ss-gridfield-table tbody td { width: auto; white-space: nowrap; }
|
||||
@ -39,7 +40,7 @@
|
||||
.cms table.ss-gridfield-table tbody td.col-listChildrenLink { width: 16px; border-right: none; text-indent: -9999em; padding: 0; }
|
||||
.cms table.ss-gridfield-table tbody td.col-listChildrenLink .list-children-link { background: transparent url(../images/sitetree_ss_default_icons.png) no-repeat 3px -4px; display: block; }
|
||||
.cms table.ss-gridfield-table tbody td.col-getTreeTitle span.item { color: #1556b2; }
|
||||
.cms table.ss-gridfield-table tbody td.col-getTreeTitle span.badge { clear: both; text-transform: uppercase; display: inline-block; padding: 0px 3px; font-size: 0.75em; line-height: 1em; margin-left: 10px; margin-right: 6px; margin-top: -1px; -webkit-border-radius: 2px 2px; -moz-border-radius: 2px / 2px; -ms-border-radius: 2px / 2px; -o-border-radius: 2px / 2px; border-radius: 2px / 2px; }
|
||||
.cms table.ss-gridfield-table tbody td.col-getTreeTitle span.badge { clear: both; text-transform: uppercase; display: inline-block; padding: 0px 3px; font-size: 0.75em; line-height: 1em; margin-left: 10px; margin-right: 6px; margin-top: -1px; -webkit-border-radius: 2px 2px; -moz-border-radius: 2px / 2px; border-radius: 2px / 2px; }
|
||||
.cms table.ss-gridfield-table tbody td.col-getTreeTitle span.badge.modified { color: #7E7470; border: 1px solid #C9B800; background-color: #FFF0BC; }
|
||||
.cms table.ss-gridfield-table tbody td.col-getTreeTitle span.badge.addedtodraft { color: #7E7470; border: 1px solid #C9B800; background-color: #FFF0BC; }
|
||||
.cms table.ss-gridfield-table tbody td.col-getTreeTitle span.badge.deletedonlive { color: #636363; border: 1px solid #E49393; background-color: #F2DADB; }
|
||||
@ -55,7 +56,7 @@
|
||||
.cms table.ss-gridfield-table tbody td a.edit-link { background: url(../admin/images/btn-icon/document--pencil.png) no-repeat 2px 0px; }
|
||||
.cms table.ss-gridfield-table tfoot { color: #323e46; }
|
||||
.cms table.ss-gridfield-table tfoot tr td { background: #b0bec7; padding: .7em; border-bottom: 1px solid rgba(0, 0, 0, 0.1); }
|
||||
.cms table.ss-gridfield-table tr.title th { position: relative; background: #98aab6; border-bottom: 1px solid #899eab; padding: 5px; min-height: 40px; background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2IwYmVjNyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzk4YWFiNiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #b0bec7), color-stop(100%, #98aab6)); background-image: -webkit-linear-gradient(#b0bec7, #98aab6); background-image: -moz-linear-gradient(#b0bec7, #98aab6); background-image: -o-linear-gradient(#b0bec7, #98aab6); background-image: -ms-linear-gradient(#b0bec7, #98aab6); background-image: linear-gradient(#b0bec7, #98aab6); text-shadow: rgba(0, 0, 0, 0.4) 0px -1px 0; }
|
||||
.cms table.ss-gridfield-table tr.title th { position: relative; background: #98aab6; border-bottom: 1px solid #899eab; padding: 5px; min-height: 40px; background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2IwYmVjNyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzk4YWFiNiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #b0bec7), color-stop(100%, #98aab6)); background-image: -webkit-linear-gradient(#b0bec7, #98aab6); background-image: -moz-linear-gradient(#b0bec7, #98aab6); background-image: -o-linear-gradient(#b0bec7, #98aab6); background-image: linear-gradient(#b0bec7, #98aab6); text-shadow: 0px -1px 0 rgba(0, 0, 0, 0.4); }
|
||||
.cms table.ss-gridfield-table tr.title th h2 { padding: 0px; font-size: 16.8px; color: #fff; margin: 1px 8px 0; display: inline-block; float: left; }
|
||||
.cms table.ss-gridfield-table tr.sortable-header { background: #dbe3e8; }
|
||||
.cms table.ss-gridfield-table tr.sortable-header th { padding: 0; font-weight: normal; }
|
||||
@ -71,29 +72,29 @@
|
||||
.cms table.ss-gridfield-table tr th div.fieldgroup.filter-buttons { min-width: 0; }
|
||||
.cms table.ss-gridfield-table tr th div.fieldgroup.filter-buttons div { width: auto; display: inline; }
|
||||
.cms table.ss-gridfield-table tr th.main { white-space: nowrap; border-top: 1px solid #a4b4bf; border-left: 1px solid #a4b4bf; color: #fff; background: #98aab6; border-bottom: 1px solid rgba(0, 0, 0, 0.1); }
|
||||
.cms table.ss-gridfield-table tr th.main span { text-shadow: rgba(0, 0, 0, 0.2) 0px -1px 0; padding-left: 8px; padding-right: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; -o-text-overflow: ellipsis; margin-right: 8px; }
|
||||
.cms table.ss-gridfield-table tr th.main span { text-shadow: 0px -1px 0 rgba(0, 0, 0, 0.2); padding-left: 8px; padding-right: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; -o-text-overflow: ellipsis; margin-right: 8px; }
|
||||
.cms table.ss-gridfield-table tr th.main.col-listChildrenLink { border-right: none; }
|
||||
.cms table.ss-gridfield-table tr th.extra, .cms table.ss-gridfield-table tr th.action { padding: 0; cursor: default; }
|
||||
.cms table.ss-gridfield-table tr th.extra { position: relative; background: #637276; background: rgba(0, 0, 0, 0.7); padding: 5px; border-top: rgba(0, 0, 0, 0.2); }
|
||||
.cms table.ss-gridfield-table tr th.extra input { height: 28px; }
|
||||
.cms table.ss-gridfield-table tr th.extra button.ss-ui-button { padding: .3em; line-height: 1; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; position: relative; border-bottom-width: 0; -webkit-border-radius: 2px 2px; -moz-border-radius: 2px / 2px; -ms-border-radius: 2px / 2px; -o-border-radius: 2px / 2px; border-radius: 2px / 2px; }
|
||||
.cms table.ss-gridfield-table tr th.first { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -ms-border-top-left-radius: 5px; -o-border-top-left-radius: 5px; border-top-left-radius: 5px; }
|
||||
.cms table.ss-gridfield-table tr th.last { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; -ms-border-top-right-radius: 5px; -o-border-top-right-radius: 5px; border-top-right-radius: 5px; }
|
||||
.cms table.ss-gridfield-table tr th.extra button.ss-ui-button { padding: .3em; line-height: 1; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; position: relative; border-bottom-width: 0; -webkit-border-radius: 2px 2px; -moz-border-radius: 2px / 2px; border-radius: 2px / 2px; }
|
||||
.cms table.ss-gridfield-table tr th.first { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; }
|
||||
.cms table.ss-gridfield-table tr th.last { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; border-top-right-radius: 5px; }
|
||||
.cms table.ss-gridfield-table tr th button#action_gridfield_relationadd:hover { color: #444 !important; /* Not sure why IE think it needs this */ }
|
||||
.cms table.ss-gridfield-table tr th button:hover { color: #ccc !important; /* Not sure why IE think it needs this */ }
|
||||
.cms table.ss-gridfield-table tr th button.ss-gridfield-sort:hover { color: #fff !important; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; }
|
||||
.cms table.ss-gridfield-table tr th button.ss-gridfield-sort { background: transparent url(../images/arrows.png) no-repeat right 6px; border: none; width: 100%; text-align: left; padding: 2px 8px 2px 0; text-shadow: rgba(0, 0, 0, 0.2) 0px -1px 0; color: #fff; -webkit-border-radius: 0; -moz-border-radius: 0; -ms-border-radius: 0; -o-border-radius: 0; border-radius: 0; }
|
||||
.cms table.ss-gridfield-table tr th button.ss-gridfield-sort { background: transparent url(../images/arrows.png) no-repeat right 6px; border: none; width: 100%; text-align: left; padding: 2px 8px 2px 0; text-shadow: 0px -1px 0 rgba(0, 0, 0, 0.2); color: #fff; -webkit-border-radius: 0; -moz-border-radius: 0; -ms-border-radius: 0; -o-border-radius: 0; border-radius: 0; }
|
||||
.cms table.ss-gridfield-table tr th button.ss-gridfield-sort:hover { background-position: right -34px; }
|
||||
.cms table.ss-gridfield-table tr th button.ss-gridfield-sort.ss-gridfield-sorted-desc { background-position: right -72px; }
|
||||
.cms table.ss-gridfield-table tr th button.ss-gridfield-sort.ss-gridfield-sorted-asc { background-position: right -116px; }
|
||||
.cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-filter { background-color: #55a4d2; border: none; display: block; text-indent: -9999em; width: 30px; height: 25px; background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzMzOGRjMSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzI4NzA5OSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #338dc1), color-stop(100%, #287099)); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, -webkit-linear-gradient(#338dc1, #287099); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, -moz-linear-gradient(#338dc1, #287099); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, -o-linear-gradient(#338dc1, #287099); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, -ms-linear-gradient(#338dc1, #287099); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, linear-gradient(#338dc1, #287099); width: 26px; border-top: 1px solid #4199cd; }
|
||||
.cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-filter.hover-alike:active, .cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-filter:active, .cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-filter.hover-alike, .cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-filter:hover { background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzU1YTRkMiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzMzOGRjMSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #55a4d2), color-stop(100%, #338dc1)); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, -webkit-linear-gradient(#55a4d2, #338dc1); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, -moz-linear-gradient(#55a4d2, #338dc1); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, -o-linear-gradient(#55a4d2, #338dc1); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, -ms-linear-gradient(#55a4d2, #338dc1); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, linear-gradient(#55a4d2, #338dc1); }
|
||||
.cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-filter { background-color: #55a4d2; border: none; display: block; text-indent: -9999em; width: 30px; height: 25px; background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzMzOGRjMSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzI4NzA5OSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #338dc1), color-stop(100%, #287099)); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, -webkit-linear-gradient(#338dc1, #287099); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, -moz-linear-gradient(#338dc1, #287099); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, -o-linear-gradient(#338dc1, #287099); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, linear-gradient(#338dc1, #287099); width: 26px; border-top: 1px solid #4199cd; }
|
||||
.cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-filter.hover-alike:active, .cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-filter:active, .cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-filter.hover-alike, .cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-filter:hover { background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzU1YTRkMiIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzMzOGRjMSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #55a4d2), color-stop(100%, #338dc1)); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, -webkit-linear-gradient(#55a4d2, #338dc1); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, -moz-linear-gradient(#55a4d2, #338dc1); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, -o-linear-gradient(#55a4d2, #338dc1); background: url(../images/icons/filter-icons.png) no-repeat -15px 4px, linear-gradient(#55a4d2, #338dc1); }
|
||||
.cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-filter.trigger { margin-left: 12px; border: none; background: url(../images/icons/filter-icons.png) no-repeat -17px 6px; padding-right: 46px; margin: 0 6px; }
|
||||
.cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-filter.trigger span { opacity: 0.4; position: absolute; width: 10px; left: 30px; top: 40%; background: url(../admin/images/btn_arrow_down_grey.png) no-repeat 0px 0px; }
|
||||
.cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-filter.trigger:hover { background: url(../images/icons/filter-icons.png) no-repeat -17px -38px; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; }
|
||||
.cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-filter.trigger:hover span { opacity: 0.9; }
|
||||
.cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-close { background: url(../images/icons/filter-icons.png) no-repeat 8px -17px; border: none; display: block; text-indent: -9999em; width: 30px; height: 25px; width: 25px; opacity: 0.8; margin-right: -5px; }
|
||||
.cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-close.hover-alike:active, .cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-close:active, .cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-close.hover-alike, .cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-close:hover { opacity: 1; background: url(../images/icons/filter-icons.png) no-repeat 8px -17px, url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0icmdiYSgyNTUsIDI1NSwgMjU1LCAwLjEpIi8+PHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSJyZ2JhKDI1NSwgMjU1LCAyNTUsIDAuMSkiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI2dyYWQpIiAvPjwvc3ZnPiA='); background: url(../images/icons/filter-icons.png) no-repeat 8px -17px, -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(255, 255, 255, 0.1)), color-stop(100%, rgba(255, 255, 255, 0.1))); background: url(../images/icons/filter-icons.png) no-repeat 8px -17px, -webkit-linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)); background: url(../images/icons/filter-icons.png) no-repeat 8px -17px, -moz-linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)); background: url(../images/icons/filter-icons.png) no-repeat 8px -17px, -o-linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)); background: url(../images/icons/filter-icons.png) no-repeat 8px -17px, -ms-linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)); background: url(../images/icons/filter-icons.png) no-repeat 8px -17px, linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)); }
|
||||
.cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-close.hover-alike:active, .cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-close:active, .cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-close.hover-alike, .cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-close:hover { opacity: 1; background: url(../images/icons/filter-icons.png) no-repeat 8px -17px, url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0icmdiYSgyNTUsIDI1NSwgMjU1LCAwLjEpIi8+PHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSJyZ2JhKDI1NSwgMjU1LCAyNTUsIDAuMSkiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI2dyYWQpIiAvPjwvc3ZnPiA='); background: url(../images/icons/filter-icons.png) no-repeat 8px -17px, -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, rgba(255, 255, 255, 0.1)), color-stop(100%, rgba(255, 255, 255, 0.1))); background: url(../images/icons/filter-icons.png) no-repeat 8px -17px, -webkit-linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)); background: url(../images/icons/filter-icons.png) no-repeat 8px -17px, -moz-linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)); background: url(../images/icons/filter-icons.png) no-repeat 8px -17px, -o-linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)); background: url(../images/icons/filter-icons.png) no-repeat 8px -17px, linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)); }
|
||||
.cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-reset { border: none; display: block; text-indent: -9999em; width: 30px; height: 25px; position: absolute; top: -21px; right: -1px; width: 20px; height: 20px; display: none; }
|
||||
.cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-reset.filtered { display: block; background: url(../admin/images/btn-icon/cross.png) no-repeat 0px 0px; opacity: 0.5; }
|
||||
.cms table.ss-gridfield-table tr th button.ss-ui-button.ss-gridfield-button-reset.filtered:hover { opacity: 0.8; }
|
||||
@ -106,10 +107,10 @@
|
||||
.cms table.ss-gridfield-table tr th input.ss-gridfield-sort:focus { -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; }
|
||||
.cms table.ss-gridfield-table tr th span.non-sortable { display: block; }
|
||||
.cms table.ss-gridfield-table tr td { border-right: 1px solid rgba(0, 0, 0, 0.1); padding: 8px 8px; color: #666666; }
|
||||
.cms table.ss-gridfield-table tr td.bottom-all { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; -ms-border-bottom-left-radius: 5px; -o-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; -ms-border-bottom-right-radius: 5px; -o-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2IwYmVjNyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzk4YWFiNiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #b0bec7), color-stop(100%, #98aab6)); background-image: -webkit-linear-gradient(#b0bec7, #98aab6); background-image: -moz-linear-gradient(#b0bec7, #98aab6); background-image: -o-linear-gradient(#b0bec7, #98aab6); background-image: -ms-linear-gradient(#b0bec7, #98aab6); background-image: linear-gradient(#b0bec7, #98aab6); padding: 4px 12px; }
|
||||
.cms table.ss-gridfield-table tr td.bottom-all { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2IwYmVjNyIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzk4YWFiNiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #b0bec7), color-stop(100%, #98aab6)); background-image: -webkit-linear-gradient(#b0bec7, #98aab6); background-image: -moz-linear-gradient(#b0bec7, #98aab6); background-image: -o-linear-gradient(#b0bec7, #98aab6); background-image: linear-gradient(#b0bec7, #98aab6); padding: 4px 12px; }
|
||||
.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: 1px; position: absolute; left: 50%; margin-left: -116px; z-index: 5; }
|
||||
.cms table.ss-gridfield-table tr td.bottom-all .datagrid-pagination .pagination-page-number { color: white; text-shadow: rgba(0, 0, 0, 0.2) 0px -1px 0; }
|
||||
.cms table.ss-gridfield-table tr td.bottom-all .datagrid-pagination .pagination-page-number { color: white; text-shadow: 0px -1px 0 rgba(0, 0, 0, 0.2); }
|
||||
.cms table.ss-gridfield-table tr td.bottom-all .datagrid-pagination .pagination-page-number input { width: 35px; height: 18px; margin-bottom: -6px; padding: 0px; border: 1px solid #899eab; border-bottom: 1px solid #a7b7c1; }
|
||||
.cms table.ss-gridfield-table tr td.bottom-all .datagrid-pagination button { -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; border: none; width: 10px; margin: 0 10px; }
|
||||
.cms table.ss-gridfield-table tr td.bottom-all .datagrid-pagination button span { text-indent: -9999em; }
|
||||
@ -118,7 +119,7 @@
|
||||
.cms table.ss-gridfield-table tr td.bottom-all .datagrid-pagination button.ss-gridfield-firstpage { background: url(../images/icons/pagination-arrows.png) no-repeat 0px 8px; }
|
||||
.cms table.ss-gridfield-table tr td.bottom-all .datagrid-pagination button.ss-gridfield-lastpage { background: url(../images/icons/pagination-arrows.png) no-repeat -73px 8px; }
|
||||
.cms table.ss-gridfield-table tr td.bottom-all .datagrid-pagination button.ssui-button-disabled { z-index: -1; }
|
||||
.cms table.ss-gridfield-table tr td.bottom-all .pagination-records-number { float: right; padding: 6px 0; color: white; text-shadow: rgba(0, 0, 0, 0.2) 0px -1px 0; }
|
||||
.cms table.ss-gridfield-table tr td.bottom-all .pagination-records-number { float: right; padding: 6px 0; color: white; text-shadow: 0px -1px 0 rgba(0, 0, 0, 0.2); }
|
||||
.cms table.ss-gridfield-table tr.last td { border-bottom: 0 none; }
|
||||
.cms table.ss-gridfield-table td:first-child { border-left: 1px solid rgba(0, 0, 0, 0.1); }
|
||||
.cms table.ss-gridfield-table td:last-child { border-right: 1px solid rgba(0, 0, 0, 0.1); }
|
||||
|
@ -142,6 +142,7 @@ class GridFieldConfig_Base extends GridFieldConfig {
|
||||
$this->addComponent($sort = new GridFieldSortableHeader());
|
||||
$this->addComponent($filter = new GridFieldFilterHeader());
|
||||
$this->addComponent(new GridFieldDataColumns());
|
||||
$this->addComponent(new GridFieldPageCount('toolbar-header-right'));
|
||||
$this->addComponent($pagination = new GridFieldPaginator($itemsPerPage));
|
||||
|
||||
$sort->setThrowExceptionOnBadDataType(false);
|
||||
@ -182,6 +183,7 @@ class GridFieldConfig_RecordEditor extends GridFieldConfig {
|
||||
$this->addComponent(new GridFieldDataColumns());
|
||||
$this->addComponent(new GridFieldEditButton());
|
||||
$this->addComponent(new GridFieldDeleteAction());
|
||||
$this->addComponent(new GridFieldPageCount('toolbar-header-right'));
|
||||
$this->addComponent($pagination = new GridFieldPaginator($itemsPerPage));
|
||||
$this->addComponent(new GridFieldDetailForm());
|
||||
|
||||
@ -222,6 +224,7 @@ class GridFieldConfig_RelationEditor extends GridFieldConfig {
|
||||
$this->addComponent(new GridFieldDataColumns());
|
||||
$this->addComponent(new GridFieldEditButton());
|
||||
$this->addComponent(new GridFieldDeleteAction());
|
||||
$this->addComponent(new GridFieldPageCount('toolbar-header-right'));
|
||||
$this->addComponent($pagination = new GridFieldPaginator($itemsPerPage));
|
||||
$this->addComponent(new GridFieldDetailForm());
|
||||
|
||||
|
47
forms/gridfield/GridFieldPageCount.php
Executable file
47
forms/gridfield/GridFieldPageCount.php
Executable file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* GridFieldPage displays a simple current page count summary.
|
||||
* E.g. "View 1 - 15 of 32"
|
||||
*
|
||||
* Depends on GridFieldPaginator being added to the same gridfield
|
||||
*
|
||||
* @package framework
|
||||
* @subpackage fields-relational
|
||||
*/
|
||||
class GridFieldPageCount implements GridField_HTMLProvider {
|
||||
/**
|
||||
* @var string placement indicator for this control
|
||||
*/
|
||||
protected $targetFragment;
|
||||
|
||||
/**
|
||||
* Which template to use for rendering
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $itemClass = 'GridFieldPageCount';
|
||||
|
||||
/**
|
||||
* @param string $targetFrament The fragment indicating the placement of this page count
|
||||
*/
|
||||
public function __construct($targetFragment = 'before') {
|
||||
$this->targetFragment = $targetFragment;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param GridField $gridField
|
||||
* @return array
|
||||
*/
|
||||
public function getHTMLFragments($gridField) {
|
||||
|
||||
// Retrieve paging parameters from the directing paginator component
|
||||
$paginator = $gridField->getConfig()->getComponentByType('GridFieldPaginator');
|
||||
if ($paginator && ($forTemplate = $paginator->getTemplateParameters($gridField))) {
|
||||
return array(
|
||||
$this->targetFragment => $forTemplate->renderWith($this->itemClass)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -7,8 +7,8 @@
|
||||
* @subpackage fields-relational
|
||||
*/
|
||||
class GridFieldPaginator implements GridField_HTMLProvider, GridField_DataManipulator, GridField_ActionProvider {
|
||||
|
||||
/**
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $itemsPerPage = 15;
|
||||
@ -94,11 +94,26 @@ class GridFieldPaginator implements GridField_HTMLProvider, GridField_DataManipu
|
||||
if($actionName !== 'paginate') {
|
||||
return;
|
||||
}
|
||||
$state = $gridField->State->GridFieldPaginator;
|
||||
$state = $this->getGridPagerState($gridField);
|
||||
$state->currentPage = (int)$arguments;
|
||||
}
|
||||
|
||||
protected $totalItems = 0;
|
||||
|
||||
/**
|
||||
* Retrieves/Sets up the state object used to store and retrieve information
|
||||
* about the current paging details of this GridField
|
||||
* @param GridField $gridField
|
||||
* @return GridState_Data
|
||||
*/
|
||||
protected function getGridPagerState(GridField $gridField) {
|
||||
$state = $gridField->State->GridFieldPaginator;
|
||||
|
||||
// Force the state to the initial page if none is set
|
||||
if(empty($state->currentPage)) $state->currentPage = 1;
|
||||
|
||||
return $state;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@ -107,40 +122,47 @@ class GridFieldPaginator implements GridField_HTMLProvider, GridField_DataManipu
|
||||
* @return SS_List
|
||||
*/
|
||||
public function getManipulatedData(GridField $gridField, SS_List $dataList) {
|
||||
|
||||
if(!$this->checkDataType($dataList)) return $dataList;
|
||||
|
||||
$this->totalItems = $dataList->count();
|
||||
$state = $this->getGridPagerState($gridField);
|
||||
|
||||
$state = $gridField->State->GridFieldPaginator;
|
||||
if(!is_int($state->currentPage)) {
|
||||
$state->currentPage = 1;
|
||||
}
|
||||
// Update item count prior to filter. GridFieldPageCount will rely on this value
|
||||
$this->totalItems = $dataList->count();
|
||||
|
||||
if(!($dataList instanceof SS_Limitable)) {
|
||||
return $dataList;
|
||||
}
|
||||
if(!$state->currentPage) {
|
||||
return $dataList->limit((int)$this->itemsPerPage);
|
||||
}
|
||||
|
||||
$startRow = $this->itemsPerPage * ($state->currentPage - 1);
|
||||
return $dataList->limit((int)$this->itemsPerPage, (int)$startRow);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param GridField $gridField
|
||||
* @return array
|
||||
* Determines arguments to be passed to the template for building this field
|
||||
* @return ArrayData|null If paging is available this will be an ArrayData
|
||||
* object of paging details with these parameters:
|
||||
* <ul>
|
||||
* <li>OnlyOnePage: boolean - Is there only one page?</li>
|
||||
* <li>FirstShownRecord: integer - Number of the first record displayed</li>
|
||||
* <li>LastShownRecord: integer - Number of the last record displayed</li>
|
||||
* <li>NumRecords: integer - Total number of records</li>
|
||||
* <li>NumPages: integer - The number of pages</li>
|
||||
* <li>CurrentPageNum (optional): integer - If OnlyOnePage is false, the number of the current page</li>
|
||||
* <li>FirstPage (optional): GridField_FormAction - Button to go to the first page</li>
|
||||
* <li>PreviousPage (optional): GridField_FormAction - Button to go to the previous page</li>
|
||||
* <li>NextPage (optional): GridField_FormAction - Button to go to the next page</li>
|
||||
* <li>LastPage (optional): GridField_FormAction - Button to go to last page</li>
|
||||
* </ul>
|
||||
*/
|
||||
public function getHTMLFragments($gridField) {
|
||||
if(!$this->checkDataType($gridField->getList())) return;
|
||||
public function getTemplateParameters(GridField $gridField) {
|
||||
if(!$this->checkDataType($gridField->getList())) return null;
|
||||
|
||||
$state = $gridField->State->GridFieldPaginator;
|
||||
if(!is_int($state->currentPage))
|
||||
$state->currentPage = 1;
|
||||
$state = $this->getGridPagerState($gridField);
|
||||
|
||||
// Figure out which page and record range we're on
|
||||
$totalRows = $this->totalItems;
|
||||
if(!$totalRows) return array();
|
||||
if(!$totalRows) return null;
|
||||
|
||||
$totalPages = (int)ceil($totalRows/$this->itemsPerPage);
|
||||
if($totalPages == 0)
|
||||
@ -156,13 +178,14 @@ class GridFieldPaginator implements GridField_HTMLProvider, GridField_DataManipu
|
||||
// to sort out those first page, last page, pre and next pages, etc
|
||||
// we are not render those in to the paginator.
|
||||
if($totalPages === 1){
|
||||
$forTemplate = new ArrayData(array(
|
||||
return new ArrayData(array(
|
||||
'OnlyOnePage' => true,
|
||||
'FirstShownRecord' => $firstShownRecord,
|
||||
'LastShownRecord' => $lastShownRecord,
|
||||
'NumRecords' => $totalRows
|
||||
'NumRecords' => $totalRows,
|
||||
'NumPages' => $totalPages
|
||||
));
|
||||
}else{
|
||||
} else {
|
||||
// First page button
|
||||
$firstPage = new GridField_FormAction($gridField, 'pagination_first', 'First', 'paginate', 1);
|
||||
$firstPage->addExtraClass('ss-gridfield-firstpage');
|
||||
@ -191,9 +214,8 @@ class GridFieldPaginator implements GridField_HTMLProvider, GridField_DataManipu
|
||||
if($state->currentPage == $totalPages)
|
||||
$lastPage = $lastPage->performDisabledTransformation();
|
||||
|
||||
|
||||
// Render in template
|
||||
$forTemplate = new ArrayData(array(
|
||||
return new ArrayData(array(
|
||||
'OnlyOnePage' => false,
|
||||
'FirstPage' => $firstPage,
|
||||
'PreviousPage' => $previousPage,
|
||||
@ -206,11 +228,22 @@ class GridFieldPaginator implements GridField_HTMLProvider, GridField_DataManipu
|
||||
'NumRecords' => $totalRows
|
||||
));
|
||||
}
|
||||
return array(
|
||||
'footer' => $forTemplate->renderWith('GridFieldPaginator_Row', array(
|
||||
'Colspan'=>count($gridField->getColumns())
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param GridField $gridField
|
||||
* @return array
|
||||
*/
|
||||
public function getHTMLFragments($gridField) {
|
||||
|
||||
$forTemplate = $this->getTemplateParameters($gridField);
|
||||
if($forTemplate) {
|
||||
return array(
|
||||
'footer' => $forTemplate->renderWith($this->itemClass,
|
||||
array('Colspan'=>count($gridField->getColumns())))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -22,7 +22,7 @@
|
||||
$experimental-support-for-svg: true;
|
||||
|
||||
|
||||
$gf_colour_gradient_dark: darken($color-base, 8%);
|
||||
$gf_colour_gradient_dark: darken($color-base, 8%);
|
||||
$gf_colour_header_border: $gf_colour_gradient_dark;
|
||||
$gf_colour_subheader: saturate(lighten($color-base, 15%),5%);
|
||||
$gf_colour_border: rgba(0,0,0,.1);
|
||||
@ -76,6 +76,15 @@ $gf_grid_x: 16px;
|
||||
margin-left:5px;
|
||||
font-size: $gf_grid_y*1.2;
|
||||
}
|
||||
|
||||
.pagination-records-number
|
||||
{
|
||||
font-size: 1.0em;
|
||||
padding: 6px 3px 6px 0;
|
||||
color: $color-text-light;
|
||||
@include single-text-shadow($gf_colour_text_shadow, 0px, -1px, 0);
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
.left {
|
||||
float:left;
|
||||
@ -327,7 +336,7 @@ $gf_grid_x: 16px;
|
||||
padding: 5px;
|
||||
border-right: 1px solid $gf_colour_border;
|
||||
|
||||
div {
|
||||
div {
|
||||
&.fieldgroup,&.fieldgroup-field {
|
||||
width: 100%;
|
||||
position:relative;
|
||||
@ -338,7 +347,6 @@ $gf_grid_x: 16px;
|
||||
&.filter-buttons{
|
||||
min-width:0;
|
||||
div{
|
||||
@extend .col-buttons;
|
||||
width:auto;
|
||||
display:inline;
|
||||
}
|
||||
|
6
templates/Includes/GridFieldPageCount.ss
Normal file
6
templates/Includes/GridFieldPageCount.ss
Normal file
@ -0,0 +1,6 @@
|
||||
<span class="pagination-records-number">
|
||||
<% _t('Pagination.View', 'View', 'Verb. Example: View 1 of 2') %>
|
||||
{$FirstShownRecord}–{$LastShownRecord}
|
||||
<% _t('TableListField_PageControls.ss.OF', 'of', 'Example: View 1 of 2') %>
|
||||
$NumRecords
|
||||
</span>
|
@ -15,7 +15,7 @@
|
||||
<% end_if %>
|
||||
<span class="pagination-records-number">
|
||||
<% _t('Pagination.View', 'View', 'Verb. Example: View 1 of 2') %>
|
||||
$FirstShownRecord - $LastShownRecord
|
||||
{$FirstShownRecord}–{$LastShownRecord}
|
||||
<% _t('TableListField_PageControls.ss.OF', 'of', 'Example: View 1 of 2') %>
|
||||
$NumRecords
|
||||
</span>
|
||||
|
@ -33,6 +33,7 @@ class GridFieldTest extends SapphireTest {
|
||||
$sort = new GridFieldSortableHeader(),
|
||||
$filter = new GridFieldFilterHeader(),
|
||||
new GridFieldDataColumns(),
|
||||
new GridFieldPageCount('toolbar-header-right'),
|
||||
$pagination = new GridFieldPaginator(),
|
||||
new GridState_Component(),
|
||||
));
|
||||
|
@ -18,7 +18,11 @@ class GridFieldPaginatorTest extends FunctionalTest {
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
$this->list = new DataList('GridFieldTest_Team');
|
||||
$config = GridFieldConfig::create()->addComponent(new GridFieldPaginator(2));
|
||||
$config = GridFieldConfig::create()->addComponents(
|
||||
new GridFieldToolbarHeader(), // Required to support pagecount
|
||||
new GridFieldPaginator(2),
|
||||
new GridFieldPageCount('toolbar-header-right')
|
||||
);
|
||||
$this->gridField = new GridField('testfield', 'testfield', $this->list, $config);
|
||||
$this->form = new Form(new Controller(), 'mockform', new FieldList(array($this->gridField)), new FieldList());
|
||||
}
|
||||
@ -28,6 +32,9 @@ class GridFieldPaginatorTest extends FunctionalTest {
|
||||
$content = new CSSContentParser($fieldHolder);
|
||||
// Check that there is paginator render into the footer
|
||||
$this->assertEquals(1, count($content->getBySelector('.datagrid-pagination')));
|
||||
|
||||
// Check that the header and footer both contains a page count
|
||||
$this->assertEquals(2, count($content->getBySelector('.pagination-records-number')));
|
||||
}
|
||||
|
||||
public function testThereIsNoPaginatorWhenOnlyOnePage() {
|
||||
@ -42,6 +49,6 @@ class GridFieldPaginatorTest extends FunctionalTest {
|
||||
$this->assertEquals(0, count($content->getBySelector('.datagrid-pagination')));
|
||||
|
||||
// Check that there is still 'View 1 - 4 of 4' part on the left of the paginator
|
||||
$this->assertEquals(1, count($content->getBySelector('.pagination-records-number')));
|
||||
$this->assertEquals(2, count($content->getBySelector('.pagination-records-number')));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user