Browse Source

Merge pull request #592 from venyii/add-license-warning

Add a warning in the package view if no license was found for the current version
Jordi Boggiano 9 years ago
parent
commit
0d9bbb28bb

+ 1 - 1
src/Packagist/WebBundle/Resources/views/Package/versionDetails.html.twig

@@ -8,7 +8,7 @@
     </span>
 
     <span class="release-date">{{ version.releasedAt|date("Y-m-d H:i") }} UTC</span>
-</div class="version-number">
+</div>
 
 <div class="clearfix package-links">
     {% for types in [["require", "devRequire", "suggest", "provide", "conflict", "replace"]] %}

+ 4 - 0
src/Packagist/WebBundle/Resources/views/Package/viewPackage.html.twig

@@ -68,6 +68,10 @@
                         <div class="alert alert-danger">This package is in a broken state and will not update anymore. Some branches contain invalid data and until you fix them the entire package is frozen. Click "Force Update" above to see details.</div>
                     {% endif %}
 
+                    {% if expandedVersion and not expandedVersion.license %}
+                        <div class="alert alert-danger">There is no license information available for the current version ({{ expandedVersion.version }}) of this package. Please contact the maintainer for more information.</div>
+                    {% endif %}
+
                     <p class="description">{{ package.description }}</p>
 
                     {% if hasActions %}