From 166d6f421f500be64bb8c5c2ec456cfe12f9ba70 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 20 May 2010 07:28:13 +0000 Subject: [PATCH] ENHANCEMENT 'Select all' and 'Select none' checkboxes for CommentTableField for easier batch handling of comments, improved its styling in CommentAdmin git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@105271 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/CommentTableField.php | 6 +++++ css/CommentAdmin.css | 30 ++++++++++++++++++++++++- templates/Includes/CommentTableField.ss | 11 ++++++--- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/code/CommentTableField.php b/code/CommentTableField.php index cf0d6c56..4cf4c2a4 100644 --- a/code/CommentTableField.php +++ b/code/CommentTableField.php @@ -17,6 +17,12 @@ class CommentTableField extends ComplexTableField { $this->Markable = true; + // Note: These keys have special behaviour associated through TableListField.js + $this->selectOptions = array( + 'all' => _t('TableListField.ALL', 'All'), + 'none' => _t('TableListField.NONE', 'None') + ); + // search $search = isset($_REQUEST['CommentSearch']) ? Convert::raw2sql($_REQUEST['CommentSearch']) : null; if(!empty($_REQUEST['CommentSearch'])) { diff --git a/css/CommentAdmin.css b/css/CommentAdmin.css index 7ed6f8f9..4060f6d0 100644 --- a/css/CommentAdmin.css +++ b/css/CommentAdmin.css @@ -1,3 +1,30 @@ +#Form_EditForm{ + overflow: scroll; +} + + #Form_EditForm table{ + width: 100%; + } + + #Form_EditForm table td{ + word-wrap:break-word !important; + } + + #Form_EditForm table td.Comment{ + width: 32%; + } + + #Form_EditForm table td.URL{ + width: 18%; + } + + #Form_EditForm table td.Page{ + width: 20%; + } + +/* The following is not used anywhere, we should delete it. Because this file has not been +included in the template due to a bug since 29/09/08 (r63175), and we can't find a HTML element with the id 'CommentList' + #CommentList { padding: 0; margin: 0; @@ -13,4 +40,5 @@ margin-top: 3px; font-size: 80%; font-style: italic; -} \ No newline at end of file +} +*/ \ No newline at end of file diff --git a/templates/Includes/CommentTableField.ss b/templates/Includes/CommentTableField.ss index 8f939bbd..4e2757e2 100644 --- a/templates/Includes/CommentTableField.ss +++ b/templates/Includes/CommentTableField.ss @@ -2,7 +2,12 @@
$SearchForm
- <% include TableListField_PageControls %> + <% if Print %><% else %> + <% if Markable %> + <% include TableListField_SelectControls %> + <% end_if %> + <% include TableListField_PageControls %> + <% end_if %> @@ -39,9 +44,9 @@ <% if Items %> <% control Items %> class="$HighlightClasses"<% end_if %>> - <% if Markable %><% end_if %> + <% if Markable %><% end_if %> <% control Fields %> - + <% end_control %> <% if Can(edit) %>
$MarkingCheckbox$MarkingCheckbox$Value$Value<% _t('EDIT', 'edit') %>