home.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?php
  2. /**
  3. * Home view.
  4. *
  5. * Contains the view layout and some code to present the data.
  6. *
  7. * @author Iñigo Valentin <i@inigovalentin.com>
  8. * @license https://www.gnu.org/licenses/gpl-3.0.en.html GNU General Public License V3
  9. * @package IV
  10. * @category View
  11. * @property Home_Page $page The page model.
  12. * @var Home_Page $page The page model.
  13. */
  14. ?>
  15. <!DOCTYPE html>
  16. <html lang='<?=get_context()->get_lang()?>'>
  17. <head>
  18. <?=$page->generate_head()?>
  19. </head>
  20. <body>
  21. <header>
  22. <?php
  23. include __DIR__ . "/inc/header.php";
  24. ?>
  25. </header>
  26. <main>
  27. <section id='profile'>
  28. <h3>
  29. <?=get_context()->get_user()->get_display_name()?>
  30. </h3>
  31. <!-- TODO: Profile form model -->
  32. <article>
  33. <h4 id='tagline'><?=get_context()->get_user()->get_text("TAGLINE")?></h4>
  34. <img
  35. id='profile_image'
  36. srcset='<?=HTML::srcset(get_context()->get_user()->get_image())?>'
  37. src='<?=URL::IMG["CONTENT"] . 'profile/' . get_context()->get_user()->get_image()?>'
  38. alt='<?=get_context()->get_user()->get_display_name()?>'
  39. title='<?=get_context()->get_user()->get_display_name()?>'
  40. />
  41. <table id='profile_table'>
  42. <tr>
  43. <?php
  44. $i = 0;
  45. $total = sizeof(get_context()->get_user()->get_social());
  46. if (get_context()->get_user()->get_first_email() != null){
  47. $i ++;
  48. $total ++;
  49. ?>
  50. <td class='social'>
  51. <a target='_blank' title='eMail' href='mailto:<?=get_context()->get_user()->get_first_email()?>'>
  52. <img src='<?=URL::IMG["LAYOUT"]?>social/email.svg' alt='eMail' title='eMail'/>
  53. </a>
  54. </td>
  55. <?php
  56. }
  57. foreach (get_context()->get_user()->get_social() as $social){
  58. ?>
  59. <td class='social'>
  60. <a target='_blank' title='<?=$social->get_text()?>' href='<?=$social->get_url()?>'>
  61. <img src='<?=URL::IMG["LAYOUT"]?>social/<?=$social->get_logo()?>' title='<?=$social->get_text()?>' alt='<?=$social->get_site_name()?>'/>
  62. </a>
  63. </td>
  64. <?php
  65. $i ++;
  66. if ($total > 3 && $i >= $total / 2){
  67. $i = 0;
  68. ?>
  69. </tr>
  70. <tr>
  71. <?php
  72. }
  73. }
  74. ?>
  75. </tr>
  76. </table>
  77. <!-- <div id='profile_content'> -->
  78. <p id='bio'><?=get_context()->get_user()->get_text("BIO")?></p>
  79. </div>
  80. <div class='buttons'>
  81. <a class='a_button' href='<?=URL::PROFILE?>'>
  82. <?=TEXT::get("INDEX_PROFILE_MORE");?>
  83. </a>
  84. </div>
  85. </article>
  86. </section>
  87. <section id='projects'>
  88. <h3>
  89. <?=TEXT::get("INDEX_PROJECTS");?>
  90. </h3>
  91. <?php
  92. foreach ($page->get_projects() as $project){
  93. ?>
  94. <article class='project'>
  95. <table>
  96. <tr>
  97. <?php
  98. if (strlen($project->get_logo()) > 0){
  99. ?>
  100. <td class='logo'>
  101. <a href='<?=URL::PROJECTS . $project->get_permalink()?>'>
  102. <img
  103. class='project_image'
  104. alt='<?=TEXT::get($project->get_title())?>'
  105. title='<?=TEXT::get($project->get_title())?>'
  106. srcset='<?=HTML::srcset("project/" . $project->get_logo())?>'
  107. src='<?=URL::IMG["CONTENT"]?>project/<?=$project->get_logo()?>'
  108. />
  109. </a>
  110. </td>
  111. <?php
  112. }
  113. ?>
  114. <td class='project_details'>
  115. <h4 class='project_name'>
  116. <a href='<?=URL::PROJECTS . $project->get_permalink()?>'>
  117. <?=$project->get_title()?>
  118. </a>
  119. </h4>
  120. <span>
  121. <?=$project->get_header()?>
  122. </span>
  123. </td>
  124. </tr>
  125. </table>
  126. </article>
  127. <?php
  128. }
  129. ?>
  130. <div class='buttons'>
  131. <a class='a_button' href='<?=URL::PROJECTS?>'>
  132. <?=TEXT::get("INDEX_PROJECTS_ALL");?>
  133. </a>
  134. </div>
  135. </section>
  136. </main>
  137. <?php
  138. include __DIR__ . "/inc/footer.php";
  139. ?>
  140. </body>
  141. </html>