view.view 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. @Init{
  2. $this->RegisterCSSFile("gallery.css");
  3. $this->RegisterJSFile("controllers/gallery.js");
  4. }@
  5. @Title{Gallery}@
  6. @Body{
  7. <div id="album-viewer" ng-controller="gallery">
  8. <div id="album-description">
  9. <div class="expander" ng-click="showDescription=!showDescription" ng-class="{expanded: showDescription}">Album Description</div>
  10. <div class="text" ng-show="showDescription">
  11. <?=PostFormatter::FormatToHTML($album->AlbumDescription)?>
  12. </div>
  13. </div>
  14. <div id="album-thumbnails">
  15. <?php foreach ($album->Images as $index=>$image){ ?>
  16. <img ng-click="imageToShow=<?=$index?>" src="/<?=$image->ThumbnailPath?>" ng-class="{selected:imageToShow==<?=$index?>}" />
  17. <?php } ?>
  18. </div>
  19. <div id="album-images">
  20. <?php foreach ($album->Images as $index=>$image){ ?>
  21. <div class="image" ng-if="<?=$index?>===imageToShow">
  22. <p class="title"><?=$image->ImageTitle?></p>
  23. <img src="/<?=$image->Path?>" />
  24. </div>
  25. <?php } ?>
  26. </div>
  27. <scope-init value="images"><?=json_encode($album->Images) ?></scope-init>
  28. <div id="nextButton" ng-click="showNextImage()"></div>
  29. <div id="prevButton" ng-click="showPreviousImage()"></div>
  30. </div>
  31. }@
  32. @ButtonsLeft{
  33. <button title="Previous Image" onclick="$('#prevButton').click()">
  34. <img src="/images/previous.svg" alt="Previous" />
  35. </button>
  36. }@
  37. @ButtonsRight{
  38. <button title="Next Image" onclick="$('#nextButton').click()">
  39. <img src="/images/next.svg" alt="Next" />
  40. </button>
  41. }@