catalog.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php
  2. /**
  3. * Catalog view.
  4. *
  5. * Contains the view layout and some code to present the data
  6. *
  7. * @category View
  8. * @property_read Catalog_Page $page The page model
  9. * @property_read int $UID Player ID
  10. */
  11. ?>
  12. <!DOCTYPE html>
  13. <html lang='en'>
  14. <head>
  15. <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
  16. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
  17. <title><?=$page->title?></title>
  18. <link rel='shortcut icon' href='<?=$page->favicon?>'/>
  19. <!-- CSS files -->
  20. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>ui.css'/>
  21. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>catalog.css'/>
  22. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>filters.css'/>
  23. <!-- Meta tags -->
  24. <link rel='canonical' href='<?=$page->canonical?>'/>
  25. <link rel='author' href='<?=$page->author?>'/>
  26. <link rel='publisher' href='<?=$page->author?>'/>
  27. <meta name='description' content='<?=$page->description?>'/>
  28. <meta property='og:title' content='<?=$page->title?>'/>
  29. <meta property='og:url' content='<?=$page->canonical?>'/>
  30. <meta property='og:description' content='<?=$page->description?>'/>
  31. <meta property='og:image' content='<?=$page->icon?>'/>
  32. <meta property='og:site_name' content='<?=$page->name?>'/>
  33. <meta property='og:type' content='website'/>
  34. <meta property='og:locale' content='en'/>
  35. <meta name='twitter:card' content='summary'/>
  36. <meta name='twitter:title' content='<?=$page->title?>'/>
  37. <meta name='twitter:description' content='<?=$page->description?>'/>
  38. <meta name='twitter:image' content='<?=$page->icon?>'/>
  39. <meta name='twitter:url' content='<?=$page->canonical?>'/>
  40. <meta name='robots' content='index follow'/>
  41. <script>
  42. /**
  43. * Shows or hiddes the filters panel.
  44. */
  45. function toggleFilters(){
  46. var content = document.getElementById('filters_content');
  47. var slid = document.getElementById('filters_slid');
  48. if (content.style.maxHeight != '30em'){
  49. content.style.maxHeight = '30em';
  50. slid.style.transform = 'rotate(90deg)';
  51. }
  52. else{
  53. content.style.maxHeight = '0px';
  54. slid.style.transform = 'rotate(0deg)';
  55. }
  56. };
  57. </script>
  58. </head>
  59. <body>
  60. <?php
  61. include __DIR__ . "/inc/header.php";
  62. ?>
  63. <section class='filters'>
  64. <h2 id='filters_title' onClick='toggleFilters();'>
  65. <img id='filters_slid' id='filters_slid' alt=' ' src='<?=URL::IMG["ICON"]?>slid.png'/>
  66. Catalog filters
  67. </h2>
  68. <article id='filters_content'>
  69. <?php
  70. $filters = $page->filters;
  71. include __DIR__ . "/inc/filter_catalog.php";
  72. ?>
  73. </article>
  74. </section> <!-- #filters -->
  75. <section class='list'>
  76. <h2>
  77. Catalog
  78. </h2>
  79. <article>
  80. <?php
  81. $element = "";
  82. foreach ($page->units as $mon){
  83. if ($mon->element != $element){
  84. if ($element != ""){
  85. ?>
  86. </article>
  87. <article>
  88. <?php
  89. }
  90. $element = $mon->element;
  91. }
  92. ?>
  93. <div class='monster'>
  94. <a href='/<?=$UID?>/catalog/<?=$mon->id?>'>
  95. <div class='monster_panel'>
  96. <?=HTML::unit_panel($mon)?>
  97. </div>
  98. </a>
  99. </div>
  100. <?php
  101. }
  102. ?>
  103. </article>
  104. </section> <!-- #catalog -->
  105. <?php
  106. include __DIR__ . "/inc/footer.php";
  107. ?>
  108. </body>
  109. </html>