1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-09 21:38:29 +01:00

Strike through archived projects in navigation crumbs

Summary:
Going to e.g. the workboard of an archived project, there is no indication when the project has been archived (the blurred project icon is only displayed if the viewport width is >920px). This can lead to confusion why a workboard is completely empty.
Thus render an archived project as strike-through in the navigation bread crumbs.

Closes T15890

Test Plan:
* Go to the {Profile, Workboard, Reports, Members, Subprojects, Reports} pages of an active and an archived project and look at the navigation crumbs bar below Phorge's global top bar.
* Create an active subproject and active milestone of an archived project (and vice versa) and look at the navigation crumbs.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Tags: #projects

Maniphest Tasks: T15890

Differential Revision: https://we.phorge.it/D25774
This commit is contained in:
Andre Klapper 2025-02-03 18:53:21 +01:00
parent 6facee6140
commit 0bd8388684
5 changed files with 31 additions and 8 deletions

View file

@ -9,7 +9,7 @@ return array(
'names' => array(
'conpherence.pkg.css' => '2f25eb4f',
'conpherence.pkg.js' => '020aebcf',
'core.pkg.css' => 'ac619266',
'core.pkg.css' => '112931ab',
'core.pkg.js' => '8c86adab',
'dark-console.pkg.js' => '187792c2',
'differential.pkg.css' => '94bb10ca',
@ -146,7 +146,7 @@ return array(
'rsrc/css/phui/phui-cms.css' => '8c05c41e',
'rsrc/css/phui/phui-comment-form.css' => '3c6679a3',
'rsrc/css/phui/phui-comment-panel.css' => 'ec4e31c0',
'rsrc/css/phui/phui-crumbs-view.css' => '614f43cf',
'rsrc/css/phui/phui-crumbs-view.css' => 'a6a337a4',
'rsrc/css/phui/phui-curtain-object-ref-view.css' => '51d93266',
'rsrc/css/phui/phui-curtain-view.css' => '68c5efb6',
'rsrc/css/phui/phui-document-pro.css' => '48e72f0a',
@ -838,7 +838,7 @@ return array(
'phui-cms-css' => '8c05c41e',
'phui-comment-form-css' => '3c6679a3',
'phui-comment-panel-css' => 'ec4e31c0',
'phui-crumbs-view-css' => '614f43cf',
'phui-crumbs-view-css' => 'a6a337a4',
'phui-curtain-object-ref-view-css' => '51d93266',
'phui-curtain-view-css' => '68c5efb6',
'phui-document-summary-view-css' => 'b068eed1',

View file

@ -137,8 +137,8 @@ abstract class PhabricatorProjectController extends PhabricatorController {
break;
}
}
$crumbs->addTextCrumb($ancestor->getName(), $crumb_uri);
$archived = $ancestor->isArchived();
$crumbs->addTextCrumb($ancestor->getName(), $crumb_uri, $archived);
}
}

View file

@ -4,6 +4,7 @@ final class PHUICrumbView extends AphrontView {
private $name;
private $href;
private $strikethrough = false;
private $icon;
private $isLastCrumb;
private $workflow;
@ -54,6 +55,17 @@ final class PHUICrumbView extends AphrontView {
return $this;
}
/**
* Render this crumb as strike-through.
*
* @param bool $strikethrough True to render the crumb strike-through.
* @return $this
*/
public function setStrikethrough(bool $strikethrough) {
$this->strikethrough = $strikethrough;
return $this;
}
public function setIcon($icon) {
$this->icon = $icon;
return $this;
@ -90,6 +102,10 @@ final class PHUICrumbView extends AphrontView {
->setIcon($this->icon);
}
if ($this->strikethrough) {
$classes[] = 'phui-crumb-strikethrough';
}
// Surround the crumb name with spaces so that double clicking it only
// selects the crumb itself.
$name = array(' ', $this->name);

View file

@ -15,15 +15,18 @@ final class PHUICrumbsView extends AphrontView {
* Convenience method for adding a simple crumb with just text, or text and
* a link.
*
* @param string $text Text of the crumb.
* @param string $text Text of the crumb.
* @param string $href (optional) href for the crumb.
* @param bool $strikethrough (optional) Strikethrough (=inactive/disabled)
* for the crumb.
* @return $this
*/
public function addTextCrumb($text, $href = null) {
public function addTextCrumb($text, $href = null, $strikethrough = false) {
return $this->addCrumb(
id(new PHUICrumbView())
->setName($text)
->setHref($href));
->setHref($href)
->setStrikethrough($strikethrough));
}
public function addCrumb(PHUICrumbView $crumb) {

View file

@ -71,6 +71,10 @@
margin: 0 4px;
}
.phui-crumb-strikethrough > .phui-crumb-name {
text-decoration: line-through;
}
.device-phone .phui-crumb-icon {
margin-left: 7px;
}