Closed ioleo closed 10 years ago
:+1:!
I will try this one soon! I do not think that will be this month, but you never know...
@bobvandevijver probably today I'll be publishing a "DemoProject", so everyone can quickly and easily preview new features
@bobvandevijver I've just published symfony2admingenerator/symfony2-admingenerator-demo-edition.
To use the demo, simply CLONE it. Then create localhost database for this parameters:
app/config/parameters.yml.dist
or change the parameters in app/config/parameters.yml
Then "cd" into demo root dir and do:
composer install
these should automatically be done with composer install, but if they fail for any reason:
php app/console cache:clear --env=dev
php app/console assets:install web --symlink
php app/console assetic:dump --env=dev
then type these to create database tables and fill them with data
php app/console doctrine:schema:create
php app/console doctrine:fixtures:load
And then do php app/console server:run
And go to http://127.0.0.1/app_dev.php
in your browser.
Note: the demo is not complete yet. But it will be updated.
@bobvandevijver The demo project so far:
Equal, Not Equal, Greater Than, Greater Than or Equal, Less Than, Less Than or Equal, Like, Not Like, Contains, Not Contains
eg. Like is only for TEXT and ARRAY's (becouse array mapping is a serialized text)
eg2. Greater/Less Than operations are only for numeric and date fields
@bobvandevijver Packagist does not allow submitting the same git repo URL twice, so, I needed to create new repositories for both GeneratorBundle and FormExtensionsBundle, becouse I renamed the packagist packages:
Note: New (unstable) repositories and packagist names:
- AdmingeneratorGeneratorBundle github:
git@github.com:symfony2admingenerator/GeneratorBundle.git
packagist: "symfony2admingenerator/generator-bundle"- AdmingeneratorFormExtensionsBundle github:
git@github.com:symfony2admingenerator/FormExtensionsBundle.git
packagist: "symfony2admingenerator/form-extensions-bundle"Note: Old (legacy) repositories and packagist names:
- AdmingeneratorGeneratorBundle github:
git@github.com:symfony2admingenerator/AdmingeneratorGeneratorBundle.git
packagist: "cedriclombardot/admingenerator-generator-bundle"- AvocodeFormExtensionsBundle github:
git@github.com:symfony2admingenerator/AvocodeFormExtensionsBundle.git
packagist: "avocode/form-extensions-bundle"Warning: These repositories are left for legacy users and are NOT COMPATIBLE with this demo.
@bobvandevijver also created an updated version of UserBundle:
New (unstable) repository:
- AdmingeneratorUserBundle github:
git@github.com:symfony2admingenerator/UserBundle.git
packagist: "symfony2admingenerator/user-bundle"Old (legacy) repository:
- AdmingeneratorUserBundle github:
git@github.com:symfony2admingenerator/AdmingeneratorUserBundle.git
packagist: "cedriclombardot/admingenerator-user-bundle"
Added new features to GeneratorBundle:
handleXXXFilter
and handleXXXSort
for such columns, where XXX
is based on column's getter, eg:params:
fields:
balance:
getter: balance
filterType: number
builders:
list:
params:
display: [ balance ]
filters:
params:
display: [ balance ]
Will generate handleBalanceSort
and handleBalanceFilter
methods in BaseListBuilder.
You can overwrite these methods and apply custom query filter/sort logic.
Eg. you can:
processQuery
you can add a select for a virtual columns incomings
, outgoings
and balance
, calculated by subqueries:Note: this is just a sketch, this DQL is probably wrong :P
* `incomings`: `SELECT inc.amount FROM IncomingTransfer inc WHERE inc.account_id = q.id`
* `outgoings`: `SELECT out.amount FROM OutgoingTransfer out WHERE out.account_id = q.id`
* `balance`: `SUM (incomings, outgoings)` (this assumes outgoings is negative)
handleBalanceSort
you can simply add orderBy('balance', $order)
handleBalanceFilter
you can add equal/greaterthan/lessthan filter
This PR introduces new features:
tags.name
or evenshop.owner.adress.city.name
symfony2admingenerator/generator-bundle
This PR also introduces some changes:
base_admin.html.twig
now bundles the assets into packages (admingenerator_js
andadmingenerator_css
)uglifycss
anduglifyjs2
This PR is still not complete, there are some TODOs:
This PR has only been tested for Doctrine ORM! This needs testing for DoctrineODM and Propel.