1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 07:12:41 +01:00
phorge-phorge/webroot/rsrc/css
epriestley 40680e459f Add a basic multipage form
Summary:
Ref T2232. Very busy day on IRC so I feel like I've made 20 minutes of progress in 1-minute spurts here, but this adds the basics for a form that can have multiple pages and automatically handle pagination and reading to/from the request, objects and responses.

The UIExample is reasonably instructive. Basically, you make a form, add pages to the form, and add controls to the pages. The core flow control looks like this:

  if ($request->isFormPost()) {
    $form->readFromRequest($request);                 // (1)
    if ($form->isComplete()) {                        // (2)
      $response = $form->writeToResponse($response);  // (3)
      // Process result here.                         // (4)
    }
  } else {
    $form->readFromObject($object);                   // (5)
  }

The key parts are:

  # This reads the form state from the request, including reading all the inactive pages.
  # This tests if all pages are valid and the user just clicked "Done" on the last page.
  # This produces a "response", which might be writing to an object (for simpler forms) or creating a transaction record (for more complex forms).
  # Here, we would save the object or apply the transactions.
  # When the user views the form for the first time, we preload all the values from some object (which might just be empty).

Ultimate goal here is to fix repository creation to not be a terrible pit of awfulness.

There are probably a lot of rough edges and missing features still, but this seems to not be totally crazy.

I'm using two submit buttons with different names which doesn't work on IE7 or something, but we can JS our way out of that if we need to.

Test Plan: Paged forward and backward through the form.

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2232

Differential Revision: https://secure.phabricator.com/D6003
2013-05-23 14:39:01 -07:00
..
aphront Add a basic multipage form 2013-05-23 14:39:01 -07:00
application Tighten up message pane in Conpherence 2013-05-22 20:47:47 -07:00
core Add a basic multipage form 2013-05-23 14:39:01 -07:00
layout Modernize Audit 2013-05-18 10:49:37 -07:00
phui Use PHUIFeedStory in Phame 2013-05-21 15:32:17 -07:00
sprite-actions.css Add action icons to object list views 2013-05-10 12:57:01 -07:00
sprite-apps-large.css Refresh Feed Design 2013-04-13 09:09:42 -07:00
sprite-apps-xlarge.css Added Feed icons. 2013-01-10 10:00:18 -08:00
sprite-apps.css Refresh Feed Design 2013-04-13 09:09:42 -07:00
sprite-conpherence.css Conpherence - some cleanup type stuff 2013-03-13 13:03:51 -07:00
sprite-docs.css Document icons sprite sheet. 2013-03-10 14:16:16 -07:00
sprite-gradient.css Flatten side nav 2013-05-17 09:58:37 -07:00
sprite-icons.css Add action icons to object list views 2013-05-10 12:57:01 -07:00
sprite-menu.css Rework Mobile Header and Mobile Home. 2013-03-22 11:50:30 -07:00
sprite-minicons.css PhabricatorActionHeaderView v0 2013-04-05 07:40:27 -07:00
sprite-payments.css Payment sprite icons. 2013-04-22 16:41:00 -07:00
sprite-tokens.css PHUIIconView 2013-04-19 17:44:20 -07:00