Просмотр исходного кода

Avoid showing warnings on abandoned packages in listings, fixes #946

Jordi Boggiano 7 лет назад
Родитель
Сommit
d607ae7e5d
1 измененных файлов с 9 добавлено и 7 удалено
  1. 9 7
      src/Packagist/WebBundle/Resources/views/macros.html.twig

+ 9 - 7
src/Packagist/WebBundle/Resources/views/macros.html.twig

@@ -16,18 +16,20 @@
                                 {% if package.id is not numeric %}
                                     <small>(Virtual Package)</small>
                                 {% endif %}
-                                {% if showAutoUpdateWarning and '://github.com/' in package.repository and package.getAutoUpdated() == 1 %}
-                                    <small>(Legacy Auto-Update, Needs Attention)</small>
-                                {% elseif showAutoUpdateWarning and '://github.com/' in package.repository and package.getAutoUpdated() == 0 %}
-                                    <small>(Not Auto-Updated, Needs Attention)</small>
-                                {% elseif showAutoUpdateWarning and not package.isAutoUpdated() %}
-                                    <small>(Not Auto-Updated)</small>
+                                {% if not package.abandoned|default(false) %}
+                                    {% if showAutoUpdateWarning and '://github.com/' in package.repository and package.getAutoUpdated() == 1 %}
+                                        <small>(Legacy Auto-Update, Needs Attention)</small>
+                                    {% elseif showAutoUpdateWarning and '://github.com/' in package.repository and package.getAutoUpdated() == 0 %}
+                                        <small>(Not Auto-Updated, Needs Attention)</small>
+                                    {% elseif showAutoUpdateWarning and not package.isAutoUpdated() %}
+                                        <small>(Not Auto-Updated)</small>
+                                    {% endif %}
                                 {% endif %}
                             </h4>
                             {% if package.description is defined and package.description %}
                                 <p>{{ package.description }}</p>
                             {% endif %}
-                            {% if package.abandoned is defined and package.abandoned %}
+                            {% if package.abandoned|default(false) %}
                                 <p class="abandoned">
                                     <i class="glyphicon glyphicon-exclamation-sign"></i> Abandoned! {% if package.replacementPackage %}See <a href="{{ '://' in package.replacementPackage ? package.replacementPackage : path('view_package', {name: package.replacementPackage}) }}">{{ package.replacementPackage }}</a>{% endif %}
                                 </p>