Created by: gracewashere
Change from:
administrate (master) tree administrate/app/views/fields
administrate/app/views/fields
├── form
│ ├── _belongs_to.html.erb
│ ├── _email.html.erb
│ ├── _has_many.html.erb
│ ├── _has_one.html.erb
│ ├── _image.html.erb
│ └── _string.html.erb
├── index
│ ├── _belongs_to.html.erb
│ ├── _email.html.erb
│ ├── _has_many.html.erb
│ ├── _has_one.html.erb
│ ├── _image.html.erb
│ └── _string.html.erb
└── show
├── _belongs_to.html.erb
├── _email.html.erb
├── _has_many.html.erb
├── _has_one.html.erb
├── _image.html.erb
└── _string.html.erb
to:
administrate (gw-reorg-partials) tree administrate/app/views/fields
administrate/app/views/fields
├── belongs_to
│ ├── _form.html.erb
│ ├── _index.html.erb
│ └── _show.html.erb
├── email
│ ├── _form.html.erb
│ ├── _index.html.erb
│ └── _show.html.erb
├── has_many
│ ├── _form.html.erb
│ ├── _index.html.erb
│ └── _show.html.erb
├── has_one
│ ├── _form.html.erb
│ ├── _index.html.erb
│ └── _show.html.erb
├── image
│ ├── _form.html.erb
│ ├── _index.html.erb
│ └── _show.html.erb
└── string
├── _form.html.erb
├── _index.html.erb
└── _show.html.erb
Why:
- Grouping by field type makes it easier to add new field types: developers or gem authors can provide a single directory with the three necessary partials.
- The initial motivation for grouping by page type (more meaningful variable names in partials) is no longer applicable. We started passing in the partial's
field
variable explicitly, so the variable name is no longer tied to the file name.
This change addresses the need by:
- Rename the field variable in partials to
field
, regardless of field type - Give partials a new home at
administrate/app/views/fields/<page>/<field>
Tags: #ruby