Skip to content

Commit b43d3a8

Browse files
committed
Show version reference on package info page
1 parent 3c2ff84 commit b43d3a8

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
@@ -503,6 +503,16 @@ public function setReleasedAt(?\DateTimeImmutable $releasedAt): void
503503
$this->releasedAt = $releasedAt;
504504
}
505505

506+
public function getSourceReference(): ?string
507+
{
508+
return $this->source['reference'] ?? null;
509+
}
510+
511+
public function getSourceType(): ?string
512+
{
513+
return $this->source['type'] ?? null;
514+
}
515+
506516
public function getSourceUrl(): ?string
507517
{
508518
return $this->source['url'] ?? null;
@@ -523,6 +533,11 @@ public function getDistUrl(): ?string
523533
return $this->dist['url'] ?? null;
524534
}
525535

536+
public function getReference(): ?string
537+
{
538+
return $this->source['reference'] ?? $this->dist['reference'] ?? null;
539+
}
540+
526541
public function hasVersionAlias(): bool
527542
{
528543
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)