1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 10:42:41 +01:00

Add a 7th column to AphrontMultiColumnView

Summary: Adds a 7th column, useful for fluid calendars.

Test Plan: UIExamples

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2898

Differential Revision: https://secure.phabricator.com/D5597
This commit is contained in:
Chad Little 2013-04-06 07:23:59 -07:00
parent 482963bca3
commit a138641795
4 changed files with 38 additions and 5 deletions

View file

@ -804,7 +804,7 @@ celerity_register_resource_map(array(
), ),
'aphront-multi-column-view-css' => 'aphront-multi-column-view-css' =>
array( array(
'uri' => '/res/ee1159c3/rsrc/css/aphront/multi-column.css', 'uri' => '/res/4e5ae0f3/rsrc/css/aphront/multi-column.css',
'type' => 'css', 'type' => 'css',
'requires' => 'requires' =>
array( array(

View file

@ -7,7 +7,7 @@ final class PhabricatorMultiColumnExample extends PhabricatorUIExample {
} }
public function getDescription() { public function getDescription() {
return 'A container good for 1-6 equally spaced columns. '. return 'A container good for 1-7 equally spaced columns. '.
'Fixed and Fluid layouts.'; 'Fixed and Fluid layouts.';
} }
@ -63,6 +63,18 @@ final class PhabricatorMultiColumnExample extends PhabricatorUIExample {
->setFluidLayout(true) ->setFluidLayout(true)
->setGutter(AphrontMultiColumnView::GUTTER_SMALL); ->setGutter(AphrontMultiColumnView::GUTTER_SMALL);
$head5 = id(new PhabricatorHeaderView())
->setHeader(pht('7 Column Fluid'));
$layout5 = id(new AphrontMultiColumnView())
->addColumn('Sunday')
->addColumn('Monday')
->addColumn('Tuesday')
->addColumn('Wednesday')
->addColumn('Thursday')
->addColumn('Friday')
->addColumn('Saturday')
->setFluidLayout(true);
$wrap1 = phutil_tag( $wrap1 = phutil_tag(
'div', 'div',
array( array(
@ -91,6 +103,13 @@ final class PhabricatorMultiColumnExample extends PhabricatorUIExample {
), ),
$layout4); $layout4);
$wrap5 = phutil_tag(
'div',
array(
'class' => 'ml'
),
$layout5);
return phutil_tag( return phutil_tag(
'div', 'div',
array(), array(),
@ -102,7 +121,9 @@ final class PhabricatorMultiColumnExample extends PhabricatorUIExample {
$head3, $head3,
$wrap3, $wrap3,
$head4, $head4,
$wrap4 $wrap4,
$head5,
$wrap5
)); ));
} }
} }

View file

@ -32,8 +32,8 @@ final class AphrontMultiColumnView extends AphrontView {
$classes[] = 'aphront-multi-column-inner'; $classes[] = 'aphront-multi-column-inner';
$classes[] = 'grouped'; $classes[] = 'grouped';
if (count($this->columns) > 6) { if (count($this->columns) > 7) {
throw new Exception("No more than 6 columns per view."); throw new Exception("No more than 7 columns per view.");
} }
$classes[] = 'aphront-multi-column-'.count($this->columns).'-up'; $classes[] = 'aphront-multi-column-'.count($this->columns).'-up';

View file

@ -58,6 +58,11 @@
width: 1500px; width: 1500px;
} }
.aphront-multi-column-fixed
.aphront-multi-column-inner.aphront-multi-column-7-up {
width: 1750px;
}
.device-phone .aphront-multi-column-fixed .aphront-multi-column-inner { .device-phone .aphront-multi-column-fixed .aphront-multi-column-inner {
width: 100%; width: 100%;
} }
@ -77,6 +82,8 @@
.aphront-multi-column-fixed .aphront-multi-column-5-up .aphront-multi-column-fixed .aphront-multi-column-5-up
.aphront-multi-column-column-outer, .aphront-multi-column-column-outer,
.aphront-multi-column-fixed .aphront-multi-column-6-up .aphront-multi-column-fixed .aphront-multi-column-6-up
.aphront-multi-column-column-outer,
.aphront-multi-column-fixed .aphront-multi-column-7-up
.aphront-multi-column-column-outer { .aphront-multi-column-column-outer {
width: 240px; width: 240px;
} }
@ -111,3 +118,8 @@
.aphront-multi-column-column-outer { .aphront-multi-column-column-outer {
width: 16.6666%; width: 16.6666%;
} }
.aphront-multi-column-fluid .aphront-multi-column-7-up
.aphront-multi-column-column-outer {
width: 14.2857%;
}