Skip to content

Commit a18cb1e

Browse files
committed
Add version name for templates
1 parent e171efb commit a18cb1e

3 files changed

Lines changed: 7 additions & 12 deletions

File tree

src/Doctrine/Entity/Version.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ public function setNormalizedVersion(string $normalizedVersion): void
177177
$this->normalizedVersion = $normalizedVersion;
178178
}
179179

180+
public function getVersionName(): string
181+
{
182+
return $this->version . ($this->hasVersionAlias() ? ' / ' . $this->getVersionAlias() : '');
183+
}
184+
180185
public function getDescription(): ?string
181186
{
182187
return $this->description;

templates/dashboard/packages/package_info.html.twig

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@
33
{% block page_title %}
44
{%- apply spaceless -%}
55
{{ package.name }}
6-
<small>
7-
{{ version.version }}
8-
{% if version.hasVersionAlias() %}
9-
/ {{ version.versionAlias }}
10-
{% endif %}
11-
</small>
6+
<small>{{ version.versionName }}</small>
127
{%- endapply -%}
138
{% endblock %}
149

templates/dashboard/packages/package_versions.html.twig

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,7 @@
2626
{% set packageVersionInfoUrl = path('dashboard_packages_version_info', {packageName: version.package.name, packageVersion: version.version}) %}
2727
<a href="{{ packageVersionInfoUrl }}" class="list-group-item">
2828
<div class="d-flex justify-content-between">
29-
<span>
30-
{{ version.version }}
31-
{% if version.hasVersionAlias() %}
32-
/ {{ version.versionAlias }}
33-
{% endif %}
34-
</span>
29+
<span>{{ version.versionName }}</span>
3530
<span class="text-muted">{{ version.releasedAt.format('Y-m-d H:i') }} UTC</span>
3631
</div>
3732
</a>

0 commit comments

Comments
 (0)