Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: silverstripe/silverstripe-framework
...
head fork: silverstripe/silverstripe-framework
compare: fa445ad13f
Checking mergeability… Don't worry, you can still create the pull request.
  • 4 commits
  • 16 files changed
  • 0 commit comments
  • 2 contributors
Commits on May 21, 2012
@adrexia adrexia ENHANCEMENT: Move GridField buttons out of table (fixes 7213)
* Added a separate component to grid field to hold buttons.
* Updated templates for changes
* Updated comments
a7336e9
@adrexia adrexia ENHANCEMENT: Make GridFieldButtonRow more adaptable
* Add ability to choose where to put buttons (in buttonRow, toolbar
header, etc)
* Adjust styles to take these changes into account
1747298
@adrexia adrexia ENHANCEMENT: Make GridFieldAddNewButton Content more specific
* Alter Grid Field "Add New" Button to take the name of the table (i.e.
"Add Member")
* Alter table names in security section to be singular so the button
text makes sense
16982ba
Commits on May 24, 2012
@chillu chillu Merge pull request #452 from adrexia/sapphire
---

* Added a separate component to grid field to hold buttons.
* Updated templates for changes
* Updated comments

Conflicts:
	css/AssetUploadField.css
	css/GridField.css
fa445ad
View
6 admin/code/SecurityAdmin.php
@@ -68,7 +68,7 @@ public function getEditForm($id = null, $fields = null) {
if($record && !$record->canView()) return Security::permissionFailure($this);
$memberList = GridField::create(
- 'Members',
+ 'Member',
false,
DataList::create('Member'),
$memberListConfig = GridFieldConfig_RecordEditor::create()
@@ -77,7 +77,7 @@ public function getEditForm($id = null, $fields = null) {
$memberListConfig->getComponentByType('GridFieldDetailForm')->setValidator(new Member_Validator());
$groupList = GridField::create(
- 'Groups',
+ 'Group',
false,
DataList::create('Group'),
GridFieldConfig_RecordEditor::create()
@@ -129,7 +129,7 @@ public function getEditForm($id = null, $fields = null) {
// Add roles editing interface
if(Permission::check('APPLY_ROLES')) {
- $rolesField = GridField::create('Roles',
+ $rolesField = GridField::create('Role',
false,
DataList::create('PermissionRole'),
GridFieldConfig_RecordEditor::create()
View
2  admin/css/screen.css
@@ -364,7 +364,7 @@ body.cms { overflow: hidden; }
.cms-content-tools { background-color: #F1F4F5; background: #f0f3f4 url(../images/textures/bg_cms_main_content.png) repeat top left; width: 192px; border-right: 1px solid #bfcad2; overflow-y: auto; overflow-x: hidden; z-index: 70; -webkit-box-shadow: rgba(0, 0, 0, 0.6) 0 2px 3px; -moz-box-shadow: rgba(0, 0, 0, 0.6) 0 2px 3px; box-shadow: rgba(0, 0, 0, 0.6) 0 2px 3px; float: left; position: relative; }
.cms-content-tools.filter { padding: 0 !important; }
.cms-content-tools .cms-panel-header { clear: both; margin: 0 0 7px; line-height: 24px; border-bottom: 1px solid rgba(201, 205, 206, 0.8); -webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); -moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); -o-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); }
-.cms-content-tools .cms-panel-content { width: 176px; padding: 0 8px; overflow: auto; overflow-x: hidden; height: 100%; }
+.cms-content-tools .cms-panel-content { width: 176px; padding: 0 8px; overflow: auto; height: 100%; }
.cms-content-tools .cms-panel-content .dropdown select { width: 160px; }
.cms-content-tools .cms-panel-content #LastEditedFrom { -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; }
.cms-content-tools .cms-panel-content #LastEditedFrom input { width: 160px; }
View
9 css/AssetUploadField.css
@@ -4,14 +4,7 @@
/** ----------------------------------------------- Typography. ------------------------------------------------ */
/** ----------------------------------------------- Grid Units (px) We have a vertical rhythm that the grid is based off both x (=horizontal) and y (=vertical). All internal padding and margins are scaled to this and accounting for paragraphs ------------------------------------------------ */
/** ----------------------------------------------- Application Logo (CMS Logo) Must be 24px x 24px ------------------------------------------------ */
-/** This file contains mixins relating to specific functionality Mixins should be stored here rather than individual files */
-/*Mixin generates the generic button styling for the gridfield*/
-/**
- Mixin creates a transparent button with a dropdown arrow,
- as is used for files in the files up-load area. The arrows
- themselves are added in the _style file
-**/
-#AssetUploadField { border-bottom: 0; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; }
+#AssetUploadField { border-bottom: 0; -moz-box-shadow: none; -webkit-box-shadow: none; -o-box-shadow: none; box-shadow: none; }
body.cms.ss-uploadfield-edit-iframe { padding: 16px; overflow: auto; }
body.cms.ss-uploadfield-edit-iframe span.readonly { font-style: italic; color: #777777; text-shadow: 0px 1px 0px #fff; }
View
63 css/GridField.css
@@ -5,38 +5,32 @@
/** ----------------------------------------------- Typography. ------------------------------------------------ */
/** ----------------------------------------------- Grid Units (px) We have a vertical rhythm that the grid is based off both x (=horizontal) and y (=vertical). All internal padding and margins are scaled to this and accounting for paragraphs ------------------------------------------------ */
/** ----------------------------------------------- Application Logo (CMS Logo) Must be 24px x 24px ------------------------------------------------ */
-/** This file contains the default theme definitions for the admin interface. Please put mostly SCSS variable definitions in here, and leave the actual styling to _style.scss and auxilliary files. */
-/** ----------------------------------------------- Colours ------------------------------------------------ */
-/** ----------------------------------------------- Textures ----------------------------------------------- */
-/** ----------------------------------------------- Typography. ------------------------------------------------ */
-/** ----------------------------------------------- Grid Units (px) We have a vertical rhythm that the grid is based off both x (=horizontal) and y (=vertical). All internal padding and margins are scaled to this and accounting for paragraphs ------------------------------------------------ */
-/** ----------------------------------------------- Application Logo (CMS Logo) Must be 24px x 24px ------------------------------------------------ */
-/** This file contains mixins relating to specific functionality Mixins should be stored here rather than individual files */
-/*Mixin generates the generic button styling for the gridfield*/
-/**
- Mixin creates a transparent button with a dropdown arrow,
- as is used for files in the files up-load area. The arrows
- themselves are added in the _style file
-**/
.cms .ss-gridfield > div { margin-bottom: 36px; }
+.cms .ss-gridfield > div.addNewGridFieldButton { margin-bottom: 12px; }
+.cms .ss-gridfield > div.addNewGridFieldButton:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
+*:first-child .cms .ss-gridfield > div.addNewGridFieldButton { zoom: 1; }
.cms .ss-gridfield[data-selectable] tr.ui-selected, .cms .ss-gridfield[data-selectable] tr.ui-selecting { background: #FFFAD6 !important; }
.cms .ss-gridfield[data-selectable] td { cursor: pointer; }
.cms .ss-gridfield span button#action_gridfield_relationfind { display: none; }
.cms .ss-gridfield p button#action_export { margin-top: 12px; }
.cms .ss-gridfield p button#action_export span.btn-icon-download-csv { height: 17px; }
.cms .ss-gridfield p button#action_export span.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 .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; }
.cms .ss-gridfield .grid-levelup a.list-parent-link { background: transparent url(../images/gridfield-level-up.png) no-repeat 0 0; display: block; }
.cms .ss-gridfield .add-existing-autocompleter { width: 500px; }
.cms .ss-gridfield .add-existing-autocompleter input.relation-search { width: 380px; }
.cms .ss-gridfield .grid-print-button { display: inline-block; }
.cms .ss-gridfield .grid-csv-button { display: inline-block; }
-.cms table.ss-gridfield-table { display: table; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; padding: 0; border-collapse: separate; border-bottom: 0 none; width: 100%; }
-.cms table.ss-gridfield-table thead { color: #323e46; background: transparent; }
+.cms table.ss-gridfield-table { display: table; box-shadow: none; padding: 0; border-collapse: separate; border-bottom: 0 none; width: 100%; margin-bottom: 12px; }
+.cms table.ss-gridfield-table thead { color: #1e2527; 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: 7px; -webkit-border-top-left-radius: 7px; -o-border-top-left-radius: 7px; -ms-border-top-left-radius: 7px; -khtml-border-top-left-radius: 7px; border-top-left-radius: 7px; }
+.cms table.ss-gridfield-table thead tr:first-child th:last-child { -moz-border-radius-topright: 7px; -webkit-border-top-right-radius: 7px; -o-border-top-right-radius: 7px; -ms-border-top-right-radius: 7px; -khtml-border-top-right-radius: 7px; border-top-right-radius: 7px; }
.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; }
@@ -45,7 +39,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 12px -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; -o-border-radius: 2px / 2px; -ms-border-radius: 2px / 2px; -khtml-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; }
@@ -58,16 +52,13 @@
.cms table.ss-gridfield-table tbody td button.gridfield-button-delete span.btn-icon-decline { left: 2px; }
.cms table.ss-gridfield-table tbody td a.view-link, .cms table.ss-gridfield-table tbody td a.edit-link { display: inline-block; width: 20px; height: 20px; text-indent: 9999em; overflow: hidden; vertical-align: middle; }
.cms table.ss-gridfield-table tbody td a.view-link { background: url(../admin/images/btn-icon/magnifier.png) no-repeat 0 1px; }
-.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 h2 { padding: 0px; font-size: 16.8px; color: #fff; margin: 1px 8px 0; display: inline-block; }
-.cms table.ss-gridfield-table tr.title th .right > * { float: right; font-size: 14.4px; }
-.cms table.ss-gridfield-table tr.title th .left > * { float: left; font-size: 14.4px; }
-.cms table.ss-gridfield-table tr.sortable-header { background: #dbe3e8; }
-.cms table.ss-gridfield-table tr.sortable-header th { padding: 0; font-weight: normal; }
-.cms table.ss-gridfield-table tr.sortable-header th .ss-ui-button { font-weight: normal; }
+.cms table.ss-gridfield-table tbody td a.edit-link { background: url(../admin/images/btn-icon/document--pencil.png) no-repeat 0 1px; }
+.cms table.ss-gridfield-table tfoot { color: #1e2527; }
+.cms table.ss-gridfield-table tfoot tr td { background: #97a8ad; padding: .7em; border-bottom: 1px solid rgba(0, 0, 0, 0.1); }
+.cms table.ss-gridfield-table tr.title th { position: relative; background: #899ca2; border-top: 1px solid rgba(0, 0, 0, 0.1); padding: 5px; min-height: 40px; background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2IzYzBjNCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzg5OWNhMiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #b3c0c4), color-stop(100%, #899ca2)); background-image: -webkit-linear-gradient(#b3c0c4, #899ca2); background-image: -moz-linear-gradient(#b3c0c4, #899ca2); background-image: -o-linear-gradient(#b3c0c4, #899ca2); background-image: -ms-linear-gradient(#b3c0c4, #899ca2); background-image: linear-gradient(#b3c0c4, #899ca2); text-shadow: rgba(0, 0, 0, 0.3) 0px -1px 0; }
+.cms table.ss-gridfield-table tr.title th h2 { padding: 0px; font-size: 16.8px; color: #fff; margin: 3px 8px 0; display: inline-block; float: left; }
+.cms table.ss-gridfield-table tr.sortable-header { background: #bfcdd2; }
+.cms table.ss-gridfield-table tr.sortable-header th { padding: 0px; }
.cms table.ss-gridfield-table tr:hover { background: #FFFAD6 !important; }
.cms table.ss-gridfield-table tr:first-child { background: transparent; }
.cms table.ss-gridfield-table tr.ss-gridfield-even { background: #f0f4f7; }
@@ -84,14 +75,14 @@
.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; -o-border-radius: 2px / 2px; -ms-border-radius: 2px / 2px; -khtml-border-radius: 2px / 2px; border-radius: 2px / 2px; }
+.cms table.ss-gridfield-table tr th.first { -moz-border-radius-topleft: 7px; -webkit-border-top-left-radius: 7px; -o-border-top-left-radius: 7px; -ms-border-top-left-radius: 7px; -khtml-border-top-left-radius: 7px; border-top-left-radius: 7px; }
+.cms table.ss-gridfield-table tr th.last { -moz-border-radius-topright: 7px; -webkit-border-top-right-radius: 7px; -o-border-top-right-radius: 7px; -ms-border-top-right-radius: 7px; -khtml-border-top-right-radius: 7px; border-top-right-radius: 7px; }
.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:hover { background-position: right -34px; }
+.cms table.ss-gridfield-table tr th button.ss-gridfield-sort { background: transparent url(../images/arrows.png) no-repeat right 10px; border: none; width: 100%; text-align: left; padding: 4px 8px 4px 0; text-shadow: rgba(0, 0, 0, 0.3) 0px -1px 0; color: #fff; -moz-border-radius: 0; -webkit-border-radius: 0; -o-border-radius: 0; -ms-border-radius: 0; -khtml-border-radius: 0; border-radius: 0; }
+.cms table.ss-gridfield-table tr th button.ss-gridfield-sort:hover { background-position: right -30px; }
.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; }
@@ -112,9 +103,9 @@
.cms table.ss-gridfield-table tr th input.ss-gridfield-sort:-ms-input-placeholder { font-style: italic; color: #ced5d7; }
.cms table.ss-gridfield-table tr th input.ss-gridfield-sort:placeholder { font-style: italic; color: #ced5d7; }
.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 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: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjUwJSIgeTE9IjAlIiB4Mj0iNTAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2IzYzBjNCIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzg5OWNhMiIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA=='); background-size: 100%; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #b3c0c4), color-stop(100%, #899ca2)); background-image: -webkit-linear-gradient(#b3c0c4, #899ca2); background-image: -moz-linear-gradient(#b3c0c4, #899ca2); background-image: -o-linear-gradient(#b3c0c4, #899ca2); background-image: -ms-linear-gradient(#b3c0c4, #899ca2); background-image: linear-gradient(#b3c0c4, #899ca2); }
.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; }
View
8 forms/gridfield/GridField.php
@@ -57,6 +57,8 @@ class GridField extends FormField {
*/
protected $columnDispatch = null;
+ protected $name = '';
+
/**
* Creates a new GridField field
*
@@ -67,6 +69,7 @@ class GridField extends FormField {
*/
public function __construct($name, $title = null, SS_List $dataList = null, GridFieldConfig $config = null) {
parent::__construct($name, $title, null);
+ $this->name = $name;
if($dataList) {
$this->setList($dataList);
@@ -79,8 +82,7 @@ public function __construct($name, $title = null, SS_List $dataList = null, Grid
}
$this->config->addComponent(new GridState_Component());
- $this->state = new GridState($this);
-
+ $this->state = new GridState($this);
$this->addExtraClass('ss-gridfield');
}
@@ -350,6 +352,8 @@ public function FieldHolder($properties = array()) {
'cellpadding' => '0',
'cellspacing' => '0'
);
+
+
return
$this->createTag('fieldset', $attrs,
$content['before'] .
View
1  forms/gridfield/GridFieldAddNewButton.php
@@ -15,6 +15,7 @@ public function __construct($targetFragment = 'before') {
public function getHTMLFragments($gridField) {
$data = new ArrayData(array(
'NewLink' => Controller::join_links($gridField->Link('item'), 'new'),
+ 'ButtonName' => _t('GridField.Add', 'Add') . ' ' . _t('GridField.' . $gridField -> name, $gridField -> name),
));
return array(
$this->targetFragment => $data->renderWith('GridFieldAddNewbutton'),
View
27 forms/gridfield/GridFieldButtonRow.php
@@ -0,0 +1,27 @@
+<?php
+/**
+ * Adding this class to a {@link GridFieldConfig} of a {@link GridField} adds a buttonrow to that field.
+ * The button row provides a space for actions on this grid.
+ *
+ * This row provides two new HTML fragment spaces: 'toolbar-header-left' and 'toolbar-header-right'.
+ *
+ * @package framework
+ * @subpackage gridfield
+ */
+class GridFieldButtonRow implements GridField_HTMLProvider {
+ protected $targetFragment;
+
+ public function __construct($targetFragment = 'before') {
+ $this->targetFragment = $targetFragment;
+ }
+
+ public function getHTMLFragments( $gridField) {
+ $data = new ArrayData(array(
+ "LeftFragment" => "\$DefineFragment(buttons-{$this->targetFragment}-left)",
+ "RightFragment" => "\$DefineFragment(buttons-{$this->targetFragment}-right)",
+ ));
+ return array(
+ $this->targetFragment => $data->renderWith('GridFieldButtonRow')
+ );
+ }
+}
View
10 forms/gridfield/GridFieldConfig.php
@@ -191,8 +191,10 @@ public static function create($itemsPerPage=null){
* @param int $itemsPerPage - How many items per page should show up
*/
public function __construct($itemsPerPage=null) {
+
+ $this->addComponent(new GridFieldButtonRow('before'));
+ $this->addComponent(new GridFieldAddNewButton('buttons-before-left'));
$this->addComponent(new GridFieldToolbarHeader());
- $this->addComponent(new GridFieldAddNewButton('toolbar-header-right'));
$this->addComponent($sort = new GridFieldSortableHeader());
$this->addComponent($filter = new GridFieldFilterHeader());
$this->addComponent(new GridFieldDataColumns());
@@ -238,9 +240,11 @@ public static function create($itemsPerPage=null){
* @param int $itemsPerPage - How many items per page should show up
*/
public function __construct($itemsPerPage=null) {
+
+ $this->addComponent(new GridFieldButtonRow('before'));
+ $this->addComponent(new GridFieldAddNewButton('buttons-before-left'));
+ $this->addComponent(new GridFieldAddExistingAutocompleter('buttons-before-left'));
$this->addComponent(new GridFieldToolbarHeader());
- $this->addComponent(new GridFieldAddExistingAutocompleter('toolbar-header-left'));
- $this->addComponent(new GridFieldAddNewButton('toolbar-header-right'));
$this->addComponent($sort = new GridFieldSortableHeader());
$this->addComponent($filter = new GridFieldFilterHeader());
$this->addComponent(new GridFieldDataColumns());
View
5 forms/gridfield/GridFieldToolbarHeader.php
@@ -1,10 +1,7 @@
<?php
/**
* Adding this class to a {@link GridFieldConfig} of a {@link GridField} adds a header title to that field.
- * The header serves double duty of displaying the name of the data the GridField is showing and
- * providing a space for actions on this grid.
- *
- * This header provides two new HTML fragment spaces: 'toolbar-header-left' and 'toolbar-header-right'.
+ * The header serves to display the name of the data the GridField is showing.
*
* @package framework
* @subpackage gridfield
View
36 scss/GridField.scss
@@ -12,7 +12,7 @@
@import "compass/css3/text-shadow";
@import "compass/css3/border-radius";
@import "../admin/scss/themes/default";
-@import "../admin/scss/themes/default";
+@import "../admin/scss/_mixins";
@import "_elementMixins";
//$experimental-support-for-svg variable comes from
@@ -44,6 +44,10 @@ $gf_grid_x: 16px;
.ss-gridfield {
& > div {
margin-bottom: $gf_grid_y*3;
+ &.addNewGridFieldButton{
+ margin-bottom:$gf_grid_y;
+ @include clearfix;
+ }
}
&[data-selectable] {
@@ -69,6 +73,22 @@ $gf_grid_x: 16px;
padding-left:26px; //to accomodate wider export icon
}
}
+ .right {
+ float:right;
+ & > * {
+ float: right;
+ margin-left:5px;
+ font-size: $gf_grid_y*1.2;
+ }
+ }
+ .left {
+ float:left;
+ & > * {
+ margin-right:5px;
+ float: left;
+ font-size: $gf_grid_y*1.2;
+ }
+ }
}
.ss-gridfield {
@@ -101,6 +121,7 @@ $gf_grid_x: 16px;
border-collapse: separate;
border-bottom: 0 none;
width: 100%;
+ margin-bottom:$gf_grid_y;
thead {
color: darken($color-base, 50%);
@@ -259,7 +280,7 @@ $gf_grid_x: 16px;
tr {
&.title {
th {
- position: relative;
+ position: relative;
background: $gf_colour_gradient_dark;
border-bottom: 1px solid darken($gf_colour_gradient_dark,5%);
padding: 5px;
@@ -272,15 +293,8 @@ $gf_grid_x: 16px;
color:#fff;
margin: 1px 8px 0;
display:inline-block;
- }
- .right > * {
- float: right;
- font-size: $gf_grid_y*1.2;
- }
- .left > * {
- float: left;
- font-size: $gf_grid_y*1.2;
- }
+ float:left;
+ }
}
}
&.sortable-header {
View
22 scss/_elementMixins.scss
@@ -1,11 +1,11 @@
-/**
- * This file contains mixins relating to specific functionality
- *
- * Mixins should be stored here rather than individual files
- */
+//**
+// * This file contains mixins relating to specific functionality
+// *
+// * Mixins should be stored here rather than individual files
+// */
-/*Mixin generates the generic button styling for the gridfield*/
+//*Mixin generates the generic button styling for the gridfield*/
@mixin gridFieldButtons{
border:none;
display:block;
@@ -15,11 +15,11 @@
}
-/**
- Mixin creates a transparent button with a dropdown arrow,
- as is used for files in the files up-load area. The arrows
- themselves are added in the _style file
-**/
+//**
+// Mixin creates a transparent button with a dropdown arrow,
+// as is used for files in the files up-load area. The arrows
+// themselves are added in the _style file
+//**/
@mixin ss-uploadfield-editButton{
&.ss-uploadfield-item-edit {
opacity:0.9;
View
61 scss/_mixins.scss
@@ -0,0 +1,61 @@
+/**
+ * This file contains mixins relating to specific functionality
+ *
+ * Mixins should be stored here rather than individual files
+ */
+
+
+/*Mixin generates the generic button styling for the gridfield*/
+@mixin gridFieldButtons{
+ border:none;
+ display:block;
+ text-indent:-9999em;
+ width:30px;
+ height:25px; //match the height of the input field
+}
+
+
+/**
+ Mixin creates a transparent button with a dropdown arrow,
+ as is used for files in the files up-load area. The arrows
+ themselves are added in the _style file
+**/
+@mixin ss-uploadfield-editButton{
+ &.ss-uploadfield-item-edit {
+ opacity:0.9;
+ padding-top: 3px;
+ padding-bottom: 0;
+ height:100%;
+ @include border-radius(0);
+ &.ui-state-hover{
+ background:none;
+ opacity:1;
+ span.toggle-details{
+ opacity:1;
+ }
+ }
+ span.toggle-details{
+ opacity:0.9;
+ margin-left:3px;
+ display: inline-block;
+ width: 5px;
+ height: 100%;
+ cursor: pointer;
+ .toggle-details-icon {
+ margin-top:1px;
+ display: inline-block;
+ width: 8px;
+ height: 8px;
+ vertical-align: middle;
+ &.opened {
+ margin-top:0;
+ }
+ }
+ }
+
+ }
+
+ .ui-icon {
+ display: none;
+ }
+}
View
4 templates/Includes/GridFieldAddNewButton.ss
@@ -1 +1,3 @@
-<a href="$NewLink" class="action action-detail ss-ui-action-constructive ss-ui-button ui-button ui-widget ui-state-default ui-corner-all new new-link" data-icon="add"><% _t('GridField.AddNew', 'Add New') %></a>
+<a href="$NewLink" class="action action-detail ss-ui-action-constructive ss-ui-button ui-button ui-widget ui-state-default ui-corner-all new new-link" data-icon="add">
+$ButtonName
+</a>
View
4 templates/Includes/GridFieldButtonRow.ss
@@ -0,0 +1,4 @@
+<div class="addNewGridFieldButton">
+ <div class="left">$LeftFragment</div>
+ <div class="right">$RightFragment</div>
+</div>
View
2  templates/Includes/GridFieldToolbarHeader.ss
@@ -1,7 +1,7 @@
<tr class="title">
<th colspan="$ColumnCount">
<% if Title %><h2>$Title</h2><% end_if %>
- <div class="left">\$DefineFragment(toolbar-header-left)</div>
<div class="right">\$DefineFragment(toolbar-header-right)</div>
+ <div class="left">\$DefineFragment(toolbar-header-left)</div>
</th>
</tr>
View
2  templates/Includes/GridField_print.ss
@@ -1,4 +1,4 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<% if $Title %><title>$Title</title><% end_if %>

No commit comments for this range

Something went wrong with that request. Please try again.