2011-01-25 20:31:40 +01:00
|
|
|
/**
|
2013-06-13 03:23:35 +02:00
|
|
|
* @provides phui-button-css
|
2011-01-25 20:31:40 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2013-08-28 16:36:22 +02:00
|
|
|
button,
|
|
|
|
a.button {
|
2015-02-26 18:26:36 +01:00
|
|
|
font: {$basefont};
|
2014-11-21 02:05:32 +01:00
|
|
|
-webkit-font-smoothing: antialiased;
|
|
|
|
-webkit-user-select: none;
|
|
|
|
-moz-user-select: none;
|
|
|
|
-ms-user-select: none;
|
|
|
|
user-select: none;
|
2013-08-28 16:36:22 +02:00
|
|
|
}
|
|
|
|
|
2015-02-16 03:13:54 +01:00
|
|
|
button.phabricator-action-view-item {
|
|
|
|
-webkit-font-smoothing: auto;
|
|
|
|
}
|
|
|
|
|
2014-11-26 03:09:24 +01:00
|
|
|
button::-moz-focus-inner {
|
|
|
|
padding: 0;
|
|
|
|
border: 0;
|
|
|
|
}
|
|
|
|
|
2011-01-25 20:31:40 +01:00
|
|
|
button,
|
|
|
|
a.button,
|
|
|
|
a.button:visited,
|
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 23:39:01 +02:00
|
|
|
input[type="submit"] {
|
2015-05-01 18:09:35 +02:00
|
|
|
background-color: {$blue};
|
|
|
|
border: 1px solid {$blue};
|
2012-11-09 00:47:11 +01:00
|
|
|
color: white;
|
2011-01-25 20:31:40 +01:00
|
|
|
cursor: pointer;
|
|
|
|
font-weight: bold;
|
2015-06-26 18:33:03 +02:00
|
|
|
font-size: {$normalfontsize};
|
2012-11-09 00:47:11 +01:00
|
|
|
display: inline-block;
|
2015-06-29 02:59:18 +02:00
|
|
|
padding: 3px 12px 4px;
|
2011-01-25 20:31:40 +01:00
|
|
|
text-align: center;
|
|
|
|
white-space: nowrap;
|
2012-11-09 00:47:11 +01:00
|
|
|
border-radius: 3px;
|
2011-01-25 20:31:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Buttons with images (full size only) */
|
|
|
|
button.icon,
|
|
|
|
a.icon,
|
|
|
|
a.icon:visited {
|
|
|
|
padding-left: 0;
|
|
|
|
position: relative;
|
|
|
|
text-indent: 29px;
|
|
|
|
}
|
|
|
|
|
|
|
|
button.green,
|
|
|
|
a.green,
|
|
|
|
a.green:visited {
|
2015-05-01 18:09:35 +02:00
|
|
|
background-color: {$green};
|
|
|
|
border-color: {$green};
|
2011-01-25 20:31:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
button.grey,
|
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 23:39:01 +02:00
|
|
|
input[type="submit"].grey,
|
2011-01-25 20:31:40 +01:00
|
|
|
a.grey,
|
2013-04-09 00:00:55 +02:00
|
|
|
a.grey:visited {
|
2013-09-07 18:13:55 +02:00
|
|
|
background-color: {$lightgreybackground};
|
2013-09-02 17:10:47 +02:00
|
|
|
border-color: {$lightgreyborder};
|
2013-09-07 18:13:55 +02:00
|
|
|
color: {$darkgreytext};
|
2011-01-25 20:31:40 +01:00
|
|
|
}
|
|
|
|
|
2013-12-03 17:34:04 +01:00
|
|
|
button.simple,
|
|
|
|
input[type="submit"].simple,
|
|
|
|
a.simple,
|
|
|
|
a.simple:visited {
|
2015-05-17 02:29:14 +02:00
|
|
|
background: #fff;
|
|
|
|
color: {$blue};
|
|
|
|
border: 1px solid {$blue};
|
|
|
|
}
|
|
|
|
|
|
|
|
button.simple .phui-icon-view,
|
|
|
|
input[type="submit"].simple .phui-icon-view,
|
|
|
|
a.simple .phui-icon-view,
|
|
|
|
a.simple:visited .phui-icon-view {
|
|
|
|
color: {$blue};
|
2013-12-03 17:34:04 +01:00
|
|
|
}
|
|
|
|
|
2011-01-25 20:31:40 +01:00
|
|
|
a.disabled,
|
2013-04-09 00:00:55 +02:00
|
|
|
button.disabled,
|
|
|
|
button[disabled] {
|
2011-01-25 20:31:40 +01:00
|
|
|
filter:alpha(opacity=50);
|
2013-04-09 00:00:55 +02:00
|
|
|
-moz-opacity: 0.5;
|
2011-01-25 20:31:40 +01:00
|
|
|
-khtml-opacity: 0.5;
|
2013-07-17 21:12:25 +02:00
|
|
|
opacity: 0.5;
|
2013-04-09 00:00:55 +02:00
|
|
|
}
|
|
|
|
|
2014-05-05 19:57:23 +02:00
|
|
|
a.phuix-dropdown-open {
|
2013-09-02 17:10:47 +02:00
|
|
|
color: {$greytext};
|
2011-01-25 20:31:40 +01:00
|
|
|
}
|
|
|
|
|
2013-04-09 00:00:55 +02:00
|
|
|
a.button:hover,
|
|
|
|
button:hover {
|
2011-01-25 20:31:40 +01:00
|
|
|
text-decoration: none;
|
2015-05-01 18:09:35 +02:00
|
|
|
background-color: {$sky};
|
|
|
|
}
|
|
|
|
|
|
|
|
a.button.grey:hover,
|
|
|
|
button.grey:hover {
|
|
|
|
background-color: #fff;
|
|
|
|
}
|
|
|
|
|
|
|
|
a.button.green:hover,
|
|
|
|
button.green:hover {
|
|
|
|
background-color: #0DAD48;
|
2013-04-09 00:00:55 +02:00
|
|
|
}
|
|
|
|
|
2013-12-03 17:34:04 +01:00
|
|
|
a.button.simple:hover,
|
|
|
|
button.simple:hover {
|
2015-05-17 02:29:14 +02:00
|
|
|
background-color: {$blue};
|
|
|
|
color: #fff;
|
|
|
|
}
|
|
|
|
|
|
|
|
a.button.simple:hover .phui-icon-view,
|
|
|
|
button.simple:hover .phui-icon-view {
|
|
|
|
color: #fff;
|
2015-03-28 00:00:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
a.button.simple .phui-icon-view {
|
|
|
|
border: none;
|
2013-12-03 17:34:04 +01:00
|
|
|
}
|
|
|
|
|
2014-06-13 03:15:11 +02:00
|
|
|
a.button.simple.phuix-dropdown-open {
|
|
|
|
background-color: #fff;
|
2015-05-17 02:29:14 +02:00
|
|
|
color: {$blue};
|
2014-06-13 03:15:11 +02:00
|
|
|
box-shadow: none;
|
|
|
|
}
|
|
|
|
|
2015-05-17 02:29:14 +02:00
|
|
|
a.button.simple.phuix-dropdown-open:hover .phui-icon-view {
|
|
|
|
color: {$blue};
|
|
|
|
}
|
|
|
|
|
2013-04-09 00:00:55 +02:00
|
|
|
body a.button.disabled:hover,
|
|
|
|
body button.disabled:hover,
|
|
|
|
body a.button.disabled:active,
|
|
|
|
body button.disabled:active {
|
|
|
|
box-shadow: none;
|
2011-01-25 20:31:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
button.small,
|
|
|
|
a.small,
|
|
|
|
a.small:visited {
|
2014-11-21 02:05:32 +01:00
|
|
|
padding: 2px 8px;
|
2011-01-25 20:31:40 +01:00
|
|
|
height: auto;
|
2015-06-26 18:33:03 +02:00
|
|
|
font-size: {$smallestfontsize};
|
2011-01-25 20:31:40 +01:00
|
|
|
line-height: 16px;
|
|
|
|
}
|
|
|
|
|
2011-02-05 03:24:03 +01:00
|
|
|
button.link {
|
|
|
|
display: inline;
|
|
|
|
border: none;
|
|
|
|
background: transparent;
|
|
|
|
font-weight: normal;
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
font-size: inherit;
|
2011-02-19 23:36:13 +01:00
|
|
|
border-bottom: none;
|
|
|
|
text-decoration: none;
|
2013-10-23 19:16:09 +02:00
|
|
|
color: #19558D;
|
2011-02-19 23:36:13 +01:00
|
|
|
-webkit-box-shadow: none;
|
|
|
|
-moz-box-shadow: none;
|
|
|
|
box-shadow: none;
|
2011-02-05 03:24:03 +01:00
|
|
|
}
|
2011-01-25 20:31:40 +01:00
|
|
|
|
2011-02-05 03:24:03 +01:00
|
|
|
button.link:hover {
|
|
|
|
text-decoration: underline;
|
|
|
|
}
|
2011-02-11 19:28:37 +01:00
|
|
|
|
2014-05-05 19:56:14 +02:00
|
|
|
.phuix-dropdown-menu {
|
2012-01-05 01:52:13 +01:00
|
|
|
position: absolute;
|
|
|
|
width: 240px;
|
2013-05-27 18:56:45 +02:00
|
|
|
background: #fff;
|
2012-01-05 01:52:13 +01:00
|
|
|
margin-top: -1px;
|
2013-05-27 18:56:45 +02:00
|
|
|
padding: 5px 0;
|
2015-04-14 18:48:59 +02:00
|
|
|
box-shadow: {$dropshadow};
|
2013-09-13 19:48:02 +02:00
|
|
|
border: 1px solid {$lightgreyborder};
|
2014-05-29 05:56:20 +02:00
|
|
|
border-bottom: 1px solid {$greyborder};
|
|
|
|
border-radius: 3px;
|
|
|
|
margin-bottom: 16px;
|
2012-01-05 01:52:13 +01:00
|
|
|
}
|
|
|
|
|
2014-05-05 19:57:23 +02:00
|
|
|
.phuix-dropdown-menu a:focus {
|
|
|
|
/* We automatically focus links in dropdown menus for assistive devices, but
|
|
|
|
this is distracting for visual user agents. */
|
|
|
|
outline: none;
|
|
|
|
}
|
|
|
|
|
2013-10-13 02:08:11 +02:00
|
|
|
a.policy-control {
|
|
|
|
width: 240px;
|
|
|
|
text-align: left;
|
|
|
|
}
|
|
|
|
|
|
|
|
a.policy-control .caret {
|
|
|
|
float: right;
|
|
|
|
}
|
|
|
|
|
2013-05-24 16:40:51 +02:00
|
|
|
.caret {
|
|
|
|
display: inline-block;
|
|
|
|
width: 0;
|
|
|
|
height: 0;
|
|
|
|
vertical-align: top;
|
|
|
|
border-top: 5px solid #fff;
|
|
|
|
border-right: 5px solid transparent;
|
|
|
|
border-left: 5px solid transparent;
|
|
|
|
content: "";
|
|
|
|
}
|
|
|
|
|
2013-09-13 01:08:47 +02:00
|
|
|
.caret-right {
|
|
|
|
display: inline-block;
|
|
|
|
width: 0;
|
|
|
|
height: 0;
|
|
|
|
vertical-align: middle;
|
2013-09-13 19:48:02 +02:00
|
|
|
border-left: 7px solid {$greytext};
|
2013-09-13 01:08:47 +02:00
|
|
|
border-top: 5px solid transparent;
|
|
|
|
border-bottom: 5px solid transparent;
|
|
|
|
content: "";
|
|
|
|
margin-bottom: 4px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.caret-left {
|
|
|
|
display: inline-block;
|
|
|
|
width: 0;
|
|
|
|
height: 0;
|
|
|
|
vertical-align: middle;
|
|
|
|
border-right: 7px solid {$greytext};
|
|
|
|
border-bottom: 5px solid transparent;
|
|
|
|
border-top: 5px solid transparent;
|
|
|
|
content: "";
|
|
|
|
margin-bottom: 4px;
|
|
|
|
}
|
|
|
|
|
2013-05-24 16:40:51 +02:00
|
|
|
.dropdown .caret {
|
|
|
|
margin-top: 7px;
|
2015-05-01 18:09:35 +02:00
|
|
|
margin-left: 6px;
|
2013-05-24 16:40:51 +02:00
|
|
|
}
|
|
|
|
|
2013-09-13 19:48:02 +02:00
|
|
|
.small.dropdown .caret {
|
|
|
|
margin-top: 6px;
|
|
|
|
}
|
|
|
|
|
2013-05-24 16:40:51 +02:00
|
|
|
.grey.dropdown .caret {
|
|
|
|
border-top-color: #000;
|
|
|
|
}
|
2013-06-13 03:23:35 +02:00
|
|
|
|
|
|
|
/* Icons */
|
|
|
|
.button.has-icon {
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
.button .phui-icon-view {
|
|
|
|
display: inline-block;
|
|
|
|
position: absolute;
|
2015-05-01 18:09:35 +02:00
|
|
|
top: 6px;
|
2015-06-29 21:31:49 +02:00
|
|
|
left: 10px;
|
2013-06-13 03:23:35 +02:00
|
|
|
}
|
|
|
|
|
2015-06-02 23:34:04 +02:00
|
|
|
.button.icon-last .phui-icon-view {
|
|
|
|
left: auto;
|
2015-06-29 21:31:49 +02:00
|
|
|
right: 10px;
|
2015-06-02 23:34:04 +02:00
|
|
|
}
|
|
|
|
|
2014-06-04 21:53:32 +02:00
|
|
|
.phui-button-bar .button .phui-icon-view {
|
2015-06-29 23:42:29 +02:00
|
|
|
left: 9px;
|
2014-06-04 21:53:32 +02:00
|
|
|
}
|
|
|
|
|
2013-09-13 00:19:52 +02:00
|
|
|
.button.has-icon .phui-button-text {
|
2015-05-02 18:59:21 +02:00
|
|
|
margin-left: 16px;
|
2013-06-13 03:23:35 +02:00
|
|
|
}
|
|
|
|
|
2015-06-02 23:34:04 +02:00
|
|
|
.button.has-icon.icon-last .phui-button-text {
|
|
|
|
margin: 0 16px 0 0;
|
|
|
|
}
|
|
|
|
|
2013-06-13 03:23:35 +02:00
|
|
|
/* Login Buttons */
|
|
|
|
|
|
|
|
.button.big.has-icon {
|
|
|
|
padding: 6px 20px 6px 12px;
|
|
|
|
border-radius: 4px;
|
2013-06-17 01:31:57 +02:00
|
|
|
text-align: left;
|
2013-06-13 03:23:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
.button.big.has-icon .phui-button-text {
|
2014-11-21 02:05:32 +01:00
|
|
|
margin-left: 40px;
|
2015-06-26 18:33:03 +02:00
|
|
|
font-size: {$biggerfontsize};
|
2013-06-13 03:23:35 +02:00
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
.button.big.has-icon .phui-button-subtext {
|
2013-09-02 17:12:18 +02:00
|
|
|
color: {$lightgreytext};
|
2015-06-26 18:33:03 +02:00
|
|
|
font-size: {$smallerfontsize};
|
2013-06-18 07:02:16 +02:00
|
|
|
line-height: 15px;
|
2013-06-13 03:23:35 +02:00
|
|
|
font-weight: normal;
|
|
|
|
}
|
2014-02-10 20:11:36 +01:00
|
|
|
|
|
|
|
/* PHUI Button Bar */
|
|
|
|
|
2015-06-29 23:42:29 +02:00
|
|
|
.phui-button-bar-borderless .button {
|
|
|
|
border: 0;
|
|
|
|
background-color: transparent;
|
|
|
|
padding-left: 10px;
|
|
|
|
padding-right: 10px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.phui-button-bar-borderless .button .phui-icon-view {
|
|
|
|
font-size: 15px;
|
|
|
|
color: rgba(55,55,55,.4);
|
|
|
|
}
|
|
|
|
|
|
|
|
.phui-button-bar-borderless .button:hover {
|
|
|
|
background-color: transparent;
|
|
|
|
border-radius: 3px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.phui-button-bar-borderless .button:hover .phui-icon-view {
|
|
|
|
color: rgba(55,55,55,.9);
|
|
|
|
}
|
|
|
|
|
|
|
|
.phui-button-bar-borderless .button {
|
|
|
|
border: 0;
|
|
|
|
}
|
|
|
|
|
2015-03-25 20:51:54 +01:00
|
|
|
.phui-button-bar a.button.has-icon {
|
2014-02-10 20:11:36 +01:00
|
|
|
display: inline-block;
|
2015-06-29 23:42:29 +02:00
|
|
|
height: 18px;
|
2015-03-28 00:00:09 +01:00
|
|
|
width: 6px;
|
2014-02-10 20:11:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.phui-button-bar .phui-button-bar-first {
|
|
|
|
border-top-right-radius: 0px;
|
|
|
|
border-bottom-right-radius: 0px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.phui-button-bar .phui-button-bar-middle {
|
|
|
|
border-radius: 0;
|
|
|
|
border-left: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.phui-button-bar .phui-button-bar-last {
|
|
|
|
border-left: none;
|
|
|
|
border-top-left-radius: 0px;
|
|
|
|
border-bottom-left-radius: 0px;
|
|
|
|
}
|
2015-03-25 20:51:54 +01:00
|
|
|
|
|
|
|
.phui-button-bar .button.simple:hover {
|
|
|
|
border-color: {$lightblueborder};
|
2015-05-17 02:29:14 +02:00
|
|
|
background-color: #fff;
|
2015-03-25 20:51:54 +01:00
|
|
|
color: {$sky};
|
|
|
|
}
|
|
|
|
|
|
|
|
.phui-button-bar .button.simple:hover .phui-icon-view {
|
|
|
|
border-color: {$lightblueborder};
|
|
|
|
color: {$sky};
|
|
|
|
}
|