Conpherence - add crop

Summary:
mainly, this adds the image cropper - yay!

 - also removes the file image from the handle stuff I added in V1. now we do all this crazy photo stuff.

Test Plan:
 - uploaded a photo by dragging to header and noted 120 x 80 showed up on reload
 - uploaded a photo by dragging to edit dialogue spot and noted 120 x 80 showed up on reload
 - cropped a photo - noted it cropped right
 - cropped a photo again and again and again - seems like it crops okay

Reviewers: epriestley, chad

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2418, T2399

Differential Revision: https://secure.phabricator.com/D4790
This commit is contained in:
Bob Trahan
2013-02-06 14:03:52 -08:00
parent fb7d5d17a2
commit 1cde41b994
22 changed files with 803 additions and 149 deletions

View File

@@ -45,6 +45,7 @@ final class ConpherenceViewController extends
->setViewer($user)
->withIDs(array($conpherence_id))
->needWidgetData(true)
->needHeaderPics(true)
->executeOne();
$this->setConpherence($conpherence);
@@ -67,23 +68,34 @@ final class ConpherenceViewController extends
require_celerity_resource('conpherence-header-pane-css');
$user = $this->getRequest()->getUser();
$conpherence = $this->getConpherence();
$display_data = $conpherence->getDisplayData($user);
$display_data = $conpherence->getDisplayData(
$user,
ConpherenceImageData::SIZE_HEAD
);
$edit_href = $this->getApplicationURI('update/'.$conpherence->getID().'/');
$class_mod = $display_data['image_class'];
$header =
phutil_tag(
'div',
array(
'class' => 'upload-photo'
),
pht('Drop photo here to change this Conpherence photo.')
).
javelin_tag(
'a',
array(
'class' => 'edit',
'href' => $edit_href,
'sigil' => 'workflow',
'sigil' => 'workflow edit-action',
),
''
).
phutil_tag(
'div',
array(
'class' => 'header-image',
'class' => $class_mod.'header-image',
'style' => 'background-image: url('.$display_data['image'].');'
),
''
@@ -91,14 +103,14 @@ final class ConpherenceViewController extends
phutil_tag(
'div',
array(
'class' => 'title',
'class' => $class_mod.'title',
),
$display_data['title']
).
phutil_tag(
'div',
array(
'class' => 'subtitle',
'class' => $class_mod.'subtitle',
),
$display_data['subtitle']
);