catalog.php 4.1 KB

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