Development

#446 ([PATCH] Extensions to admin generator)

You must first sign up to be able to contribute.

Ticket #446 (new enhancement)

Opened 2 years ago

Last modified 2 weeks ago

[PATCH] Extensions to admin generator

Reported by: jphipps@madcreek.com Assigned to: fabien
Priority: major Milestone: 1.2.0
Component: generator Version: 0.7.X
Keywords: Cc:
Qualification: Design decision

Description

I've been extending the admin code generator a bit and I thought I'd mention what I'm doing to this list in case it might be of value to someone else. And I'd love some feedback if I'm doing anything incorrectly or unnecessarily:

1. Set default settings for minimum and maximum char field lengths, textarea colsxrows, and numeric field lengths in app.yml:

adminfield:

charmin: 20 charmax: 60 textrows: 3 textcols: 60 intsize: 7 floatsize: 7

2. Support for some of the text helpers (I'm not passing any parameters at the moment):

fields:

my_content: { helper: auto_link_text }

3. Support for url filters (for selecting detail records in master/detail groups) # urlfilter construct is [field to filter on]: [value passed from routing.yml] # multiple filters can be set but they're currently mutually exclusive (any of the list can be used but only one per url)

urlfilters:

invoice_id: inv_id

Creates the proper selection criteria for a url like "my_site/invoicedetail/list/invoice_id/27"

4. All actions accept a query_string parameter:

_list:

query_string:

user_id: my_id

will output "invoice/list?user_id=my_id" This would probably be better as a simple string:

query_string: "?concept_id=new_id"

...but I was young and foolish when I did it.

5. I found myself writing many partials for fields to implement different create vs. edit display type and security levels so the admin now generates a separate set of 'create' templates with a separate 'create' section in generator.yml from which I can control field-level display, type, and security.

6. I also very much missed having a display-only 'show' action, so the admin now creates a separate 'show' template, also with it's own section in generator.yml.

Like the list & edit actions, show and create allow the admin to override the generated header/footer templates for each action but the generator also creates acceptable defaults, and they work with the create & show actions, using the defaults for edit and list, even if there's no section in generator.yml.

I've only tested this against the field types I'm currently using so I haven't tested file upload.

This was built against revision 1218.

Attachments

symfony-admin-extend.zip (26.0 kB) - added by jphipps@madcreek.com on 04/19/06 20:31:06.
symfony-admin-extend.2.zip (26.0 kB) - added by jphipps@madcreek.com on 04/19/06 21:37:31.
Should replace original uploaded file

Change History

04/19/06 20:31:06 changed by jphipps@madcreek.com

  • attachment symfony-admin-extend.zip added.

04/19/06 20:33:58 changed by anonymous

  • version set to 0.7.X.

04/19/06 21:37:31 changed by jphipps@madcreek.com

  • attachment symfony-admin-extend.2.zip added.

Should replace original uploaded file

04/20/06 09:57:14 changed by anonymous

  • milestone set to 0.6.3.

06/16/06 09:46:47 changed by fabien

  • milestone changed from 0.6.3 to 1.0.0.

08/23/06 11:23:08 changed by fabien

  • milestone changed from 0.6.4 to post-1.0.

02/21/07 14:58:18 changed by francois

  • owner set to fabien.
  • component set to generator.

02/28/07 22:54:24 changed by jphipps

I'm going to be updating this patch into several separate small patches and a related plugin, and in the process making it Symfony 1.0 compatible.

05/10/08 22:36:59 changed by fabien

  • qualification set to Unreviewed.
  • milestone deleted.

06/23/08 06:06:40 changed by dwhittle

  • qualification changed from Unreviewed to Design decision.
  • milestone set to 1.2.0.