| 3 | | <div class="images"> |
|---|
| 4 | | <table> |
|---|
| 5 | | <tbody> |
|---|
| 6 | | <py:for each="row in screenshots.matrix"> |
|---|
| 7 | | <tr> |
|---|
| 8 | | <py:for each="image in row"> |
|---|
| 9 | | <td> |
|---|
| 10 | | <py:choose> |
|---|
| 11 | | <div py:when="image.id != -1" class="image" style="width: ${screenshots.width}px; height: ${screenshots.height}px"> |
|---|
| 12 | | <?python |
|---|
| 13 | | frame_aspect = float(screenshots['width']) / float(screenshots['height']) |
|---|
| 14 | | image_aspect = float(image['width']) / float(image['height']) |
|---|
| 15 | | if frame_aspect < image_aspect: |
|---|
| 16 | | image_width = screenshots['width'] |
|---|
| 17 | | image_height = int(screenshots['width'] / image_aspect + 0.5) |
|---|
| 18 | | else: |
|---|
| 19 | | image_width = int(screenshots['height'] * image_aspect + 0.5) |
|---|
| 20 | | image_height = screenshots['height'] |
|---|
| 21 | | ?> |
|---|
| 22 | | <a href="${href.screenshots(image.id)}" title="${image.id}" style="line-height: ${screenshots.height - 4}px"> |
|---|
| 23 | | <img src="${href.screenshots(image.id)}?width=${image_width};height=${image_height};format=raw" |
|---|
| 24 | | alt="${image.description}"/> |
|---|
| 25 | | </a> |
|---|
| | 3 | <head> |
|---|
| | 4 | <title>Screenshots - Matrix View</title> |
|---|
| | 5 | </head> |
|---|
| | 6 | <body> |
|---|
| | 7 | <div class="images"> |
|---|
| | 8 | <table> |
|---|
| | 9 | <tbody> |
|---|
| | 10 | <py:for each="row in screenshots.matrix"> |
|---|
| | 11 | <tr> |
|---|
| | 12 | <py:for each="image in row"> |
|---|
| | 13 | <td> |
|---|
| | 14 | <py:choose> |
|---|
| | 15 | <div py:when="image.id != -1" class="image" style="width: ${screenshots.width}px; height: ${screenshots.height}px"> |
|---|
| | 16 | <?python |
|---|
| | 17 | frame_aspect = float(screenshots['width']) / float(screenshots['height']) |
|---|
| | 18 | image_aspect = float(image['width']) / float(image['height']) |
|---|
| | 19 | if frame_aspect < image_aspect: |
|---|
| | 20 | image_width = screenshots['width'] |
|---|
| | 21 | image_height = int(screenshots['width'] / image_aspect + 0.5) |
|---|
| | 22 | else: |
|---|
| | 23 | image_width = int(screenshots['height'] * image_aspect + 0.5) |
|---|
| | 24 | image_height = screenshots['height'] |
|---|
| | 25 | ?> |
|---|
| | 26 | <a href="${href.screenshots(image.id)}" title="${image.id}" style="line-height: ${screenshots.height - 4}px"> |
|---|
| | 27 | <img src="${href.screenshots(image.id, width = image_width, height = image_height, format = 'raw')}" |
|---|
| | 28 | alt="${image.description}"/> |
|---|
| | 29 | </a> |
|---|
| | 30 | </div> |
|---|
| | 31 | <div py:otherwise="" class="image noimage" style="width: ${screenshots.width}px; height: ${screenshots.height}px"> |
|---|
| | 32 | |
|---|
| | 33 | </div> |
|---|
| | 34 | </py:choose> |
|---|
| | 35 | <div class="name">${image.name or ' '}</div> |
|---|
| | 36 | <div py:if="'SCREENSHOTS_ADMIN' in perm" class="controls"> |
|---|
| | 37 | <py:choose> |
|---|
| | 38 | <py:when test="image.id != -1"> |
|---|
| | 39 | <a href="${href.screenshots()}?action=edit;id=${image.id};index=${screenshots.index}">Edit</a> |
|---|
| | 40 | <a href="${href.screenshots()}?action=delete;id=${image.id};index=${screenshots.index}">Delete</a> |
|---|
| | 41 | </py:when> |
|---|
| | 42 | <py:otherwise> |
|---|
| | 43 | |
|---|
| | 44 | </py:otherwise> |
|---|
| | 45 | </py:choose> |
|---|
| 51 | | <div class="controls"> |
|---|
| 52 | | <div class="position">Page ${screenshots.page}/${screenshots.page_count}</div> |
|---|
| 53 | | ← |
|---|
| 54 | | <py:choose> |
|---|
| 55 | | <py:when test="screenshots.prev_index != -1"> |
|---|
| 56 | | <a href="${href.screenshots()}?index=0">First Page</a> |
|---|
| 57 | | </py:when> |
|---|
| 58 | | <py:otherwise> |
|---|
| 59 | | First Page |
|---|
| 60 | | </py:otherwise> |
|---|
| 61 | | </py:choose> |
|---|
| 62 | | | |
|---|
| 63 | | <py:choose> |
|---|
| 64 | | <py:when test="screenshots.prev_index != -1"> |
|---|
| 65 | | <a href="${href.screenshots()}?index=${screenshots.prev_index}">Previous Page</a> |
|---|
| 66 | | </py:when> |
|---|
| 67 | | <py:otherwise> |
|---|
| 68 | | Previous Page |
|---|
| 69 | | </py:otherwise> |
|---|
| 70 | | </py:choose> |
|---|
| 71 | | | |
|---|
| 72 | | <span> |
|---|
| 73 | | <form class="goto" method="get" action="${href.screenshots()}"> |
|---|
| 74 | | <input type="input" name="page" value="${screenshots.page or '1'}" onkeypress="return checkNumber(event)"/> |
|---|
| 75 | | <input type="submit" value="Go"></input> |
|---|
| 76 | | </form> |
|---|
| 77 | | </span> |
|---|
| 78 | | | |
|---|
| 79 | | <py:choose> |
|---|
| 80 | | <py:when test="screenshots.next_index != -1"> |
|---|
| 81 | | <a href="${href.screenshots()}?index=${screenshots.next_index}">Next Page</a> |
|---|
| 82 | | </py:when> |
|---|
| 83 | | <py:otherwise> |
|---|
| 84 | | Next Page |
|---|
| 85 | | </py:otherwise> |
|---|
| 86 | | </py:choose> |
|---|
| 87 | | | |
|---|
| 88 | | <py:choose> |
|---|
| 89 | | <py:when test="screenshots.next_index != -1"> |
|---|
| 90 | | <a href="${href.screenshots()}?index=${screenshots.screenshot_count - 1}">Last Page</a> |
|---|
| 91 | | </py:when> |
|---|
| 92 | | <py:otherwise> |
|---|
| 93 | | Last Page |
|---|
| 94 | | </py:otherwise> |
|---|
| 95 | | </py:choose> |
|---|
| 96 | | → |
|---|
| 97 | | |
|---|
| 98 | | </div> |
|---|
| | 55 | <div class="controls"> |
|---|
| | 56 | <div class="position">Page ${screenshots.page}/${screenshots.page_count}</div> |
|---|
| | 57 | ← |
|---|
| | 58 | <py:choose> |
|---|
| | 59 | <py:when test="screenshots.prev_index != -1"> |
|---|
| | 60 | <a href="${href.screenshots()}?index=0">First Page</a> |
|---|
| | 61 | </py:when> |
|---|
| | 62 | <py:otherwise> |
|---|
| | 63 | First Page |
|---|
| | 64 | </py:otherwise> |
|---|
| | 65 | </py:choose> |
|---|
| | 66 | | |
|---|
| | 67 | <py:choose> |
|---|
| | 68 | <py:when test="screenshots.prev_index != -1"> |
|---|
| | 69 | <a href="${href.screenshots()}?index=${screenshots.prev_index}">Previous Page</a> |
|---|
| | 70 | </py:when> |
|---|
| | 71 | <py:otherwise> |
|---|
| | 72 | Previous Page |
|---|
| | 73 | </py:otherwise> |
|---|
| | 74 | </py:choose> |
|---|
| | 75 | | |
|---|
| | 76 | <span> |
|---|
| | 77 | <form class="goto" method="get" action="${href.screenshots()}"> |
|---|
| | 78 | <input type="input" name="page" value="${screenshots.page or '1'}" onkeypress="return checkNumber(event)"/> |
|---|
| | 79 | <input type="submit" value="Go"></input> |
|---|
| | 80 | </form> |
|---|
| | 81 | </span> |
|---|
| | 82 | | |
|---|
| | 83 | <py:choose> |
|---|
| | 84 | <py:when test="screenshots.next_index != -1"> |
|---|
| | 85 | <a href="${href.screenshots()}?index=${screenshots.next_index}">Next Page</a> |
|---|
| | 86 | </py:when> |
|---|
| | 87 | <py:otherwise> |
|---|
| | 88 | Next Page |
|---|
| | 89 | </py:otherwise> |
|---|
| | 90 | </py:choose> |
|---|
| | 91 | | |
|---|
| | 92 | <py:choose> |
|---|
| | 93 | <py:when test="screenshots.next_index != -1"> |
|---|
| | 94 | <a href="${href.screenshots()}?index=${screenshots.screenshot_count - 1}">Last Page</a> |
|---|
| | 95 | </py:when> |
|---|
| | 96 | <py:otherwise> |
|---|
| | 97 | Last Page |
|---|
| | 98 | </py:otherwise> |
|---|
| | 99 | </py:choose> |
|---|
| | 100 | → |
|---|
| | 101 | </div> |
|---|
| | 102 | </body> |
|---|