137 lines
6.4 KiB
Django/Jinja
137 lines
6.4 KiB
Django/Jinja
|
|
#set _PASSTHROUGH = ['userID', 'tagID', 'order', 'prefix', 'inherited', 'blocked']
|
|
|
|
#include "includes/header.html.j2"
|
|
# from "includes/macros.html.j2" import rowToggle
|
|
|
|
#macro getDescription()
|
|
Packages
|
|
#if prefix
|
|
starting with {{ prefix }}
|
|
#endif
|
|
#if tag
|
|
in tag <a href="taginfo?tagID={{ tag.id }}">{{ tag.name }}</a>
|
|
#endif
|
|
#if user
|
|
owned by <a href="userinfo?userID={{ user.id }}">{{ user.name }}</a>
|
|
#endif
|
|
#endmacro
|
|
|
|
<h4>{{ getDescription() }}</h4>
|
|
|
|
<table class="data-list">
|
|
#if tag
|
|
<tr>
|
|
<td colspan="5">
|
|
<table class="nested">
|
|
<tr><td>
|
|
<strong>Inherited</strong>:
|
|
</td><td>
|
|
<select name="inherited" class="filterlist" onchange="javascript: window.location = 'packages?inherited=' + this.value + '{{ util.passthrough_except('inherited') }}';">
|
|
<option value="1" {{ 'selected' if inherited else '' }}>yes</option>
|
|
<option value="0" {{ 'selected' if not inherited else '' }}>no</option>
|
|
</select>
|
|
</td></tr>
|
|
<tr><td>
|
|
<strong>With blocked</strong>:
|
|
</td><td>
|
|
<select name="blocked" class="filterlist" onchange="javascript: window.location = 'packages?blocked=' + this.value + '{{ util.passthrough_except('blocked') }}';">
|
|
<option value="1" {{ 'selected' if blocked else '' }}>yes</option>
|
|
<option value="0" {{ 'selected' if not blocked else '' }}>no</option>
|
|
</select>
|
|
</td></tr>
|
|
</table>
|
|
</tr>
|
|
#endif
|
|
<tr>
|
|
<td class="charlist" colspan="{{ '5' if tag or user else '2' }}">
|
|
#for char in chars
|
|
#if prefix == char
|
|
<strong>{{ char }}</strong>
|
|
#else
|
|
<a href="packages?prefix={{ char }}{{ util.passthrough('userID', 'tagID', 'order', 'inherited', 'blocked') }}">{{ char }}</a>
|
|
#endif
|
|
|
|
|
#endfor
|
|
#if prefix
|
|
<a href="packages?{{ util.passthrough('userID', 'tagID', 'order', 'inherited', 'blocked', prefix='') }}">all</a>
|
|
#else
|
|
<strong>all</strong>
|
|
#endif
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paginate" colspan="{{ '5' if tag or user else '2' }}">
|
|
#if (packagePages |length) > 1
|
|
<form class="pageJump" action="">
|
|
Page:
|
|
<select onchange="javascript: window.location = 'packages?start=' + this.value * {{ packageRange }} + '{{ util.passthrough('userID', 'tagID', 'order', 'prefix', 'inherited', 'blocked') }}';">
|
|
#for pageNum in packagePages
|
|
<option value="{{ pageNum }}"{{ ' selected' if pageNum == packageCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
|
#endfor
|
|
</select>
|
|
</form>
|
|
#endif
|
|
#if packageStart > 0
|
|
<a href="packages?start={{ packageStart - packageRange }}{{ util.passthrough('userID', 'tagID', 'order', 'prefix', 'inherited', 'blocked') }}"><<<</a>
|
|
#endif
|
|
#if totalPackages != 0
|
|
<strong>Packages {{ packageStart + 1 }} through {{ packageStart + packageCount }} of {{ totalPackages }}</strong>
|
|
#endif
|
|
#if packageStart + packageCount < totalPackages
|
|
<a href="packages?start={{ packageStart + packageRange }}{{ util.passthrough('userID', 'tagID', 'order', 'prefix', 'inherited', 'blocked') }}">>>></a>
|
|
#endif
|
|
</td>
|
|
</tr>
|
|
<tr class="list-header">
|
|
<th><a href="packages?order={{ util.toggleOrder('package_id') }}{{ util.passthrough('userID', 'tagID', 'prefix', 'inherited', 'blocked') }}">ID</a> {{ util.sortImage('package_id') }}</th>
|
|
<th><a href="packages?order={{ util.toggleOrder('package_name') }}{{ util.passthrough('userID', 'tagID', 'prefix', 'inherited', 'blocked') }}">Name</a> {{ util.sortImage('package_name') }}</th>
|
|
#if tag or user
|
|
<th><a href="packages?order={{ util.toggleOrder('tag_name') }}{{ util.passthrough('userID', 'tagID', 'prefix', 'inherited', 'blocked') }}">Tag</a> {{ util.sortImage('tag_name') }}</th>
|
|
<th><a href="packages?order={{ util.toggleOrder('owner_name') }}{{ util.passthrough('userID', 'tagID', 'prefix', 'inherited', 'blocked') }}">Owner</a> {{ util.sortImage('owner_name') }}</th>
|
|
<th><a href="packages?order={{ util.toggleOrder('blocked') }}{{ util.passthrough('userID', 'tagID', 'prefix', 'inherited', 'blocked') }}">Included?</a> {{ util.sortImage('blocked') }}</th>
|
|
#endif
|
|
</tr>
|
|
#if (packages |length) > 0
|
|
#for package in packages
|
|
<tr class="{{ rowToggle(loop) }}">
|
|
<td>{{ package.package_id }}</td>
|
|
<td><a href="packageinfo?packageID={{ package.package_id }}">{{ package.package_name }}</a></td>
|
|
#if tag or user
|
|
<td><a href="taginfo?tagID={{ package.tag_id }}">{{ package.tag_name }}</a></td>
|
|
<td class="user-{{ package.owner_name }}"><a href="userinfo?userID={{ package.owner_id }}">{{ package.owner_name }}</a></td>
|
|
<td class="{{ (not package.blocked)|lower }}">{{ util.imageTag('no') if package.blocked else util.imageTag('yes') }}</td>
|
|
#endif
|
|
</tr>
|
|
#endfor
|
|
#else
|
|
<tr class="row-odd">
|
|
<td colspan="{{ '5' if tag or user else '2' }}">No packages</td>
|
|
</tr>
|
|
#endif
|
|
<tr>
|
|
<td class="paginate" colspan="{{ '5' if tag or user else '2' }}">
|
|
#if (packagePages |length) > 1
|
|
<form class="pageJump" action="">
|
|
Page:
|
|
<select onchange="javascript: window.location = 'packages?start=' + this.value * {{ packageRange }} + '{{ util.passthrough('userID', 'tagID', 'order', 'prefix', 'inherited', 'blocked') }}';">
|
|
#for pageNum in packagePages
|
|
<option value="{{ pageNum }}"{{ ' selected' if pageNum == packageCurrentPage else '' }}>{{ pageNum + 1 }}</option>
|
|
#endfor
|
|
</select>
|
|
</form>
|
|
#endif
|
|
#if packageStart > 0
|
|
<a href="packages?start={{ packageStart - packageRange }}{{ util.passthrough('userID', 'tagID', 'order', 'prefix', 'inherited', 'blocked') }}"><<<</a>
|
|
#endif
|
|
#if totalPackages != 0
|
|
<strong>Packages {{ packageStart + 1 }} through {{ packageStart + packageCount }} of {{ totalPackages }}</strong>
|
|
#endif
|
|
#if packageStart + packageCount < totalPackages
|
|
<a href="packages?start={{ packageStart + packageRange }}{{ util.passthrough('userID', 'tagID', 'order', 'prefix', 'inherited', 'blocked') }}">>>></a>
|
|
#endif
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
#include "includes/footer.html.j2"
|