Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A administrate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 96
    • Issues 96
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • thoughtbot, inc.
  • administrate
  • Merge requests
  • !57

Reorganize field partials around field type

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge gw-reorg-partials into master Aug 24, 2015
  • Overview 2
  • Commits 1
  • Pipelines 0
  • Changes 41

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

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: gw-reorg-partials