templates/hymns/info.html.twig line 1

Open in your IDE?
  1. {% extends('base.html.twig') %}
  2. {% block title %}Hymn Information for {{ hymn.title }}!{% endblock %}
  3. {% block pageId %}hymn_info{% endblock %}
  4. {% block javascripts %}
  5. {{ parent() }}
  6. {{ encore_entry_script_tags('hymninfo') }}
  7. {% endblock %}
  8. {% block body %}
  9. {% if not useImg %}
  10. <script src="//cdnjs.cloudflare.com/ajax/libs/pdfobject/2.0.201604172/pdfobject.min.js"
  11. integrity="sha256-dUe7c2jPkbycNGu4OSy/3FbLKU5FK1aM62Vc5Ni7sgs="
  12. crossorigin="anonymous"></script>
  13. {% endif %}
  14. <div class="card">
  15. <h2 class="card-header">Hymn Information</h2>
  16. <article class="card-body">
  17. <div class="hymn-info">
  18. <h3 class="ml-3 font-weight-bold">{{ hymn.title }}</h3>
  19. <hr/>
  20. {% if is_granted('ROLE_ADMIN') %}
  21. <h4 class="ml-3">
  22. <a href="{{ path('app_admin_hymns_edit', {'id': hymn.id}) }}" target="_blank">Edit this hymn</a>
  23. </h4>
  24. <hr/>
  25. {% endif %}
  26. {% if categories|length > 0 %}
  27. <h3 class="col-12 text-center font-weight-bold" title="List of categories associated with this hymn!">Category List</h3>
  28. <div class="text-center">
  29. Here is a list of categories associated with this hymn!
  30. </div>
  31. <div class="row ml-3">
  32. {% for category in categories %}
  33. <div class="col-md-6">
  34. <div class="small">
  35. <a title="{{ category.description }}" class="pr-3" href="{{ path('hymn_category_show', {'slug': category.slug}) }}">{{ category.title }}</a>
  36. </div>
  37. </div>
  38. {% endfor %}
  39. </div>
  40. <hr/>
  41. {% endif %}
  42. <div class="row">
  43. <div class="col-md-6 hymn-audio">
  44. <audio class="mx-2" style="width: 100%;" id="player" controls title="{{ hymn.title }}">
  45. <source src="/{{ hymnType.slug }}/midi/{{ hymn.slug }}.mp3" type="audio/mpeg">
  46. Your browser does not support the audio element.
  47. </audio>
  48. </div>
  49. <div class="col-md-6 hymn-score btn-group-vertical align-items-center mt-2 mt-sm-0" data-toggle="modal"
  50. title="View the hymn, '{{ hymn.title }}'."
  51. data-target="#largeModal"><i class="fa fa-music"> view music</i>
  52. </div>
  53. <div class="modal fade" id="largeModal" tabindex="-1" role="dialog" aria-labelledby="largeModal"
  54. aria-hidden="true">
  55. <div class="modal-dialog modal-lg">
  56. <div class="modal-content">
  57. <div class="modal-header" id="audio_container"></div>
  58. {% if useImg %}
  59. <div class="modal-body" id="image_container">
  60. {% if hymn.ScorePageCount > 1 %}
  61. {% for i in 0..(hymn.ScorePageCount-1) %}
  62. <img alt="{{ hymn.title }} page {{ i+1 }}"
  63. src="/{{ hymnType.slug }}/img/{{ hymn.slug }}-{{ i }}.jpg"/>
  64. {% endfor %}
  65. {% else %}
  66. <img alt="{{ hymn.title }}" src="/{{ hymnType.slug }}/img/{{ hymn.slug }}.jpg"/>
  67. {% endif %}
  68. </div>
  69. {% else %}
  70. <div class="modal-body" id="pdf_container"></div>
  71. <script>
  72. PDFObject.embed("/{{ hymnType.slug }}/pdfs/{{ hymn.title }}.pdf", "#pdf_container");
  73. </script>
  74. {% endif %}
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. <hr/>
  80. {% if is_recorded %}
  81. <h3 class="text-center">Audio Recording Samples</h3>
  82. <div class="row">
  83. {% for hymn in artist_hymns %}
  84. <div class="col-md-6 my-3 ml-2">
  85. <div class="{{ hymn.artistSlug }}">
  86. {{ hymn.artistName }}
  87. {% if hymn.yearRecorded is not null %}
  88. (in {{ hymn.yearRecorded }})
  89. {% endif %}
  90. </div>
  91. <audio class="h-50 w-50 m-1 p-0" id="player" controls title="{{ hymn.title }}">
  92. <source src="{{ hymn.HymnUrl }}{{ hymn.title }}.mp3" type="audio/mpeg">
  93. Your browser does not support the audio element.
  94. </audio>
  95. </div>
  96. {% endfor %}
  97. </div>
  98. <hr/>
  99. {% endif %}
  100. <div class="row">
  101. <div class="prev-hymn col-md-1">
  102. <a title="Go to the previous hymn"
  103. href="{{ path('hymnInfo', {'slug': hymn.prevSlug}) }}"><i class="fa fa-arrow-left ml-3"></i></a>
  104. </div>
  105. <div class="page-back text-center col-md-10">
  106. <a href="{{ path('hymns', {'hymnType': hymnType.slug}) }}">Back to the list</a>
  107. </div>
  108. <div class="next-hymn col-md-1">
  109. <a title="Go to the next hymn"
  110. href="{{ path('hymnInfo', {'slug': hymn.nextSlug}) }}"><i class="fa fa-arrow-right"></i></a>
  111. </div>
  112. </div>
  113. <hr/>
  114. <div class="row">
  115. <div class="col-md-3 text-right">Author</div>
  116. <div class="col-md-8">
  117. <a class="hymn-info-link d-inline" href="{{ path('authcomp', {'type': 'Author', 'id': auth.Id} ) }}">
  118. {{ auth.FirstName }} {{ auth.MiddleName }} {{ auth.LastName }}
  119. </a>{% if hymn.lyricyyyy|length > 0 %} in {{ hymn.lyricyyyy }} {% endif %}
  120. </div>
  121. <div class="col-md-1">
  122. <a href="#" class="authcomp-info" id="auth_{{ auth.ID }}"
  123. data-content="{{ auth.Notes|nl2br }}"
  124. data-toggle="modal" data-target="#authModal" data-id="{{ auth.ID }}"
  125. data-title="Author {{ auth.FirstName }} {{ auth.MiddleName }} {{ auth.LastName }}'s bio information">
  126. <i class="fa fa-book"></i>
  127. </a>
  128. </div>
  129. <div class="modal fade" id="authModal" tabindex="-1" role="dialog"
  130. aria-labelledby="authModalLabel">
  131. <div class="modal-dialog" role="document">
  132. <div class="modal-content">
  133. <div class="modal-header row">
  134. <h4 class="modal-title col-12" id="authModalLabel">
  135. {{ auth.FirstName }} {{ auth.MiddleName }} {{ auth.LastName }}'s bio information
  136. </h4>
  137. {% set bdate = auth.Birthdate|length > 0 ? auth.Birthdate : 'Date Unknown' %}
  138. {% set ddate = auth.Deathdate|length > 0 ? auth.Deathdate : 'Date Unknown' %}
  139. <h5 class="col-12">{{ bdate }} - {{ ddate }}</h5>
  140. </div>
  141. <div class="authcomp modal-body"
  142. id="authModalBody">{{ (auth.Notes ?? 'Sorry, we have no information for this author')|raw|nl2br }}</div>
  143. </div>
  144. </div>
  145. </div>
  146. </div>
  147. <hr/>
  148. <div class="row">
  149. <div class="col-md-3 text-right">Composer</div>
  150. <div class="col-md-8">
  151. <a class="hymn-info-link d-inline" href="{{ path('authcomp', {'type': 'Composer', 'id': comp.Id} ) }}">
  152. {{ comp.FirstName }} {{ comp.MiddleName }} {{ comp.LastName }}
  153. </a>{% if hymn.musicyyyy|length > 0 %} in {{ hymn.musicyyyy }} {% endif %}
  154. </div>
  155. <div class="col-md-1">
  156. <a href="#" class="authcomp-info" id="comp_{{ comp.ID }}"
  157. data-content="{{ comp.Notes|nl2br }}"
  158. data-toggle="modal" data-target="#compModal" data-id="{{ comp.ID }}"
  159. data-title="Composer {{ comp.FirstName }} {{ comp.MiddleName }} {{ comp.LastName }}'s bio information">
  160. <i class="fa fa-book"></i>
  161. </a>
  162. </div>
  163. <div class="modal fade" id="compModal" tabindex="-1" role="dialog"
  164. aria-labelledby="compModalLabel">
  165. <div class="modal-dialog" role="document">
  166. <div class="modal-content">
  167. <div class="modal-header row">
  168. <h4 class="modal-title col-12" id="compModalLabel">
  169. {{ comp.FirstName }} {{ comp.MiddleName }} {{ comp.LastName }}'s bio information
  170. </h4>
  171. {% set bdate = comp.Birthdate|length > 0 ? comp.Birthdate : 'Date Unknown' %}
  172. {% set ddate = comp.Deathdate|length > 0 ? comp.Deathdate : 'Date Unknown' %}
  173. <h5 class="col-12">{{ bdate }} - {{ ddate }}</h5>
  174. </div>
  175. <div class="authcomp modal-body"
  176. id="compModalBody">{{ (comp.Notes ?? 'Sorry, we have no information for this composer')|raw|nl2br }}</div>
  177. </div>
  178. </div>
  179. </div>
  180. </div>
  181. <hr/>
  182. <div class="row">
  183. <div class="col-md-3 text-right">Arranger</div>
  184. <div class="col-md-8">
  185. <a class="hymn-info-link d-inline" href="{{ path('authcomp', {'type': 'Arranger', 'id': arrn.Id} ) }}">
  186. {{ arrn.FirstName }} {{ arrn.MiddleName }} {{ arrn.LastName }}
  187. </a>{% if hymn.arrangedyyyy|length > 0 %} in {{ hymn.arrangedyyyy }} {% endif %}
  188. </div>
  189. <div class="col-md-1">
  190. <a href="#" class="authcomp-info" id="arrn_{{ arrn.ID }}"
  191. data-content="{{ arrn.Notes|nl2br }}"
  192. data-toggle="modal" data-target="#arrnModal" data-id="{{ arrn.ID }}"
  193. data-title="Arranger {{ arrn.FirstName }} {{ arrn.MiddleName }} {{ arrn.LastName }}'s bio information">
  194. <i class="fa fa-book"></i>
  195. </a>
  196. </div>
  197. <div class="modal fade" id="arrnModal" tabindex="-1" role="dialog"
  198. aria-labelledby="arrnModalLabel">
  199. <div class="modal-dialog" role="document">
  200. <div class="modal-content">
  201. <div class="modal-header row">
  202. <h4 class="modal-title col-12" id="arrnModalLabel" >
  203. {{ arrn.FirstName }} {{ arrn.MiddleName }} {{ arrn.LastName }}'s bio information
  204. </h4>
  205. {% set bdate = arrn.Birthdate|length > 0 ? arrn.Birthdate : 'Date Unknown' %}
  206. {% set ddate = arrn.Deathdate|length > 0 ? arrn.Deathdate : 'Date Unknown' %}
  207. <h5 class="col-12">{{ bdate }} - {{ ddate }}</h5>
  208. </div>
  209. <div class="authcomp modal-body"
  210. id="arrnModalBody">{{ (arrn.Notes ?? 'Sorry, we have no information for this arranger')|raw|nl2br }}</div>
  211. </div>
  212. </div>
  213. </div>
  214. </div>
  215. <hr/>
  216. {% if( hymn.OtherNotes is not null) %}
  217. <div class="row">
  218. <div class="col-md-3 text-right">Notes</div>
  219. <div class="col-md-9">{{ hymn.OtherNotes|raw|nl2br }}</div>
  220. </div>
  221. <hr/>
  222. {% endif %}
  223. <div class="row">
  224. <div class="col-md-3 text-right">Lyrics</div>
  225. <div class="col-md-9">{{ hymn.text|raw|nl2br }}</div>
  226. </div>
  227. <hr/>
  228. <div class="small text-center">
  229. <div>Uploaded on {{ hymn.createdAt|date("F jS, Y \\a\\t g:ia") }} and has {{ hymn.hymnHitCount }} views!</div>
  230. </div>
  231. </div>
  232. </article>
  233. <h3 class="card-header">Comments</h3>
  234. <div id="comments" class="card-body">
  235. {% for c in comments %}
  236. <blockquote class="mb-2">
  237. <p>{{ c.comment|raw }}</p>
  238. <footer>
  239. by {{ c.userName }} on {{ c.commentDate|date('m/d/Y h:m:s a') }}
  240. {% if is_granted('ROLE_ADMIN') %}
  241. <div class="float-right">
  242. <a href="mailto:{{ c.email }}?subject=Re:%20your%20comment%20on%20eHymns&body=Thank you for your comment on '{{ hymn.title }}'!">Reply</a>
  243. </div>
  244. {% endif %}
  245. </footer>
  246. </blockquote>
  247. {% else %}
  248. <div class="no-comments text-center">
  249. This hymn doesn't have any comments yet.<br/>You can be the first!
  250. </div>
  251. {% endfor %}
  252. {% if app.user %}
  253. {{ form_start(form) }}
  254. <input type="hidden" value="{{ app.user.id }}" name="user_id" id="user_id">
  255. {{ form_widget(form) }}
  256. <input type="submit"/>
  257. {{ form_end(form) }}
  258. {% else %}
  259. <div class="text-center">
  260. You must be
  261. <a href="{{ path('app_login') }}?go_to={{ app.request.server.get('REQUEST_SCHEME') }}://{{ app.request.host }}{{ path('hymnInfo', {'slug' : hymn.slug}) }}#comments">
  262. logged in</a> to comment. Otherwise, please <a href="{{ path('register') }}">register</a>.
  263. </div>
  264. {% endif %}
  265. </div>
  266. </div>
  267. {% endblock %}