From 34674059f6e456e5acdb9a98faf523e13702776f Mon Sep 17 00:00:00 2001 From: Ryan O'Hara Date: Fri, 10 Aug 2012 14:58:26 +1200 Subject: [PATCH 1/5] ENHANCEMENT: Add styling for linking documents. Add classes for framework js to work --- css/DMSMainCMS.css | 2 + javascript/DMSDocumentAddExistingField.js | 64 +++++++++++------------ javascript/DMSDocumentCMSFields.js | 1 - scss/DMSMainCMS.scss | 6 +++ templates/DMSDocumentAddExistingField.ss | 4 +- 5 files changed, 42 insertions(+), 35 deletions(-) diff --git a/css/DMSMainCMS.css b/css/DMSMainCMS.css index db4f185..87e8df2 100644 --- a/css/DMSMainCMS.css +++ b/css/DMSMainCMS.css @@ -1,3 +1,5 @@ +#Main_FromtheCMS .ss-uploadfield-item-edit { position: relative; } + #Root_Documents { padding-left: 0; } #Root_Documents table { white-space: normal; } #Root_Documents table th.col-action_SetOrderTitle, #Root_Documents table th.col-FilenameWithoutID { width: 300px; } diff --git a/javascript/DMSDocumentAddExistingField.js b/javascript/DMSDocumentAddExistingField.js index ea15059..475bb9d 100644 --- a/javascript/DMSDocumentAddExistingField.js +++ b/javascript/DMSDocumentAddExistingField.js @@ -3,42 +3,42 @@ $.entwine('ss', function($) { - $('.document-add-existing .document-autocomplete').entwine({ - onmatch: function() { - var self = this; - this.autocomplete({ - source: 'admin/pages/adddocument/documentautocomplete', - select: function(event, ui) { - if(ui.item) { - var page_id = $(this).closest('form').find(':input[name=ID]').val(); - var document_id = ui.item.value; + $('.document-add-existing .document-autocomplete').entwine({ + onmatch: function() { + var self = this; + this.autocomplete({ + source: 'admin/pages/adddocument/documentautocomplete', + select: function(event, ui) { + if(ui.item) { + var page_id = $(this).closest('form').find(':input[name=ID]').val(); + var document_id = ui.item.value; - jQuery.ajax( - 'admin/pages/adddocument/linkdocument?ID=' + page_id + '&documentID=' + document_id, - { - dataType: 'json', - success: function(data, textstatus) { - var fn = window.tmpl.cache['ss-uploadfield-addtemplate']; - var fnout = fn({ - files: [data], - formatFileSize: function (bytes) { - if (typeof bytes !== 'number') return ''; - if (bytes >= 1000000000) return (bytes / 1000000000).toFixed(2) + ' GB'; - if (bytes >= 1000000) return (bytes / 1000000).toFixed(2) + ' MB'; - return (bytes / 1000).toFixed(2) + ' KB'; - }, - options: self.fileupload('option') - }); + jQuery.ajax( + 'admin/pages/adddocument/linkdocument?ID=' + page_id + '&documentID=' + document_id, + { + dataType: 'json', + success: function(data, textstatus) { + var fn = window.tmpl.cache['ss-uploadfield-addtemplate']; + var fnout = fn({ + files: [data], + formatFileSize: function (bytes) { + if (typeof bytes !== 'number') return ''; + if (bytes >= 1000000000) return (bytes / 1000000000).toFixed(2) + ' GB'; + if (bytes >= 1000000) return (bytes / 1000000).toFixed(2) + ' MB'; + return (bytes / 1000).toFixed(2) + ' KB'; + }, + options: self.fileupload('option') + }); - $('.ss-add-files').append(fnout); + $('.ss-add-files').append(fnout); + } } - } - ); + ); + } } - } - }); - } - }); + }); + } + }); }); }(jQuery)); \ No newline at end of file diff --git a/javascript/DMSDocumentCMSFields.js b/javascript/DMSDocumentCMSFields.js index 1b5ebbe..f34adcb 100644 --- a/javascript/DMSDocumentCMSFields.js +++ b/javascript/DMSDocumentCMSFields.js @@ -60,7 +60,6 @@ } }); - }); }(jQuery)); \ No newline at end of file diff --git a/scss/DMSMainCMS.scss b/scss/DMSMainCMS.scss index f5166ad..0eadd53 100644 --- a/scss/DMSMainCMS.scss +++ b/scss/DMSMainCMS.scss @@ -1,5 +1,11 @@ //data-icon="cross-circle" +#Main_FromtheCMS{ + .ss-uploadfield-item-edit{ + position: relative; + } +} + #Root_Documents{ padding-left: 0; table{ diff --git a/templates/DMSDocumentAddExistingField.ss b/templates/DMSDocumentAddExistingField.ss index 59c3498..57ec6b0 100644 --- a/templates/DMSDocumentAddExistingField.ss +++ b/templates/DMSDocumentAddExistingField.ss @@ -1,4 +1,4 @@ -
+

@@ -8,7 +8,7 @@

- +
From 09e156054cc4eb7fc3cceee8d2d497ca5facb5e0 Mon Sep 17 00:00:00 2001 From: Ryan O'Hara Date: Fri, 10 Aug 2012 15:12:41 +1200 Subject: [PATCH 2/5] BUGFIX: Remove fileOverview div from linking documents and remove edit button styling override. MINOR: add styling to autocomplete dropdown --- css/DMSMainCMS.css | 2 +- scss/DMSMainCMS.scss | 7 +++---- templates/DMSDocumentAddExistingField.ss | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/css/DMSMainCMS.css b/css/DMSMainCMS.css index 87e8df2..1b772a3 100644 --- a/css/DMSMainCMS.css +++ b/css/DMSMainCMS.css @@ -1,4 +1,4 @@ -#Main_FromtheCMS .ss-uploadfield-item-edit { position: relative; } +.ui-autocomplete { border: 1px solid #DDD; box-shadow: 0 1px 2px 0px #AFAFAF; } #Root_Documents { padding-left: 0; } #Root_Documents table { white-space: normal; } diff --git a/scss/DMSMainCMS.scss b/scss/DMSMainCMS.scss index 0eadd53..f714dfe 100644 --- a/scss/DMSMainCMS.scss +++ b/scss/DMSMainCMS.scss @@ -1,9 +1,8 @@ //data-icon="cross-circle" -#Main_FromtheCMS{ - .ss-uploadfield-item-edit{ - position: relative; - } +.ui-autocomplete{ + border: 1px solid #DDD; + box-shadow: 0 1px 2px 0px #AFAFAF; } #Root_Documents{ diff --git a/templates/DMSDocumentAddExistingField.ss b/templates/DMSDocumentAddExistingField.ss index 57ec6b0..46cb568 100644 --- a/templates/DMSDocumentAddExistingField.ss +++ b/templates/DMSDocumentAddExistingField.ss @@ -18,7 +18,7 @@ Edit Document Details -
+
    \ No newline at end of file From bfa2cdfa5904b3745673a2de3cd438e1cf92fe9e Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Mon, 13 Aug 2012 10:57:41 +1200 Subject: [PATCH 3/5] testing file for buildbot testing --- testfile | 1 + 1 file changed, 1 insertion(+) diff --git a/testfile b/testfile index e69de29..038d718 100644 --- a/testfile +++ b/testfile @@ -0,0 +1 @@ +testing From 5ba3fc133205d0f5a26f80f467957204e1a1bca7 Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Mon, 13 Aug 2012 10:59:46 +1200 Subject: [PATCH 4/5] Remove test file --- testfile | 1 - 1 file changed, 1 deletion(-) delete mode 100644 testfile diff --git a/testfile b/testfile deleted file mode 100644 index 038d718..0000000 --- a/testfile +++ /dev/null @@ -1 +0,0 @@ -testing From b4d00d40ebf01a8d5162cfa157b013dd6cec9355 Mon Sep 17 00:00:00 2001 From: Ryan O'Hara Date: Mon, 13 Aug 2012 12:46:56 +1200 Subject: [PATCH 5/5] MINOR: Fix styling to error message when replacing with a non supported document extension --- css/DMSDocumentCMSFields.css | 8 +++++++- scss/DMSDocumentCMSFields.scss | 35 ++++++++++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/css/DMSDocumentCMSFields.css b/css/DMSDocumentCMSFields.css index 4e86bfc..fbdf935 100644 --- a/css/DMSDocumentCMSFields.css +++ b/css/DMSDocumentCMSFields.css @@ -28,7 +28,13 @@ form.small .field input.text, form.small .field textarea, form.small .field sele #ActionsPanel .fieldgroup-field { float: none; width: auto; } #ActionsPanel .fieldgroup-field .fieldholder-small label { float: none; width: auto; margin: 0; padding: 0; } #ActionsPanel .fieldgroup-field .fieldholder-small label.ss-ui-button { float: left; margin: 0 10px 0 0; } +#ActionsPanel .ss-uploadfield-files .ss-uploadfield-item-preview { background: url("../images/app_icons/generic_32.png") -10px -6px no-repeat; } +#ActionsPanel .ss-uploadfield-files .ss-uploadfield-item-name span.name { width: 260px; } +#ActionsPanel .ss-uploadfield-files .ss-uploadfield-item-actions .ss-uploadfield-item-cancel { width: auto; text-indent: 0; } +#ActionsPanel .ss-uploadfield-files .ss-uploadfield-item-actions .ss-uploadfield-item-cancel .btn-icon-deleteLight { background-position: 0 -128px; display: inline-block; } +#ActionsPanel .ss-uploadfield-files .ss-uploadfield-item-actions .ss-uploadfield-item-cancel .ui-button-text { display: block; position: relative; float: right; color: #555; padding: 0; padding-left: 2em; } -#Form_ItemEditForm fieldset table.ss-gridfield-table { width: auto; max-width: 508px; } +#Form_ItemEditForm fieldset table.ss-gridfield-table { width: 508px; } #Form_ItemEditForm fieldset table.ss-gridfield-table tr th.main { min-width: 175px; } #Form_ItemEditForm fieldset table.ss-gridfield-table tr th.main.col-action_SetOrderID { width: 60px; min-width: 60px; } +#Form_ItemEditForm fieldset table.ss-gridfield-table tr td { white-space: normal; } diff --git a/scss/DMSDocumentCMSFields.scss b/scss/DMSDocumentCMSFields.scss index 9df7797..e4efb4a 100644 --- a/scss/DMSDocumentCMSFields.scss +++ b/scss/DMSDocumentCMSFields.scss @@ -123,13 +123,41 @@ form.small .field .TreeDropdownField, } } } + .ss-uploadfield-files{ + .ss-uploadfield-item-preview{ + background: url('../images/app_icons/generic_32.png') -10px -6px no-repeat; + } + .ss-uploadfield-item-name{ + span.name{ + width: 260px; + } + } + .ss-uploadfield-item-actions{ + .ss-uploadfield-item-cancel{ + width: auto; + text-indent:0; + .btn-icon-deleteLight{ + background-position: 0 -128px; + display: inline-block; + } + .ui-button-text{ + display: block; + position: relative; + float: right; + color: #555; + padding:0; + padding-left: 2em; + } + } + } + } } #Form_ItemEditForm{ fieldset{ table.ss-gridfield-table{ - width: auto; - max-width:508px; + width: 508px; + //max-width:508px; tr{ th.main{ min-width:175px; @@ -138,6 +166,9 @@ form.small .field .TreeDropdownField, min-width:60px; } } + td{ + white-space:normal; + } } } }