mirror of
https://github.com/colymba/GridFieldBulkEditingTools.git
synced 2024-10-22 11:05:57 +02:00
Merge remote-tracking branch 'origin/0.3'
This commit is contained in:
commit
834d7466e7
31
README.md
31
README.md
@ -1,6 +1,11 @@
|
|||||||
GridField Bulk Editing Tools
|
GridField Bulk Editing Tools
|
||||||
============================
|
============================
|
||||||
SilverStripe 3 GridField component set to facilitate bulk editing, adding and deletion of records.
|
SilverStripe 3 GridField component set to facilitate bulk image upload, bulk record editing, unlinking and deleting.
|
||||||
|
Included are:
|
||||||
|
* [Bulk Image Upload](#bulk-image-upload): Bulk images upload and on the fly fields editing
|
||||||
|
* [Bulk Manager](#bulk-manager): Delete and unlink multiple records at once as well as editing records in bulk
|
||||||
|
|
||||||
|
Take a look at the [Notes](#notes) and [TODOs](#todo).
|
||||||
|
|
||||||
## Requirments
|
## Requirments
|
||||||
* SilverStripe 3.0
|
* SilverStripe 3.0
|
||||||
@ -10,11 +15,9 @@ SilverStripe 3 GridField component set to facilitate bulk editing, adding and de
|
|||||||
* Run dev/build?flush=all to regenerate the manifest
|
* Run dev/build?flush=all to regenerate the manifest
|
||||||
* run ?flush=all in CMS to force the templates to regenerate
|
* run ?flush=all in CMS to force the templates to regenerate
|
||||||
|
|
||||||
# 1/ Bulk Image Upload
|
## Bulk Image Upload
|
||||||
A component for uploading images in bulk into the managed Model relation, with option to edit fields on the fly.
|
A component for uploading images in bulk into the managed Model relation, with option to edit fields on the fly.
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
### Usage 1
|
### Usage 1
|
||||||
Simplest usage, add the component to your GridField as below. The component will find the first Image has_one relation on the managed Model and the record's editable CMS fields
|
Simplest usage, add the component to your GridField as below. The component will find the first Image has_one relation on the managed Model and the record's editable CMS fields
|
||||||
|
|
||||||
@ -111,42 +114,42 @@ In addition, some configuration option can be set more specifically via individu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# 2/ Bulk Manager
|
## Bulk Manager
|
||||||
A component for Editing, deleting and unlinking records on the fly
|
A component for Editing, deleting and unlinking records on the fly
|
||||||
|
|
||||||
## Usage
|
### Usage
|
||||||
Add GridFieldBulkEditingTools component if not done already and simply add GridFieldBulkImageUpload
|
Add GridFieldBulkEditingTools component if not done already and simply add GridFieldBulkImageUpload
|
||||||
|
|
||||||
$config->addComponent(new GridFieldBulkEditingTools());
|
$config->addComponent(new GridFieldBulkEditingTools());
|
||||||
$config->addComponent(new GridFieldBulkManager());
|
$config->addComponent(new GridFieldBulkManager());
|
||||||
|
|
||||||
## Configuration
|
### Configuration
|
||||||
The component's option can be configurated individually or in bulk through the 'config' functions like this:
|
The component's option can be configurated individually or in bulk through the 'config' functions like this:
|
||||||
|
|
||||||
$config->getComponentByType('GridFieldBulkManager')->setConfig( $reference, $value );
|
$config->getComponentByType('GridFieldBulkManager')->setConfig( $reference, $value );
|
||||||
|
|
||||||
### $config overview
|
#### $config overview
|
||||||
The available configuration options are:
|
The available configuration options are:
|
||||||
* 'editableFields' : array of string referencing specific CMS fields available for editing
|
* 'editableFields' : array of string referencing specific CMS fields available for editing
|
||||||
* 'fieldsClassBlacklist' : array of string referencing types (ClassName) of fields that wont be available for editing
|
* 'fieldsClassBlacklist' : array of string referencing types (ClassName) of fields that wont be available for editing
|
||||||
* 'fieldsNameBlacklist' : array of string referencing the names of fields that wont be available for editing
|
* 'fieldsNameBlacklist' : array of string referencing the names of fields that wont be available for editing
|
||||||
|
|
||||||
# Notes
|
## Notes
|
||||||
* The HTML form fields for each editable fields are taken from the Model's getCMSFields() method
|
* The HTML form fields for each editable fields are taken from the Model's getCMSFields() method
|
||||||
* This is still pretty experimental and probably needs a bit more in depth testing
|
* This is still pretty experimental and probably needs a bit more in depth testing
|
||||||
* The code could probably be written better and/or cleaned up
|
* The code could probably be written better and/or cleaned up
|
||||||
* The Components take bit and pieces around from CMSFileAddController, GridFieldDetailForm_ItemRequest, UploadField, overrides and adds some behaviors, templates and styles...
|
* The Components take bit and pieces around from CMSFileAddController, GridFieldDetailForm_ItemRequest, UploadField, overrides and adds some behaviors, templates and styles...
|
||||||
|
|
||||||
# @TODO
|
## @TODO
|
||||||
|
|
||||||
## Common bug
|
### Common bug
|
||||||
* When editing fields, if the last field of the edit form is a drop down or similar, the drop down menu is cropped off
|
* When editing fields, if the last field of the edit form is a drop down or similar, the drop down menu is cropped off
|
||||||
|
* Some 'minor' things just don't work
|
||||||
|
|
||||||
## Bulk Image Upload
|
### Bulk Image Upload
|
||||||
* Add individual actions for each upload (update + cancel)
|
* Add individual actions for each upload (update + cancel)
|
||||||
* Handle and display errors better for: creation, update, cancel
|
* Handle and display errors better for: creation, update, cancel
|
||||||
* Make it work not only for images -> might need to rename this component then? -> should be handled by another component
|
* Make it work not only for images -> might need to rename this component then? -> should be handled by another component
|
||||||
|
|
||||||
## Bulk Manager
|
### Bulk Manager
|
||||||
* Refresh GridField after record(s) are deleted or unlinked
|
|
||||||
* Make 'select all' menu prettier
|
* Make 'select all' menu prettier
|
@ -1,6 +1,5 @@
|
|||||||
(function($) {
|
(function($) {
|
||||||
|
|
||||||
|
|
||||||
$.entwine('colymba', function($) {
|
$.entwine('colymba', function($) {
|
||||||
|
|
||||||
$('td.col-bulkSelect').entwine({
|
$('td.col-bulkSelect').entwine({
|
||||||
@ -55,7 +54,7 @@
|
|||||||
},
|
},
|
||||||
onclick: function(){
|
onclick: function(){
|
||||||
var state = $(this).prop('checked');
|
var state = $(this).prop('checked');
|
||||||
$('td.col-bulkSelect input').each(function(){ $(this).prop('checked', state); });
|
$('td.col-bulkSelect input').each(function(){$(this).prop('checked', state);});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -134,7 +133,7 @@
|
|||||||
type: "POST",
|
type: "POST",
|
||||||
context: $(this)
|
context: $(this)
|
||||||
}).done(function() {
|
}).done(function() {
|
||||||
//@TODO refresh GridField
|
$(this).parents('.ss-gridfield').entwine('.').entwine('ss').reload();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user