File tree Expand file tree Collapse file tree
templates/dashboard/packages Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,6 +32,10 @@ public function info(string $packageName): Response
3232 $ package = $ this ->packageRepository ->findOneBy (['name ' => $ packageName ]);
3333 $ version = $ package ->getLatestVersion ();
3434
35+ if (!$ version ) {
36+ return $ this ->redirectToRoute ('dashboard_packages_versions ' , ['packageName ' => $ packageName ]);
37+ }
38+
3539 return $ this ->versionInfo ($ packageName , $ version ->getNormalizedVersion ());
3640 }
3741
Original file line number Diff line number Diff line change 44
55<ul class =" nav nav-pills nav-justified d-grid d-md-flex gap-1 pb-3 mb-3 border-bottom" >
66 <li class =" nav-item" >
7- {% set packageInfoUrl = path(' dashboard_packages_info' , {packageName : package .name }) %}
8- <a {{ (currentPage == ' info' ? attrActive : attr )| raw }} href =" {{ packageInfoUrl }}" >{{ ' Info' | trans }}</a >
7+ {% if package .versions | length > 0 %}
8+ {% set packageInfoUrl = path(' dashboard_packages_info' , {packageName : package .name }) %}
9+ <a {{ (currentPage == ' info' ? attrActive : attr )| raw }} href =" {{ packageInfoUrl }}" >{{ ' Info' | trans }}</a >
10+ {% else %}
11+ <span class =" nav-link disabled" >{{ ' Info' | trans }}</span >
12+ {% endif %}
913 </li >
1014 <li class =" nav-item" >
1115 {% set packageVersionsUrl = path(' dashboard_packages_versions' , {packageName : package .name }) %}
Original file line number Diff line number Diff line change 55{% block page_content %}
66 {{ include (' dashboard/packages/_package_header.html.twig' , {currentPage : ' versions' }) }}
77
8- {{ _self.versionList (' Latest versions' , package .activeVersions ) }}
9- {{ _self.versionList (' Development versions' , package .devVersions ) }}
10- {{ _self.versionList (' Historical versions' , package .historicalVersions ) }}
11- {{ _self.versionList (' Development branch versions' , package .devBranchVersions ) }}
8+ {% if package .versions | length > 0 %}
9+ {{ _self.versionList (' Latest versions' , package .activeVersions ) }}
10+ {{ _self.versionList (' Development versions' , package .devVersions ) }}
11+ {{ _self.versionList (' Historical versions' , package .historicalVersions ) }}
12+ {{ _self.versionList (' Development branch versions' , package .devBranchVersions ) }}
13+ {% else %}
14+ <table class =" table datagrid datagrid-empty" >
15+ <tbody >
16+ {% for i in 1 .. 14 %}
17+ <tr class =" empty-row" >
18+ <td ><span ></span ></td >
19+ <td ><span ></span ></td >
20+ <td ><span ></span ></td >
21+ <td ><span ></span ></td >
22+ <td ><span ></span ></td >
23+ <td ><span ></span ></td >
24+ </tr >
25+
26+ {% if 3 == loop .index %}
27+ <tr class =" no-results" >
28+ <td colspan =" 100" >
29+ {{ ' No published versions found' | trans }}
30+ </td >
31+ </tr >
32+ {% endif %}
33+ {% endfor %}
34+ </tbody >
35+ </table >
36+ {% endif %}
1237{% endblock %}
1338
1439{% macro versionList(title , versions ) %}
Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ Providers: Providers
5252Statistics : Statistics
5353Suggesters : Suggesters
5454
55+ No published versions found : No published versions found.
56+
5557# Package labels (Statistics)
5658Daily installations : Daily installations
5759Daily installations per version : Daily installations per version
You can’t perform that action at this time.
0 commit comments