1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-05 19:38:27 +01:00

Pholio tile to home page and mock to show first image

Summary:
Pholio tile to show up on home page

First image is shown at mock page.

Test Plan: Pholio app shows up on home page. First image is shown at mock page.

Reviewers: epriestley

CC: aran, Korvin

Maniphest Tasks: T2356

Differential Revision: https://secure.phabricator.com/D4553
This commit is contained in:
Lauri-Henrik Jalonen 2013-01-20 09:29:34 -08:00 committed by epriestley
parent 5f766c231d
commit 72a92d438f
5 changed files with 69 additions and 3 deletions

View file

@ -3055,6 +3055,15 @@ celerity_register_resource_map(array(
), ),
'disk' => '/rsrc/css/application/phame/phame.css', 'disk' => '/rsrc/css/application/phame/phame.css',
), ),
'pholio-css' =>
array(
'uri' => '/res/e454c33f/rsrc/css/application/pholio/pholio.css',
'type' => 'css',
'requires' =>
array(
),
'disk' => '/rsrc/css/application/pholio/pholio.css',
),
'phriction-document-css' => 'phriction-document-css' =>
array( array(
'uri' => '/res/8d09bd7f/rsrc/css/application/phriction/phriction-document-css.css', 'uri' => '/res/8d09bd7f/rsrc/css/application/phriction/phriction-document-css.css',

View file

@ -1363,6 +1363,7 @@ phutil_register_library_map(array(
'PholioMockCommentController' => 'applications/pholio/controller/PholioMockCommentController.php', 'PholioMockCommentController' => 'applications/pholio/controller/PholioMockCommentController.php',
'PholioMockEditController' => 'applications/pholio/controller/PholioMockEditController.php', 'PholioMockEditController' => 'applications/pholio/controller/PholioMockEditController.php',
'PholioMockEditor' => 'applications/pholio/editor/PholioMockEditor.php', 'PholioMockEditor' => 'applications/pholio/editor/PholioMockEditor.php',
'PholioMockImagesView' => 'applications/pholio/view/PholioMockImagesView.php',
'PholioMockListController' => 'applications/pholio/controller/PholioMockListController.php', 'PholioMockListController' => 'applications/pholio/controller/PholioMockListController.php',
'PholioMockQuery' => 'applications/pholio/query/PholioMockQuery.php', 'PholioMockQuery' => 'applications/pholio/query/PholioMockQuery.php',
'PholioMockViewController' => 'applications/pholio/controller/PholioMockViewController.php', 'PholioMockViewController' => 'applications/pholio/controller/PholioMockViewController.php',
@ -2731,6 +2732,7 @@ phutil_register_library_map(array(
'PholioMockCommentController' => 'PholioController', 'PholioMockCommentController' => 'PholioController',
'PholioMockEditController' => 'PholioController', 'PholioMockEditController' => 'PholioController',
'PholioMockEditor' => 'PhabricatorApplicationTransactionEditor', 'PholioMockEditor' => 'PhabricatorApplicationTransactionEditor',
'PholioMockImagesView' => 'AphrontView',
'PholioMockListController' => 'PholioController', 'PholioMockListController' => 'PholioController',
'PholioMockQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PholioMockQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PholioMockViewController' => 'PholioController', 'PholioMockViewController' => 'PholioController',

View file

@ -60,9 +60,12 @@ final class PholioMockViewController extends PholioController {
$actions = $this->buildActionView($mock); $actions = $this->buildActionView($mock);
$properties = $this->buildPropertyView($mock, $engine, $subscribers); $properties = $this->buildPropertyView($mock, $engine, $subscribers);
$carousel = require_celerity_resource('pholio-css');
'<h1 style="margin: 2em; padding: 1em; border: 1px dashed grey;">'.
'Carousel Goes Here</h1>'; $output = new PholioMockImagesView();
$output->setMock($mock);
$carousel = $output->render();
$xaction_view = id(new PhabricatorApplicationTransactionView()) $xaction_view = id(new PhabricatorApplicationTransactionView())
->setUser($this->getRequest()->getUser()) ->setUser($this->getRequest()->getUser())

View file

@ -0,0 +1,40 @@
<?php
final class PholioMockImagesView extends AphrontView {
private $mock;
public function setMock(PholioMock $mock) {
$this->mock = $mock;
}
public function render() {
if (!$this->mock) {
throw new Exception("Call setMock() before render()!");
}
$image = id(new PholioImage())->loadOneWhere(
"mockid=%d",
$this->mock->getID());
$file = id(new PhabricatorFile())->loadOneWhere(
"phid=%s",
$image->getFilePHID());
$image_tag = phutil_render_tag(
'img',
array(
'src' => $file->getBestURI(),
'class' => 'pholio-mock-image',
),
'');
return phutil_render_tag(
'div',
array(
'class' => 'pholio-mock-image-container',
),
$image_tag);
}
}

View file

@ -0,0 +1,12 @@
/**
* @provides pholio-css
*/
.pholio-mock-image-container {
background-color: #282828;
text-align: center;
}
.pholio-mock-image {
margin: 10px 0px;
display: inline-block;
}