Skip to content

Commit

Permalink
Merge pull request #46 from pilot/task-18
Browse files Browse the repository at this point in the history
Add speaker info box, #18
  • Loading branch information
pilot authored Jul 6, 2016
2 parents 9fba7a5 + 0f4f4c8 commit 26b96e1
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Event/EventBundle/Controller/EventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function speakersAction()
$form = $this->callForPaper();

return $this->render('EventEventBundle:Component:_speakers.html.twig', [
'currentEvent' => $this->getEvent(),
'speakers' => $this->getEvent()->getSpeakers(),
'form' => $form->createView(),
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
<div class="row">
{% for speaker in speakers %}
<div class="col-lg-2">
<a href="{{ speaker.homepage }}">
<a href="#speaker-modal-{{ speaker.id }}" role="button" data-toggle="modal">
<img class="img-circle" data-src="holder.js/140x140/text:{{ speaker.fullName }}" src="{{ speaker.photo ?: '' }}" width="140" />
</a>
<h3><a href="{{ speaker.homepage }}">{{ speaker.fullName }}</a></h3>
<h3><a href="#speaker-modal-{{ speaker.id }}" role="button" data-toggle="modal">{{ speaker.fullName }}</a></h3>
</div>
{% include 'EventEventBundle:Event:_speaker-modal.html.twig' %}
{% endfor %}
</div>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<div class="modal fade" id="speaker-modal-{{ speaker.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">{{ speaker.fullName }}</h4>
<small>{{ speaker.company ? speaker.company : '' }} {{ speaker.position ? '(' ~ speaker.position ~ ')' }}</small>
</div>
<div class="modal-body" id="speaker-info">
<div class="row">
<div class="col-sm-12 ta-center">
<img class="img-circle" data-src="holder.js/160x160/text:{{ speaker.fullName }}" src="{{ speaker.photo ?: '' }}" width="160" />
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-12">
<h4>Info</h4>
</div>
</div>
<div class="row">
<div class="col-sm-12">
{% if speaker.bio %}
<p>{{ speaker.bio }}</p>
{% endif %}
{% set social = [] %}

{% if speaker.github %}
{% set social = social|merge(['<a href="https://github.com/' ~ (speaker.github) ~ '">GitHub</a>']) %}
{% endif %}
{% if speaker.twitter %}
{% set social = social|merge(['<a href="https://twitter.com/' ~ (speaker.twitter) ~ '">Twitter</a>']) %}
{% endif %}
{% if speaker.homepage %}
{% set social = social|merge(['<a href="' ~ (speaker.homepage) ~ '">Homepage</a>']) %}
{% endif %}
<p>
{{ social|join(', ')|raw }}
</p>
</div>
</div>
<hr>
<div class="row">
<div class="col-sm-12">
<h4>Speech</h4>
</div>
</div>
<div class="row">
<div class="col-sm-12">
{% for speech in speaker.speeches %}
{% if currentEvent in speech.events %}
<p><strong>{{ speech.title }}</strong> <small>({{ speech.language }})</small></p>
<p>{{ speech.description }}</p>
{% endif %}
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</div>

0 comments on commit 26b96e1

Please sign in to comment.