Skip to content

Commit 5f79f66

Browse files
committed
Show version reference on package info page
1 parent 55ab09e commit 5f79f66

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

src/Doctrine/Entity/Version.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,16 @@ public function setReleasedAt(?\DateTimeInterface $releasedAt): void
517517
$this->releasedAt = $releasedAt;
518518
}
519519

520+
public function getSourceReference(): ?string
521+
{
522+
return $this->source['reference'] ?? null;
523+
}
524+
525+
public function getSourceType(): ?string
526+
{
527+
return $this->source['type'] ?? null;
528+
}
529+
520530
public function getSourceUrl(): ?string
521531
{
522532
return $this->source['url'] ?? null;
@@ -537,6 +547,11 @@ public function getDistUrl(): ?string
537547
return $this->dist['url'] ?? null;
538548
}
539549

550+
public function getReference(): ?string
551+
{
552+
return $this->source['reference'] ?? $this->dist['reference'] ?? null;
553+
}
554+
540555
public function hasVersionAlias(): bool
541556
{
542557
return $this->isDevelopment() && $this->getVersionAlias();

templates/dashboard/packages/package_info.html.twig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
{% endfor %}
2727
</div>
2828
{% endif %}
29+
30+
{% if version.reference %}
31+
<p>{{ 'Reference'|trans }}: <code>{{ version.reference }}</code></p>
32+
{% endif %}
2933
</div>
3034
<div class="col-md-4">
3135
<div class="dirigent-package-sidebar bg-body-secondary px-3 py-2 mb-2 rounded">

translations/messages.en.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ Implementations: Implementations
4848
Installations: Installations
4949
License: License
5050
Providers: Providers
51+
Reference: Reference
5152
Statistics: Statistics
5253
Suggesters: Suggesters
5354

0 commit comments

Comments
 (0)