mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 21:10:56 +01:00
Consolidate Conpherence frame rendering
Summary: Conpherence frame rendering is spread out a bit across ConpherenceController, ConpherenceListController, and previously ConpherenceNewController. I want to let the Thread and Widget controllers render the frame for mobile. Ref T2421. Test Plan: Viewed conpherences, switched between conpherences. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2421 Differential Revision: https://secure.phabricator.com/D5501
This commit is contained in:
parent
7b07f6ab3d
commit
7ef2edd300
5 changed files with 96 additions and 81 deletions
|
@ -231,6 +231,7 @@ phutil_register_library_map(array(
|
||||||
'ConpherenceFileWidgetView' => 'applications/conpherence/view/ConpherenceFileWidgetView.php',
|
'ConpherenceFileWidgetView' => 'applications/conpherence/view/ConpherenceFileWidgetView.php',
|
||||||
'ConpherenceFormDragAndDropUploadControl' => 'applications/conpherence/view/ConpherenceFormDragAndDropUploadControl.php',
|
'ConpherenceFormDragAndDropUploadControl' => 'applications/conpherence/view/ConpherenceFormDragAndDropUploadControl.php',
|
||||||
'ConpherenceImageData' => 'applications/conpherence/constants/ConpherenceImageData.php',
|
'ConpherenceImageData' => 'applications/conpherence/constants/ConpherenceImageData.php',
|
||||||
|
'ConpherenceLayoutView' => 'applications/conpherence/view/ConpherenceLayoutView.php',
|
||||||
'ConpherenceListController' => 'applications/conpherence/controller/ConpherenceListController.php',
|
'ConpherenceListController' => 'applications/conpherence/controller/ConpherenceListController.php',
|
||||||
'ConpherenceMenuItemView' => 'applications/conpherence/view/ConpherenceMenuItemView.php',
|
'ConpherenceMenuItemView' => 'applications/conpherence/view/ConpherenceMenuItemView.php',
|
||||||
'ConpherenceNewController' => 'applications/conpherence/controller/ConpherenceNewController.php',
|
'ConpherenceNewController' => 'applications/conpherence/controller/ConpherenceNewController.php',
|
||||||
|
@ -1940,6 +1941,7 @@ phutil_register_library_map(array(
|
||||||
'ConpherenceFileWidgetView' => 'AphrontView',
|
'ConpherenceFileWidgetView' => 'AphrontView',
|
||||||
'ConpherenceFormDragAndDropUploadControl' => 'AphrontFormControl',
|
'ConpherenceFormDragAndDropUploadControl' => 'AphrontFormControl',
|
||||||
'ConpherenceImageData' => 'ConpherenceConstants',
|
'ConpherenceImageData' => 'ConpherenceConstants',
|
||||||
|
'ConpherenceLayoutView' => 'AphrontView',
|
||||||
'ConpherenceListController' => 'ConpherenceController',
|
'ConpherenceListController' => 'ConpherenceController',
|
||||||
'ConpherenceMenuItemView' => 'AphrontTagView',
|
'ConpherenceMenuItemView' => 'AphrontTagView',
|
||||||
'ConpherenceNewController' => 'ConpherenceController',
|
'ConpherenceNewController' => 'ConpherenceController',
|
||||||
|
|
|
@ -314,32 +314,4 @@ abstract class ConpherenceController extends PhabricatorController {
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function initJavelinBehaviors($more_than_menu = false) {
|
|
||||||
|
|
||||||
Javelin::initBehavior('conpherence-menu',
|
|
||||||
array(
|
|
||||||
'base_uri' => $this->getApplicationURI(''),
|
|
||||||
'header' => 'conpherence-header-pane',
|
|
||||||
'messages' => 'conpherence-messages',
|
|
||||||
'messages_pane' => 'conpherence-message-pane',
|
|
||||||
'widgets_pane' => 'conpherence-widget-pane',
|
|
||||||
'form_pane' => 'conpherence-form',
|
|
||||||
'menu_pane' => 'conpherence-menu',
|
|
||||||
'selected_conpherence_id' => $this->getSelectedConpherencePHID(),
|
|
||||||
'fancy_ajax' => (bool) $this->getSelectedConpherencePHID()
|
|
||||||
));
|
|
||||||
|
|
||||||
if ($more_than_menu) {
|
|
||||||
Javelin::initBehavior('conpherence-drag-and-drop-photo',
|
|
||||||
array(
|
|
||||||
'target' => 'conpherence-header-pane',
|
|
||||||
'form_pane' => 'conpherence-form',
|
|
||||||
'upload_uri' => '/file/dropupload/',
|
|
||||||
'activated_class' => 'conpherence-header-upload-photo',
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
Javelin::initBehavior('conpherence-pontificate');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,10 @@ final class ConpherenceListController extends
|
||||||
$this->loadStartingConpherences($current_selection_epoch);
|
$this->loadStartingConpherences($current_selection_epoch);
|
||||||
$nav = $this->buildSideNavView();
|
$nav = $this->buildSideNavView();
|
||||||
|
|
||||||
$main_pane = $this->renderEmptyMainPane();
|
$main_pane = id(new ConpherenceLayoutView())
|
||||||
|
->setBaseURI($this->getApplicationURI())
|
||||||
|
->setSelectedConpherencePHID($this->getSelectedConpherencePHID());
|
||||||
|
|
||||||
$nav->appendChild(
|
$nav->appendChild(
|
||||||
array(
|
array(
|
||||||
$main_pane,
|
$main_pane,
|
||||||
|
@ -62,54 +65,4 @@ final class ConpherenceListController extends
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
private function renderEmptyMainPane() {
|
|
||||||
$this->initJavelinBehaviors(true);
|
|
||||||
return javelin_tag(
|
|
||||||
'div',
|
|
||||||
array(
|
|
||||||
'id' => 'conpherence-main-pane',
|
|
||||||
'sigil' => 'conpherence-layout'
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
javelin_tag(
|
|
||||||
'div',
|
|
||||||
array(
|
|
||||||
'class' => 'conpherence-header-pane',
|
|
||||||
'id' => 'conpherence-header-pane',
|
|
||||||
'sigil' => 'conpherence-header',
|
|
||||||
),
|
|
||||||
''),
|
|
||||||
phutil_tag(
|
|
||||||
'div',
|
|
||||||
array(
|
|
||||||
'class' => 'conpherence-widget-pane',
|
|
||||||
'id' => 'conpherence-widget-pane'
|
|
||||||
),
|
|
||||||
''),
|
|
||||||
javelin_tag(
|
|
||||||
'div',
|
|
||||||
array(
|
|
||||||
'class' => 'conpherence-message-pane',
|
|
||||||
'id' => 'conpherence-message-pane'
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
javelin_tag(
|
|
||||||
'div',
|
|
||||||
array(
|
|
||||||
'class' => 'conpherence-messages',
|
|
||||||
'id' => 'conpherence-messages',
|
|
||||||
'sigil' => 'conpherence-messages',
|
|
||||||
),
|
|
||||||
''),
|
|
||||||
phutil_tag(
|
|
||||||
'div',
|
|
||||||
array(
|
|
||||||
'id' => 'conpherence-form'
|
|
||||||
),
|
|
||||||
'')
|
|
||||||
))
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,11 +75,11 @@ final class ConpherenceViewController extends
|
||||||
$transactions = $data['transactions'];
|
$transactions = $data['transactions'];
|
||||||
|
|
||||||
$update_uri = $this->getApplicationURI('update/'.$conpherence->getID().'/');
|
$update_uri = $this->getApplicationURI('update/'.$conpherence->getID().'/');
|
||||||
$form_id = celerity_generate_unique_node_id();
|
|
||||||
|
Javelin::initBehavior('conpherence-pontificate');
|
||||||
|
|
||||||
$form =
|
$form =
|
||||||
id(new AphrontFormView())
|
id(new AphrontFormView())
|
||||||
->setID($form_id)
|
|
||||||
->setAction($update_uri)
|
->setAction($update_uri)
|
||||||
->setFlexible(true)
|
->setFlexible(true)
|
||||||
->addSigil('conpherence-pontificate')
|
->addSigil('conpherence-pontificate')
|
||||||
|
|
88
src/applications/conpherence/view/ConpherenceLayoutView.php
Normal file
88
src/applications/conpherence/view/ConpherenceLayoutView.php
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ConpherenceLayoutView extends AphrontView {
|
||||||
|
|
||||||
|
private $selectedConpherencePHID;
|
||||||
|
private $baseURI;
|
||||||
|
|
||||||
|
public function setBaseURI($base_uri) {
|
||||||
|
$this->baseURI = $base_uri;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setSelectedConpherencePHID($selected_conpherence_phid) {
|
||||||
|
$this->selectedConpherencePHID = $selected_conpherence_phid;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render() {
|
||||||
|
|
||||||
|
Javelin::initBehavior('conpherence-menu',
|
||||||
|
array(
|
||||||
|
'base_uri' => $this->baseURI,
|
||||||
|
'header' => 'conpherence-header-pane',
|
||||||
|
'messages' => 'conpherence-messages',
|
||||||
|
'messages_pane' => 'conpherence-message-pane',
|
||||||
|
'widgets_pane' => 'conpherence-widget-pane',
|
||||||
|
'form_pane' => 'conpherence-form',
|
||||||
|
'menu_pane' => 'conpherence-menu',
|
||||||
|
'selected_conpherence_id' => $this->selectedConpherencePHID,
|
||||||
|
'fancy_ajax' => (bool)$this->selectedConpherencePHID,
|
||||||
|
));
|
||||||
|
|
||||||
|
Javelin::initBehavior('conpherence-drag-and-drop-photo',
|
||||||
|
array(
|
||||||
|
'target' => 'conpherence-header-pane',
|
||||||
|
'form_pane' => 'conpherence-form',
|
||||||
|
'upload_uri' => '/file/dropupload/',
|
||||||
|
'activated_class' => 'conpherence-header-upload-photo',
|
||||||
|
));
|
||||||
|
|
||||||
|
return javelin_tag(
|
||||||
|
'div',
|
||||||
|
array(
|
||||||
|
'id' => 'conpherence-main-pane',
|
||||||
|
'sigil' => 'conpherence-layout'
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
javelin_tag(
|
||||||
|
'div',
|
||||||
|
array(
|
||||||
|
'class' => 'conpherence-header-pane',
|
||||||
|
'id' => 'conpherence-header-pane',
|
||||||
|
'sigil' => 'conpherence-header',
|
||||||
|
),
|
||||||
|
''),
|
||||||
|
phutil_tag(
|
||||||
|
'div',
|
||||||
|
array(
|
||||||
|
'class' => 'conpherence-widget-pane',
|
||||||
|
'id' => 'conpherence-widget-pane'
|
||||||
|
),
|
||||||
|
''),
|
||||||
|
javelin_tag(
|
||||||
|
'div',
|
||||||
|
array(
|
||||||
|
'class' => 'conpherence-message-pane',
|
||||||
|
'id' => 'conpherence-message-pane'
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
javelin_tag(
|
||||||
|
'div',
|
||||||
|
array(
|
||||||
|
'class' => 'conpherence-messages',
|
||||||
|
'id' => 'conpherence-messages',
|
||||||
|
'sigil' => 'conpherence-messages',
|
||||||
|
),
|
||||||
|
''),
|
||||||
|
phutil_tag(
|
||||||
|
'div',
|
||||||
|
array(
|
||||||
|
'id' => 'conpherence-form'
|
||||||
|
),
|
||||||
|
'')
|
||||||
|
))
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue