show.html.erb 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <% content_for :head do %>
  2. <%= stylesheet_link_tag "project", media: "all", "data-turbolinks-track": "reload" %>
  3. <%= javascript_include_tag "project", "data-turbolinks-track" => true %>
  4. <% end %>
  5. <section>
  6. <h3>
  7. <%= @project.i18n_title %>
  8. </h3>
  9. <article>
  10. <div id='info_summary'>
  11. <h4>
  12. <%= @project.i18n_header %>
  13. </h4>
  14. <div id='text'>
  15. <% if @project.logo.attached? %>
  16. <%=
  17. image_tag(
  18. @project.logo,
  19. class: "project_image",
  20. id: "project_image",
  21. alt: ""
  22. )
  23. %>
  24. <% end %>
  25. <%= @project.i18n_text.html_safe %>
  26. </div>
  27. <% if @project.comment != nil %>
  28. <div id='comment'>
  29. <div id='comment_title'>
  30. <%= t("project.comment", name: @user.first_name) %>
  31. </div>
  32. <%= @project.i18n_comment.html_safe %>
  33. </div>
  34. <% end %>
  35. </div>
  36. <div id='info_details'>
  37. <div id='links' class='details'>
  38. <% @project.projectUrls.each do |url| %>
  39. <%=
  40. link_to(
  41. image_tag(
  42. url.urlTarget.logo,
  43. class: "link",
  44. title: url.urlTarget.i18n_summary,
  45. alt: url.urlTarget.i18n_summary
  46. ) + url.urlTarget.i18n_name,
  47. url.url,
  48. class: "link",
  49. target: "_blank",
  50. title: url.urlTarget.i18n_summary
  51. ) %>
  52. <% end %>
  53. </div>
  54. <div id='technologies' class='details'>
  55. <% @project.technologies.each do |technology| %>
  56. <span class='technology technology_<%=technology.nature%>'>
  57. <%= image_tag(technology.logo, class: "technology_logo", alt: "") %>
  58. <span class='technology_name'>
  59. <%= technology.name %>
  60. </span>
  61. </span>
  62. <% end %>
  63. </div>
  64. <div id='license' class='details'>
  65. <%= t("project.license") %>:
  66. <%=
  67. link_to(
  68. image_tag(
  69. @project.license.logo,
  70. title: @project.license.name,
  71. alt: @project.license.name
  72. ),
  73. @project.license.url,
  74. target: "_blank",
  75. title: @project.license.name
  76. )
  77. %>
  78. </div> <!-- #license -->
  79. <% if @project.images.attached? %>
  80. <div id='images' class='details'>
  81. <%= t("project.images") %>
  82. <br/>
  83. <% i = 0 %>
  84. <% @project.images.each do |image| %>
  85. <%=
  86. link_to(
  87. image_tag(
  88. image,
  89. class: "project_image",
  90. alt: ""
  91. ),
  92. "javascript:showImage(" + i.to_s + ");"
  93. ) %>
  94. <script>
  95. images[<%= i %>] = '<%= url_for(image) %>';
  96. </script>
  97. <% i = i + 1 %>
  98. <% end %>
  99. </div>
  100. <% end %>
  101. </div> <!-- #info_details -->
  102. </article>
  103. </section>
  104. <div id='gallery_bg'>
  105. </div>
  106. <section id='gallery'>
  107. <h3>
  108. <%= t("project.gallery_title", project: @project.i18n_title) %>
  109. <span id='gallery_close'>
  110. <%=
  111. link_to(
  112. image_tag(
  113. "control/close.svg",
  114. id: "gallery_close",
  115. alt: t("contact.cancel")
  116. ),
  117. #"mailto:" + @user.mail_adresses[0].address,
  118. "javascript:closeGallery()"
  119. )
  120. %>
  121. </span>
  122. </h3>
  123. <article>
  124. <div id='gallery_image_container'>
  125. <img id='gallery_image'/>
  126. </div>
  127. <div id='gallery_controls'>
  128. <div class='gallery_control' id='gallery_control_left'>
  129. <input type='button' value='<' onClick='javascript:previousPhoto();'/>
  130. </div>
  131. <div id='image_list'>
  132. <% i = 0 %>
  133. <% @project.images.each do |image| %>
  134. <%=
  135. link_to(
  136. image_tag(
  137. image,
  138. id: "gallery_preview_" + i.to_s,
  139. class: "gallery_preview",
  140. alt: ""
  141. ),
  142. "javascript:showImage(" + i.to_s + ");"
  143. ) %>
  144. <script>
  145. images[<%= i %>] = '<%= url_for(image) %>';
  146. </script>
  147. <% i = i + 1 %>
  148. <% end %>
  149. </div>
  150. <div class='gallery_control' id='gallery_control_right'>
  151. <input type='button' value='>' onClick='javascript:nextPhoto();'/>
  152. </div>
  153. </div>
  154. </article>
  155. </section>