1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-28 00:10:57 +01:00
phorge-phorge/webroot/rsrc/css/aphront
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-bars.css Move Aphront bars and notes out of 'core' 2013-04-09 20:39:54 -07:00
aphront-notes.css Move Aphront bars and notes out of 'core' 2013-04-09 20:39:54 -07:00
attached-file-view.css Crop screenshot thumbs in Maniphest 2011-06-01 15:38:17 -07:00
calendar-view.css Highlighting the current day in calendar. 2013-04-29 12:15:38 -07:00
context-bar.css fix aphront context bar bottom margin -- don't need it 2012-12-13 10:46:53 -08:00
dark-console.css Color DarkConsole links 2013-02-28 16:19:36 -08:00
dialog-view.css Allow AphrontDialogView to use PhabricatorActionHeaderView 2013-04-09 15:50:48 -07:00
error-view.css Conpherence - make updating title + picture a dialogue that uses drag and drop upload control 2013-01-26 17:14:58 -08:00
form-view.css Add a basic multipage form 2013-05-23 14:39:01 -07:00
lightbox-attachment.css Move all CSS "z-index" rules to "z-index.css", fix Differential z-index problem 2012-12-30 09:30:21 -08:00
list-filter-view.css Flags on mobile, fix some filter-css 2013-04-03 11:29:58 -07:00
multi-column.css Add Shadow Panels to PhabricatorMultiColumnView 2013-05-21 15:28:43 -07:00
notification.css Move all CSS "z-index" rules to "z-index.css", fix Differential z-index problem 2012-12-30 09:30:21 -08:00
pager-view.css AphrontPagerView and UIExamples. 2011-03-31 17:06:33 -07:00
panel-view.css Modernize Diffusion 2013-05-11 08:23:19 -07:00
phabricator-nav-view.css Flatten side nav 2013-05-17 09:58:37 -07:00
request-failure-view.css PhabricatorEnv 2011-01-31 11:55:26 -08:00
table-view.css Define background for table header 2013-04-24 12:20:27 -07:00
tokenizer.css Fix placeholder color 2013-05-12 20:14:17 -07:00
tooltip.css Move all CSS "z-index" rules to "z-index.css", fix Differential z-index problem 2012-12-30 09:30:21 -08:00
transaction.css Group inline transactions in Pholio 2013-03-09 19:23:50 -08:00
two-column.css Phriction Redesign 2013-04-11 15:05:50 -07:00
typeahead.css Cleanup Typeahead and Global Search Typeahead 2013-05-16 13:10:06 -07:00