A new Riff-radio.org site with a static approach.

gallery.tmpl 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. ## -*- coding: utf-8 -*-
  2. <%inherit file="base.tmpl"/>
  3. <%namespace name="comments" file="comments_helper.tmpl"/>
  4. <%namespace name="ui" file="crumbs.tmpl" import="bar"/>
  5. <%block name="sourcelink"></%block>
  6. <%block name="content">
  7. ${ui.bar(crumbs)}
  8. %if title:
  9. <h1>${title|h}</h1>
  10. %endif
  11. %if post:
  12. <p>
  13. ${post.text()}
  14. </p>
  15. %endif
  16. %if folders:
  17. <ul>
  18. % for folder, ftitle in folders:
  19. <li><a href="${folder}"><i class="glyphicon glyphicon-folder-open"></i>&nbsp;${ftitle|h}</a></li>
  20. % endfor
  21. </ul>
  22. %endif
  23. <div id="gallery_container"></div>
  24. %if photo_array:
  25. <noscript>
  26. <ul class="thumbnails">
  27. %for image in photo_array:
  28. <li><a href="${image['url']}" class="thumbnail image-reference" title="${image['title']|h}">
  29. <img src="${image['url_thumb']}" alt="${image['title']|h}" /></a>
  30. %endfor
  31. </ul>
  32. </noscript>
  33. %endif
  34. %if site_has_comments and enable_comments:
  35. ${comments.comment_form(None, permalink, title)}
  36. %endif
  37. </%block>
  38. <%block name="extra_head">
  39. ${parent.extra_head()}
  40. <link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml">
  41. <style type="text/css">
  42. #gallery_container {
  43. position: relative;
  44. }
  45. .image-block {
  46. position: absolute;
  47. }
  48. </style>
  49. %if len(translations) > 1:
  50. %for langname in translations.keys():
  51. %if langname != lang:
  52. <link rel="alternate" hreflang="${langname}" href="${_link('gallery', gallery_path, langname)}">
  53. %endif
  54. %endfor
  55. %endif
  56. </%block>
  57. <%block name="extra_js">
  58. <script src="/assets/js/justified-layout.min.js"></script>
  59. <script src="/assets/js/gallery.min.js"></script>
  60. <script>
  61. var jsonContent = ${photo_array_json};
  62. var thumbnailSize = ${thumbnail_size};
  63. renderGallery(jsonContent, thumbnailSize);
  64. window.addEventListener('resize', function(){renderGallery(jsonContent, thumbnailSize)});
  65. </script>
  66. </%block>