Skip to content

Commit

Permalink
Merge pull request #52 from pilot/task-19
Browse files Browse the repository at this point in the history
Add speech info box, #19, Add sponsor info box, #20
  • Loading branch information
pilot authored Aug 6, 2016
2 parents b0e76d9 + 8dda1df commit 0bcc926
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/Event/EventBundle/Entity/Repository/EventRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ public function getProgram($host)
$qb = $this->createQueryBuilder('e');

return $qb
->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')
->select(
'p.startDate, p.link, p.endDate, p.title,
s.id as speech_id, s.language as speech_language, s.title as speech_title, s.description as speech_description,
sp.firstName as speaker_firsName, sp.lastName as speaker_lastName, sp.id as speaker_id, sp.photo as speaker_photo,
sp.company as speaker_company, sp.position as speaker_position, sp.homepage as speaker_homepage,
'.$qb->expr()->concat($qb->expr()->concat('sp.firstName', $qb->expr()->literal(' ')), 'sp.lastName').' as speaker_fullName'
)
->leftJoin('e.program', 'p')
->leftJoin('p.speech', 's')
->leftJoin('s.speaker', 'sp')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@
{% endif %}
{% else %}
<small>{{ entry.speech_language|default('en'|trans) }}:&nbsp;</small>
{{ entry.speech_title }}
<a href="#speech-{{ entry.speech_id }}" role="button" data-toggle="modal">
{{ entry.speech_title }}
</a>
<br />
<span class="speech-speaker">
<a href="#{{ entry.speaker_firsName }}-{{ entry.speaker_lastName }}-{{ entry.speaker_id }}" role="button" data-toggle="modal">{{ entry.speaker_fullName }}</a></span>
{% endif %}
{% include 'EventEventBundle:Event:_speech-modal.html.twig' %}
</td>
</tr>
{% set date = entry.startDate|date('d') %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
<div class="row">
{% for sponsor in sponsors %}
<div class="col-lg-2 ta-center">
<a href="{{ sponsor.homepage }}">
<a href="#company-{{ sponsor.id }}" role="button" data-toggle="modal">
<span id="face-wrapper">
<img class="img-circle face" data-src="holder.js/140x140/text:{{ sponsor.company }}" src="{{ sponsor.logo ?: '' }}" height="140" width="140" />
</span>
</a>
<h2><a href="{{ sponsor.homepage }}">{{ sponsor.company }}</a></h2>
<h2><a href="#company-{{ sponsor.id }}" role="button" data-toggle="modal">{{ sponsor.company }}</a></h2>
</div>
{% include 'EventEventBundle:Event:_sponsor-modal.html.twig' %}
{% endfor %}
</div>
{% endmacro %}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<div class="modal fade" id="speech-{{ entry.speech_id }}">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">{{ entry.speech_title }}&nbsp;<small>({{ entry.speech_language|default('en'|trans) }})</small></h4>
</div>
<div class="modal-body" id="speaker-info">
<div class="row">
<div class="col-sm-12">
<h4>Description</h4>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<p>{{ entry.speech_description ? entry.speech_description : entry.speech_title }}</p>
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-12">
<h4>Speaker</h4>
</div>
</div>
<div class="row">
<div class="col-sm-3 text-left">
<img class="img-circle" data-src="holder.js/160x160/text:{{ entry.speaker_fullName }}" src="{{ entry.speaker_photo ?: '' }}" width="100" />
</div>
<div class="col-sm-9 text-left">
<a href="{{ entry.speaker_homepage }}">{{ entry.speaker_fullName }}</a>
<p><small>{{ entry.speaker_company }}&nbsp;({{ entry.speaker_position }})</small></p>
</div>
</div>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<div class="modal fade" id="company-{{ sponsor.id }}">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">
{{ sponsor.company }}
</h4>
{% if sponsor.homepage %}
<small><a href="{{ sponsor.homepage }}">{{ sponsor.homepage }}</a></small>
{% endif %}
</div>
<div class="modal-body" id="speaker-info">
<div class="row">
<div class="col-sm-12 ta-center">
<a href="{{ sponsor.homepage }}">
<span id="face-wrapper">
<img class="img-circle face" data-src="holder.js/160x160/text:{{ sponsor.company }}" src="{{ sponsor.logo ?: '' }}" height="160" width="160" />
</span>
</a>
</div>
</div>
{% if sponsor.description %}
<hr>
<div class="row">
<div class="col-sm-12">
<h4>Description</h4>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<p>{{ sponsor.description|nl2br|raw }}</p>
</div>
</div>
{% endif %}
</div>
</div>
</div>
</div>

0 comments on commit 0bcc926

Please sign in to comment.