Skip to content

Commit 92e8c07

Browse files
committed
Add version title for templates
1 parent e865c48 commit 92e8c07

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
@@ -542,6 +542,11 @@ public function getVersionAlias(): string
542542
return '';
543543
}
544544

545+
public function getVersionTitle(): string
546+
{
547+
return $this->version . ($this->hasVersionAlias() ? ' / ' . $this->getVersionAlias() : '');
548+
}
549+
545550
/**
546551
* Get funding, sorted to help the V2 metadata compression algo.
547552
*

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.versionTitle }}</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.versionTitle }}</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)