Skip to content

Commit 0bcc926

Browse files
authored
Merge pull request #52 from pilot/task-19
Add speech info box, #19, Add sponsor info box, #20
2 parents b0e76d9 + 8dda1df commit 0bcc926

File tree

5 files changed

+90
-4
lines changed

5 files changed

+90
-4
lines changed

src/Event/EventBundle/Entity/Repository/EventRepository.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ public function getProgram($host)
2424
$qb = $this->createQueryBuilder('e');
2525

2626
return $qb
27-
->select('p.startDate, p.link, p.endDate, p.title, s.language as speech_language, s.title as speech_title, sp.homepage as speaker_homepage, sp.firstName as speaker_firsName, sp.lastName as speaker_lastName, sp.id as speaker_id, ' . $qb->expr()->concat($qb->expr()->concat('sp.firstName', $qb->expr()->literal(' ')), 'sp.lastName') . ' as speaker_fullName')
27+
->select(
28+
'p.startDate, p.link, p.endDate, p.title,
29+
s.id as speech_id, s.language as speech_language, s.title as speech_title, s.description as speech_description,
30+
sp.firstName as speaker_firsName, sp.lastName as speaker_lastName, sp.id as speaker_id, sp.photo as speaker_photo,
31+
sp.company as speaker_company, sp.position as speaker_position, sp.homepage as speaker_homepage,
32+
'.$qb->expr()->concat($qb->expr()->concat('sp.firstName', $qb->expr()->literal(' ')), 'sp.lastName').' as speaker_fullName'
33+
)
2834
->leftJoin('e.program', 'p')
2935
->leftJoin('p.speech', 's')
3036
->leftJoin('s.speaker', 'sp')

src/Event/EventBundle/Resources/views/Component/_schedule.html.twig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@
2323
{% endif %}
2424
{% else %}
2525
<small>{{ entry.speech_language|default('en'|trans) }}:&nbsp;</small>
26-
{{ entry.speech_title }}
26+
<a href="#speech-{{ entry.speech_id }}" role="button" data-toggle="modal">
27+
{{ entry.speech_title }}
28+
</a>
2729
<br />
2830
<span class="speech-speaker">
2931
<a href="#{{ entry.speaker_firsName }}-{{ entry.speaker_lastName }}-{{ entry.speaker_id }}" role="button" data-toggle="modal">{{ entry.speaker_fullName }}</a></span>
3032
{% endif %}
33+
{% include 'EventEventBundle:Event:_speech-modal.html.twig' %}
3134
</td>
3235
</tr>
3336
{% set date = entry.startDate|date('d') %}

src/Event/EventBundle/Resources/views/Component/_sponsors.html.twig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
<div class="row">
33
{% for sponsor in sponsors %}
44
<div class="col-lg-2 ta-center">
5-
<a href="{{ sponsor.homepage }}">
5+
<a href="#company-{{ sponsor.id }}" role="button" data-toggle="modal">
66
<span id="face-wrapper">
77
<img class="img-circle face" data-src="holder.js/140x140/text:{{ sponsor.company }}" src="{{ sponsor.logo ?: '' }}" height="140" width="140" />
88
</span>
99
</a>
10-
<h2><a href="{{ sponsor.homepage }}">{{ sponsor.company }}</a></h2>
10+
<h2><a href="#company-{{ sponsor.id }}" role="button" data-toggle="modal">{{ sponsor.company }}</a></h2>
1111
</div>
12+
{% include 'EventEventBundle:Event:_sponsor-modal.html.twig' %}
1213
{% endfor %}
1314
</div>
1415
{% endmacro %}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<div class="modal fade" id="speech-{{ entry.speech_id }}">
2+
<div class="modal-dialog">
3+
<div class="modal-content">
4+
<div class="modal-header">
5+
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
6+
<h4 class="modal-title">{{ entry.speech_title }}&nbsp;<small>({{ entry.speech_language|default('en'|trans) }})</small></h4>
7+
</div>
8+
<div class="modal-body" id="speaker-info">
9+
<div class="row">
10+
<div class="col-sm-12">
11+
<h4>Description</h4>
12+
</div>
13+
</div>
14+
<div class="row">
15+
<div class="col-sm-12">
16+
<p>{{ entry.speech_description ? entry.speech_description : entry.speech_title }}</p>
17+
</div>
18+
</div>
19+
<hr>
20+
<div class="row">
21+
<div class="col-sm-12">
22+
<h4>Speaker</h4>
23+
</div>
24+
</div>
25+
<div class="row">
26+
<div class="col-sm-3 text-left">
27+
<img class="img-circle" data-src="holder.js/160x160/text:{{ entry.speaker_fullName }}" src="{{ entry.speaker_photo ?: '' }}" width="100" />
28+
</div>
29+
<div class="col-sm-9 text-left">
30+
<a href="{{ entry.speaker_homepage }}">{{ entry.speaker_fullName }}</a>
31+
<p><small>{{ entry.speaker_company }}&nbsp;({{ entry.speaker_position }})</small></p>
32+
</div>
33+
</div>
34+
</div>
35+
</div>
36+
</div>
37+
</div>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<div class="modal fade" id="company-{{ sponsor.id }}">
2+
<div class="modal-dialog">
3+
<div class="modal-content">
4+
<div class="modal-header">
5+
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
6+
<h4 class="modal-title">
7+
{{ sponsor.company }}
8+
</h4>
9+
{% if sponsor.homepage %}
10+
<small><a href="{{ sponsor.homepage }}">{{ sponsor.homepage }}</a></small>
11+
{% endif %}
12+
</div>
13+
<div class="modal-body" id="speaker-info">
14+
<div class="row">
15+
<div class="col-sm-12 ta-center">
16+
<a href="{{ sponsor.homepage }}">
17+
<span id="face-wrapper">
18+
<img class="img-circle face" data-src="holder.js/160x160/text:{{ sponsor.company }}" src="{{ sponsor.logo ?: '' }}" height="160" width="160" />
19+
</span>
20+
</a>
21+
</div>
22+
</div>
23+
{% if sponsor.description %}
24+
<hr>
25+
<div class="row">
26+
<div class="col-sm-12">
27+
<h4>Description</h4>
28+
</div>
29+
</div>
30+
<div class="row">
31+
<div class="col-sm-12">
32+
<p>{{ sponsor.description|nl2br|raw }}</p>
33+
</div>
34+
</div>
35+
{% endif %}
36+
</div>
37+
</div>
38+
</div>
39+
</div>

0 commit comments

Comments
 (0)