diff --git a/app/Resources/views/blog/speakers.html.twig b/app/Resources/views/blog/speakers.html.twig
index 7fac91068..a200b9f51 100644
--- a/app/Resources/views/blog/speakers.html.twig
+++ b/app/Resources/views/blog/speakers.html.twig
@@ -7,13 +7,26 @@
{{ row.speaker.label }}
- {% if row.speaker.company %}- {{ row.speaker.company }}{% endif %}
+ {% if row.speaker.company %}{{ row.speaker.company }}{% endif %}
{% if row.speaker.twitter %}
-
+ {% endif %}
+ {% if row.speaker.getCleanedMastodon %}
+
+
+ Suivre @{{ row.speaker.getCleanedMastodon }}
{% endif %}
@@ -34,7 +47,6 @@
{% endfor %}
-
{% else %}
Le programme n'est pas encore dévoilé, il le sera sous peu. Revenez bientôt.
{% endif %}
diff --git a/db/seeds/Conferenciers.php b/db/seeds/Conferenciers.php
index 4ed1d3e4b..07d585e3a 100644
--- a/db/seeds/Conferenciers.php
+++ b/db/seeds/Conferenciers.php
@@ -20,6 +20,7 @@ public function run()
'ville' => 'Paris',
'biographie' => 'Président 2018-2019 de l\'AFUP',
'twitter' => 'ubermuda',
+ 'mastodon' => 'https://phpc.social/@ubermuda',
'user_github' => GithubUsers::ID_GITHUBUSER_UBERMUDA,
'photo' => '1968.jpg',
'will_attend_speakers_diner' => null,
@@ -38,6 +39,7 @@ public function run()
'ville' => 'Paris',
'biographie' => 'Bio Adrien',
'twitter' => 'agallou',
+ 'mastodon' => 'https://phpc.social/@agallou',
'user_github' => 2,
'photo' => '1968.jpg',
'will_attend_speakers_diner' => null,
diff --git a/sources/AppBundle/Event/Model/Repository/SpeakerRepository.php b/sources/AppBundle/Event/Model/Repository/SpeakerRepository.php
index 1fb33bd1e..807768342 100644
--- a/sources/AppBundle/Event/Model/Repository/SpeakerRepository.php
+++ b/sources/AppBundle/Event/Model/Repository/SpeakerRepository.php
@@ -50,7 +50,7 @@ public function getScheduledSpeakersByEvent(Event $event, $returnTalksThatWillBe
}
$query = $this->getPreparedQuery('SELECT speaker.conferencier_id, speaker.id_forum, speaker.civilite, speaker.nom, speaker.prenom, speaker.email, speaker.societe,
- speaker.biographie, speaker.twitter, speaker.user_github, speaker.photo, talk.titre, talk.session_id,
+ speaker.biographie, speaker.twitter, speaker.mastodon, speaker.user_github, speaker.photo, talk.titre, talk.session_id,
speaker.will_attend_speakers_diner,
speaker.has_special_diet,
speaker.referent_person,
diff --git a/sources/AppBundle/Event/Model/Speaker.php b/sources/AppBundle/Event/Model/Speaker.php
index 30fb21b43..756b8e9ca 100644
--- a/sources/AppBundle/Event/Model/Speaker.php
+++ b/sources/AppBundle/Event/Model/Speaker.php
@@ -421,6 +421,20 @@ public function getCleanedTwitter()
return $twitter;
}
+ public function getCleanedMastodon(): string
+ {
+ if (!strpos('@', $this->getMastodon())) {
+ return '';
+ }
+ list(,$username) = explode('@', $this->getMastodon());
+
+ if (trim($username) === '') {
+ return '';
+ }
+
+ return $username;
+ }
+
/**
* @param string $twitter
* @return Speaker