瀏覽代碼

Add package aside extra links

* GitHub stargazers
* GitHub watchers
* GitHub network (forks)
* GitHub open issues
Sullivan SENECHAL 9 年之前
父節點
當前提交
6a75ef836c
共有 1 個文件被更改,包括 51 次插入8 次删除
  1. 51 8
      src/Packagist/WebBundle/Resources/views/Package/viewPackage.html.twig

+ 51 - 8
src/Packagist/WebBundle/Resources/views/Package/viewPackage.html.twig

@@ -165,14 +165,57 @@
                         </div>
 
                         <div class="facts col-xs-12 col-sm-6 col-md-12">
-                            <p><span><a href="{{ path('view_package_stats', {name: package.name}) }}" rel="nofollow">Installs</a>:</span> {% if downloads.total is defined %}{{ downloads.total|number_format(0, '.', '&#8201;')|raw }}{% else %}N/A{% endif %}</p>
-                            {% if dependents is defined %}<p><span><a href="{{ path('view_package_dependents', {name: package.name}) }}" rel="nofollow">Dependents</a>:</span> {{ dependents|number_format(0, '.', '&#8201;')|raw }}</p>{% endif %}
-                            {% if package.gitHubStars is not null %}<p><span>Stars:</span> {{ package.gitHubStars|number_format(0, '.', '&#8201;')|raw }}</p>{% endif %}
-                            {% if package.gitHubWatches is not null %}<p><span>Watchers:</span> {{ package.gitHubWatches|number_format(0, '.', '&#8201;')|raw }}</p>{% endif %}
-                            {% if package.gitHubForks is not null %}<p><span>Forks:</span> {{ package.gitHubForks|number_format(0, '.', '&#8201;')|raw }}</p>{% endif %}
-                            {% if package.gitHubOpenIssues is not null %}<p><span>Open Issues:</span> {{ package.gitHubOpenIssues|number_format(0, '.', '&#8201;')|raw }}</p>{% endif %}
-                            {% if package.language is not empty and package.language != 'PHP' %}<p><span>Language:</span> {{ package.language }}</p>{% endif %}
-                            {% if package.type is not empty and package.type != 'library' %}<p><span>Type:</span> {{ package.type }}</p>{% endif %}
+                            <p>
+                                <span>
+                                    <a href="{{ path('view_package_stats', {name: package.name}) }}" rel="nofollow">Installs</a>:
+                                </span>
+                                {% if downloads.total is defined %}{{ downloads.total|number_format(0, '.', '&#8201;')|raw }}{% else %}N/A{% endif %}
+                            </p>
+                            {% if dependents is defined %}
+                                <p>
+                                    <span>
+                                        <a href="{{ path('view_package_dependents', {name: package.name}) }}" rel="nofollow">Dependents</a>:
+                                    </span>
+                                    {{ dependents|number_format(0, '.', '&#8201;')|raw }}
+                                </p>
+                            {% endif %}
+                            {% if package.gitHubStars is not null %}
+                                <p>
+                                    <span>
+                                        <a href="{{ repoUrl }}/stargazers">Stars</a>:
+                                    </span>
+                                    {{ package.gitHubStars|number_format(0, '.', '&#8201;')|raw }}
+                                </p>
+                            {% endif %}
+                            {% if package.gitHubWatches is not null %}
+                                <p>
+                                    <span>
+                                        <a href="{{ repoUrl }}/watchers">Watchers</a>:
+                                    </span> {{ package.gitHubWatches|number_format(0, '.', '&#8201;')|raw }}
+                                </p>
+                            {% endif %}
+                            {% if package.gitHubForks is not null %}
+                                <p>
+                                    <span>
+                                        <a href="{{ repoUrl }}/network">Forks</a>:
+                                    </span>
+                                    {{ package.gitHubForks|number_format(0, '.', '&#8201;')|raw }}
+                                </p>
+                            {% endif %}
+                            {% if package.gitHubOpenIssues is not null %}
+                                <p>
+                                    <span>
+                                        <a href="{{ version.support.issues }}">Open Issues</a>:
+                                    </span>
+                                    {{ package.gitHubOpenIssues|number_format(0, '.', '&#8201;')|raw }}
+                                </p>
+                            {% endif %}
+                            {% if package.language is not empty and package.language != 'PHP' %}
+                                <p><span>Language:</span>{{ package.language }}</p>
+                            {% endif %}
+                            {% if package.type is not empty and package.type != 'library' %}
+                                <p><span>Type:</span>{{ package.type }}</p>
+                            {% endif %}
                         </div>
                     </div>
                 </div>