Skip to content
This repository has been archived by the owner on Dec 5, 2021. It is now read-only.

Commit

Permalink
Merge branch 'fix_show_package_version' of https://github.com/dbwpe/p…
Browse files Browse the repository at this point in the history
…yshop into dbwpe-fix_show_package_version
  • Loading branch information
mardiros committed Jun 28, 2017
2 parents ae08222 + c2c57c7 commit d321476
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions pyshop/templates/pyshop/package/show.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,17 @@ <h1>{{package.name}} {{release.version}}</h1>

<p>
{% trans %}Other Version:{% endtrans %}
{% set display = 0 %}
{% set idx = 0 %}
{% for r in package.sorted_releases %}
{% if r.id == release.id %}
{% set idx = loop.index0 %}
{% set display = 1%}
{% if idx > 0 %}
<a class="btn btn-info btn-xs active" role="button"
href="{{ route_url('show_package_version',
package_name=package.name,
release_version=package.sorted_releases[0].version)}}">
<span class="glyphicon glyphicon-tag"></span>
{{package.sorted_releases[0].version}}
</a>
...
{% endif %}
{% endif %}
{% if display and loop.index <= idx + 10 %}
<a class="btn btn-info btn-xs active"
role="button"
{% if loop.index < 10 %}
<a class="btn btn-info btn-xs{% if r.id == release.id %} active{% endif %}"
role="button"
href="{{ route_url('show_package_version', package_name=package.name, release_version=r.version)}}">
<span class="glyphicon glyphicon-tag"></span>
{{r.version}}
</a>
{% endif %}
{% if loop.last and idx + 10 < loop.index %}
...
{% if loop.last and loop.index >= 10 %}
<a class="btn btn-link btn-xs" role="button" href="{{ route_url('show_simple', package_name=package.name) }}">...</a>
{% endif %}
{% endfor %}
</p>
Expand Down

0 comments on commit d321476

Please sign in to comment.