Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/phid/PhabricatorObjectHandle.php b/src/applications/phid/PhabricatorObjectHandle.php
index be6b1c09e5..62fe85d9db 100644
--- a/src/applications/phid/PhabricatorObjectHandle.php
+++ b/src/applications/phid/PhabricatorObjectHandle.php
@@ -1,299 +1,311 @@
<?php
final class PhabricatorObjectHandle
implements PhabricatorPolicyInterface {
private $uri;
private $phid;
private $type;
private $name;
private $fullName;
private $title;
private $imageURI;
private $icon;
private $timestamp;
private $status = PhabricatorObjectHandleStatus::STATUS_OPEN;
private $complete;
private $disabled;
private $objectName;
private $policyFiltered;
public function setIcon($icon) {
$this->icon = $icon;
return $this;
}
public function getIcon() {
if ($this->icon) {
return $this->icon;
}
return $this->getTypeIcon();
}
+ public function getIconColor() {
+ return 'bluegrey';
+ }
+
public function getTypeIcon() {
if ($this->getPHIDType()) {
return $this->getPHIDType()->getTypeIcon();
}
return null;
}
public function setPolicyFiltered($policy_filered) {
$this->policyFiltered = $policy_filered;
return $this;
}
public function getPolicyFiltered() {
return $this->policyFiltered;
}
public function setObjectName($object_name) {
$this->objectName = $object_name;
return $this;
}
public function getObjectName() {
if (!$this->objectName) {
return $this->getName();
}
return $this->objectName;
}
public function setURI($uri) {
$this->uri = $uri;
return $this;
}
public function getURI() {
return $this->uri;
}
public function setPHID($phid) {
$this->phid = $phid;
return $this;
}
public function getPHID() {
return $this->phid;
}
public function setName($name) {
$this->name = $name;
return $this;
}
public function getName() {
if ($this->name === null) {
if ($this->getPolicyFiltered()) {
return pht('Restricted %s', $this->getTypeName());
} else {
return pht('Unknown Object (%s)', $this->getTypeName());
}
}
return $this->name;
}
public function setStatus($status) {
$this->status = $status;
return $this;
}
public function getStatus() {
return $this->status;
}
public function setFullName($full_name) {
$this->fullName = $full_name;
return $this;
}
public function getFullName() {
if ($this->fullName !== null) {
return $this->fullName;
}
return $this->getName();
}
public function setTitle($title) {
$this->title = $title;
return $this;
}
public function getTitle() {
return $this->title;
}
public function setType($type) {
$this->type = $type;
return $this;
}
public function getType() {
return $this->type;
}
public function setImageURI($uri) {
$this->imageURI = $uri;
return $this;
}
public function getImageURI() {
return $this->imageURI;
}
public function setTimestamp($timestamp) {
$this->timestamp = $timestamp;
return $this;
}
public function getTimestamp() {
return $this->timestamp;
}
public function getTypeName() {
if ($this->getPHIDType()) {
return $this->getPHIDType()->getTypeName();
}
return $this->getType();
}
/**
* Set whether or not the underlying object is complete. See
* @{method:isComplete} for an explanation of what it means to be complete.
*
* @param bool True if the handle represents a complete object.
* @return this
*/
public function setComplete($complete) {
$this->complete = $complete;
return $this;
}
/**
* Determine if the handle represents an object which was completely loaded
* (i.e., the underlying object exists) vs an object which could not be
* completely loaded (e.g., the type or data for the PHID could not be
* identified or located).
*
* Basically, @{class:PhabricatorHandleQuery} gives you back a handle for
* any PHID you give it, but it gives you a complete handle only for valid
* PHIDs.
*
* @return bool True if the handle represents a complete object.
*/
public function isComplete() {
return $this->complete;
}
/**
* Set whether or not the underlying object is disabled. See
* @{method:isDisabled} for an explanation of what it means to be disabled.
*
* @param bool True if the handle represents a disabled object.
* @return this
*/
public function setDisabled($disabled) {
$this->disabled = $disabled;
return $this;
}
/**
* Determine if the handle represents an object which has been disabled --
* for example, disabled users, archived projects, etc. These objects are
* complete and exist, but should be excluded from some system interactions
* (for instance, they usually should not appear in typeaheads, and should
* not have mail/notifications delivered to or about them).
*
* @return bool True if the handle represents a disabled object.
*/
public function isDisabled() {
return $this->disabled;
}
public function renderLink($name = null) {
if ($name === null) {
$name = $this->getLinkName();
}
$classes = array();
$classes[] = 'phui-handle';
$title = $this->title;
if ($this->status != PhabricatorObjectHandleStatus::STATUS_OPEN) {
$classes[] = 'handle-status-'.$this->status;
$title = $title ? $title : $this->status;
}
if ($this->disabled) {
$classes[] = 'handle-disabled';
$title = pht('Disabled'); // Overwrite status.
}
if ($this->getType() == PhabricatorPeoplePHIDTypeUser::TYPECONST) {
$classes[] = 'phui-link-person';
}
$uri = $this->getURI();
$icon = null;
if ($this->getPolicyFiltered()) {
$icon = id(new PHUIIconView())
->setIconFont('fa-lock lightgreytext');
}
return phutil_tag(
$uri ? 'a' : 'span',
array(
'href' => $uri,
'class' => implode(' ', $classes),
'title' => $title,
),
array($icon, $name));
}
+ public function renderTag() {
+ return id(new PHUITagView())
+ ->setType(PHUITagView::TYPE_OBJECT)
+ ->setIcon($this->getIcon().' '.$this->getIconColor())
+ ->setHref($this->getURI())
+ ->setName($this->getLinkName());
+ }
+
public function getLinkName() {
switch ($this->getType()) {
case PhabricatorPeoplePHIDTypeUser::TYPECONST:
$name = $this->getName();
break;
default:
$name = $this->getFullName();
break;
}
return $name;
}
protected function getPHIDType() {
$types = PhabricatorPHIDType::getAllTypes();
return idx($types, $this->getType());
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */
public function getCapabilities() {
return array(
PhabricatorPolicyCapability::CAN_VIEW,
);
}
public function getPolicy($capability) {
return PhabricatorPolicies::POLICY_PUBLIC;
}
public function hasAutomaticCapability($capability, PhabricatorUser $viewer) {
// NOTE: Handles are always visible, they just don't get populated with
// data if the user can't see the underlying object.
return true;
}
public function describeAutomaticCapability($capability) {
return null;
}
}
diff --git a/src/applications/project/events/PhabricatorProjectUIEventListener.php b/src/applications/project/events/PhabricatorProjectUIEventListener.php
index 0cd80875c1..7bf62b91f8 100644
--- a/src/applications/project/events/PhabricatorProjectUIEventListener.php
+++ b/src/applications/project/events/PhabricatorProjectUIEventListener.php
@@ -1,59 +1,69 @@
<?php
final class PhabricatorProjectUIEventListener
extends PhabricatorEventListener {
public function register() {
$this->listen(PhabricatorEventType::TYPE_UI_WILLRENDERPROPERTIES);
}
public function handleEvent(PhutilEvent $event) {
switch ($event->getType()) {
case PhabricatorEventType::TYPE_UI_WILLRENDERPROPERTIES:
$this->handlePropertyEvent($event);
break;
}
}
private function handlePropertyEvent($event) {
$user = $event->getUser();
$object = $event->getValue('object');
if (!$object || !$object->getPHID()) {
// No object, or the object has no PHID yet..
return;
}
if (!($object instanceof PhabricatorProjectInterface)) {
// This object doesn't have projects.
return;
}
$project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(
$object->getPHID(),
PhabricatorEdgeConfig::TYPE_OBJECT_HAS_PROJECT);
if ($project_phids) {
$project_phids = array_reverse($project_phids);
$handles = id(new PhabricatorHandleQuery())
->setViewer($user)
->withPHIDs($project_phids)
->execute();
} else {
$handles = array();
}
if ($handles) {
$list = array();
foreach ($handles as $handle) {
- $list[] = $handle->renderLink();
+ $list[] = phutil_tag(
+ 'li',
+ array(
+ 'class' => 'phabricator-handle-tag-list-item',
+ ),
+ $handle->renderTag());
}
- $list = phutil_implode_html(phutil_tag('br'), $list);
+ $list = phutil_tag(
+ 'ul',
+ array(
+ 'class' => 'phabricator-handle-tag-list',
+ ),
+ $list);
} else {
$list = phutil_tag('em', array(), pht('None'));
}
$view = $event->getValue('view');
$view->addProperty(pht('Projects'), $list);
}
}
diff --git a/webroot/rsrc/css/phui/phui-tag-view.css b/webroot/rsrc/css/phui/phui-tag-view.css
index fb3aabf270..bdee25210d 100644
--- a/webroot/rsrc/css/phui/phui-tag-view.css
+++ b/webroot/rsrc/css/phui/phui-tag-view.css
@@ -1,302 +1,306 @@
/**
* @provides phui-tag-view-css
*/
.phui-tag-view {
font-weight: bold;
text-decoration: none;
position: relative;
-webkit-font-smoothing: antialiased;
}
a.phui-tag-view:hover {
text-decoration: none;
}
.phui-tag-core-closed {
text-decoration: line-through;
color: rgba(0,0,0,0.5);
}
.phui-tag-core-closed:hover {
text-decoration: none;
}
.phui-tag-core {
color: inherit;
border: 1px solid transparent;
border-radius: 3px;
padding: 0 4px;
}
.phui-tag-type-state .phui-tag-core {
padding: 1px 6px;
}
.phui-tag-view .phui-icon-view {
position: absolute;
display: inline-block;
top: 1px;
left: 5px;
}
.phui-tag-icon-view .phui-tag-core {
padding-left: 22px;
}
.phui-tag-dot {
position: relative;
display: inline-block;
width: 6px;
height: 6px;
margin-right: 4px;
top: -1px;
border-radius: 6px;
border: 1px solid transparent;
}
.phui-tag-type-state {
color: #ffffff;
text-shadow: rgba(100, 100, 100, 0.40) 0px -1px 1px;
}
.phui-tag-type-object,
a.phui-tag-type-object,
a.phui-tag-type-object:link,
.phui-tag-core-closed .phui-tag-color-object {
color: #000;
}
.phui-tag-type-person {
white-space: nowrap;
color: #19558d;
}
.phui-tag-color-red {
background-color: {$red};
border-color: {$red};
}
.phui-tag-color-orange {
background-color: {$orange};
border-color: {$orange};
}
.phui-tag-color-yellow {
background-color: {$yellow};
border-color: {$yellow};
}
.phui-tag-color-blue {
background-color: {$blue};
border-color: {$blue};
}
.phui-tag-color-indigo {
background-color: {$indigo};
border-color: {$indigo};
}
.phui-tag-color-green {
background-color: {$green};
border-color: {$green};
}
.phui-tag-color-violet {
background-color: {$violet};
border-color: {$violet};
}
.phui-tag-color-black {
background-color: #333333;
border-color: #333333;
}
.phui-tag-color-grey {
background-color: {$lightgreytext};
border-color: {$lightgreytext};
}
.phui-tag-color-white {
background-color: #f7f7f7;
border-color: #f7f7f7;
}
.phui-tag-color-object {
background-color: #e7e7e7;
border-color: #e7e7e7;
}
.phui-tag-color-person {
background-color: #f1f7ff;
border-color: #f1f7ff;
}
a.phui-tag-view:hover
.phui-tag-core.phui-tag-color-person {
border-color: #d9ebfd;
}
a.phui-tag-view:hover
.phui-tag-core.phui-tag-color-object {
border-color: #d7d7d7;
}
/* - Shaded Tags ---------------------------------------------------------------
For object representation inside text areas and lists.
*/
.phui-tag-shade {
font-weight: normal;
}
.phui-tag-shade .phui-icon-view {
font-size: 12px;
top: 2px;
left: 6px;
}
.phui-tag-shade-red .phui-tag-core {
background-color: {$sh-redbackground};
border-color: {$sh-lightredborder};
color: {$sh-redtext};
}
.phui-tag-shade-red .phui-icon-view {
color: {$sh-redicon};
}
a.phui-tag-view:hover.phui-tag-shade-red .phui-tag-core {
border-color: {$sh-redborder};
}
.phui-tag-shade-orange .phui-tag-core {
background-color: {$sh-orangebackground};
border-color: {$sh-lightorangeborder};
color: {$sh-orangetext};
}
.phui-tag-shade-orange .phui-icon-view {
color: {$sh-orangeicon};
}
a.phui-tag-view:hover.phui-tag-shade-orange .phui-tag-core {
border-color: {$sh-orangeborder};
}
.phui-tag-shade-yellow .phui-tag-core {
background-color: {$sh-yellowbackground};
border-color: {$sh-lightyellowborder};
color: {$sh-yellowtext};
}
.phui-tag-shade-yellow .phui-icon-view {
color: {$sh-yellowicon};
}
a.phui-tag-view:hover.phui-tag-shade-yellow .phui-tag-core {
border-color: {$sh-yellowborder};
}
.phui-tag-shade-blue .phui-tag-core {
background-color: {$sh-bluebackground};
border-color: {$sh-lightblueborder};
color: {$sh-bluetext};
}
.phui-tag-shade-blue .phui-icon-view {
color: {$sh-blueicon};
}
a.phui-tag-view:hover.phui-tag-shade-blue .phui-tag-core {
border-color: {$sh-blueborder};
}
.phui-tag-shade-indigo .phui-tag-core {
background-color: {$sh-indigobackground};
border-color: {$sh-lightindigoborder};
color: {$sh-indigotext};
}
.phui-tag-shade-indigo .phui-icon-view {
color: {$sh-indigoicon};
}
a.phui-tag-view:hover.phui-tag-shade-indigo .phui-tag-core {
border-color: {$sh-indigoborder};
}
.phui-tag-shade-green .phui-tag-core {
background-color: {$sh-greenbackground};
border-color: {$sh-lightgreenborder};
color: {$sh-greentext};
}
.phui-tag-shade-green .phui-icon-view {
color: {$sh-greenicon};
}
a.phui-tag-view:hover.phui-tag-shade-green .phui-tag-core {
border-color: {$sh-greenborder};
}
.phui-tag-shade-violet .phui-tag-core {
background-color: {$sh-violetbackground};
border-color: {$sh-lightvioletborder};
color: {$sh-violettext};
}
.phui-tag-shade-violet .phui-icon-view {
color: {$sh-violeticon};
}
a.phui-tag-view:hover.phui-tag-shade-violet .phui-tag-core {
border-color: {$sh-violetborder};
}
.phui-tag-shade-grey .phui-tag-core {
background-color: {$sh-greybackground};
border-color: {$sh-lightgreyborder};
color: {$sh-greytext};
}
.phui-tag-shade-grey .phui-icon-view {
color: {$sh-greyicon};
}
a.phui-tag-view:hover.phui-tag-shade-grey .phui-tag-core {
border-color: {$sh-greyborder};
}
.phui-tag-shade-checkered .phui-tag-core {
background: url(/rsrc/image/checker_lighter.png);
border-style: dashed;
border-color: {$sh-greyborder};
color: {$sh-greytext};
text-shadow: 1px 1px #fff;
}
.phui-tag-shade-checkered .phui-icon-view {
color: {$sh-greyicon};
}
a.phui-tag-view:hover.phui-tag-shade-checkered .phui-tag-core {
border-style: solid;
border-color: {$sh-greyborder};
}
.phui-tag-shade-disabled .phui-tag-core {
background-color: {$sh-disabledbackground};
border-color: {$sh-lightdisabledborder};
color: {$sh-disabledtext};
}
.phui-tag-shade-disabled .phui-icon-view {
color: {$sh-disabledicon};
}
a.phui-tag-view:hover.phui-tag-shade-disabled .phui-tag-core {
border-color: {$sh-disabledborder};
}
+
+.phabricator-handle-tag-list-item + .phabricator-handle-tag-list-item {
+ margin-top: 4px;
+}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Jul 29, 12:25 PM (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
188609
Default Alt Text
(16 KB)

Event Timeline