{{ row.speaker.label }} diff --git a/db/migrations/20250127123553_speaker_bluesky.php b/db/migrations/20250127123553_speaker_bluesky.php new file mode 100644 index 000000000..dedafe617 --- /dev/null +++ b/db/migrations/20250127123553_speaker_bluesky.php @@ -0,0 +1,12 @@ +query("ALTER TABLE afup_conferenciers ADD bluesky varchar(255) DEFAULT NULL AFTER mastodon"); + } +} diff --git a/db/seeds/Conferenciers.php b/db/seeds/Conferenciers.php index 07d585e3a..af2d3c8ae 100644 --- a/db/seeds/Conferenciers.php +++ b/db/seeds/Conferenciers.php @@ -21,6 +21,7 @@ public function run() 'biographie' => 'Président 2018-2019 de l\'AFUP', 'twitter' => 'ubermuda', 'mastodon' => 'https://phpc.social/@ubermuda', + 'bluesky' => 'afup.org', 'user_github' => GithubUsers::ID_GITHUBUSER_UBERMUDA, 'photo' => '1968.jpg', 'will_attend_speakers_diner' => null, @@ -40,6 +41,7 @@ public function run() 'biographie' => 'Bio Adrien', 'twitter' => 'agallou', 'mastodon' => 'https://phpc.social/@agallou', + 'bluesky' => 'lyon.afup.org', 'user_github' => 2, 'photo' => '1968.jpg', 'will_attend_speakers_diner' => null, @@ -57,4 +59,4 @@ public function run() ->save() ; } -} \ No newline at end of file +} diff --git a/sources/AppBundle/Controller/Admin/Speaker/SpeakerEditAction.php b/sources/AppBundle/Controller/Admin/Speaker/SpeakerEditAction.php index 58f90d083..68406ac1a 100644 --- a/sources/AppBundle/Controller/Admin/Speaker/SpeakerEditAction.php +++ b/sources/AppBundle/Controller/Admin/Speaker/SpeakerEditAction.php @@ -104,6 +104,7 @@ public function __invoke(Request $request) $speaker->setLastname($data->lastname); $speaker->setBiography($data->biography); $speaker->setTwitter($data->twitter); + $speaker->setBluesky($data->bluesky); $speaker->setMastodon($data->mastodon); $speaker->setEmail($data->email); $speaker->setUser($data->githubUser !== null ? $data->githubUser->getId() : null); diff --git a/sources/AppBundle/Event/Form/SpeakerFormData.php b/sources/AppBundle/Event/Form/SpeakerFormData.php index 44862c966..5a6e17728 100644 --- a/sources/AppBundle/Event/Form/SpeakerFormData.php +++ b/sources/AppBundle/Event/Form/SpeakerFormData.php @@ -50,6 +50,9 @@ class SpeakerFormData * @var string */ public $mastodon; + + public ?string $bluesky = null; + /** * @Assert\File(mimeTypes={"image/jpeg","image/png"}) * @var UploadedFile|null diff --git a/sources/AppBundle/Event/Form/SpeakerFormDataFactory.php b/sources/AppBundle/Event/Form/SpeakerFormDataFactory.php index f5754da0f..ef2e9d026 100644 --- a/sources/AppBundle/Event/Form/SpeakerFormDataFactory.php +++ b/sources/AppBundle/Event/Form/SpeakerFormDataFactory.php @@ -6,7 +6,7 @@ class SpeakerFormDataFactory { - public function fromSpeaker(Speaker $speaker) + public function fromSpeaker(Speaker $speaker): SpeakerFormData { $data = new SpeakerFormData(); $data->civility = $speaker->getCivility(); @@ -18,12 +18,12 @@ public function fromSpeaker(Speaker $speaker) $data->biography = $speaker->getBiography(); $data->twitter = $speaker->getTwitter(); $data->mastodon = $speaker->getMastodon(); + $data->bluesky = $speaker->getBluesky(); $data->githubUser = $speaker->getUser(); $data->phoneNumber = $speaker->getPhoneNumber(); $data->referentPerson = $speaker->getReferentPerson(); $data->referentPersonEmail = $speaker->getReferentPersonEmail(); - return $data; } } diff --git a/sources/AppBundle/Event/Form/SpeakerType.php b/sources/AppBundle/Event/Form/SpeakerType.php index e90dde814..6934c2b25 100644 --- a/sources/AppBundle/Event/Form/SpeakerType.php +++ b/sources/AppBundle/Event/Form/SpeakerType.php @@ -55,6 +55,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void ->add('biography', TextareaType::class) ->add('twitter', TextType::class, ['required' => false]) ->add('mastodon', UrlType::class, ['required' => false, 'help' => 'Exemple https://mastodon.online/@afup', 'default_protocol' => 'https']) + ->add('bluesky', TextType::class, ['required' => false, 'help' => 'Exemple acme.bsky.social']) ; if (true === $options[self::OPT_USER_GITHUB]) { @@ -104,6 +105,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void $speaker->setBiography($previousSpeakerInfos->getBiography()); $speaker->setTwitter($previousSpeakerInfos->getTwitter()); $speaker->setMastodon($previousSpeakerInfos->getMastodon()); + $speaker->setBluesky($previousSpeakerInfos->getBluesky()); $speaker->setPhoto($previousSpeakerInfos->getPhoto()); $formEvent->getForm()->add('isFromPreviousEvent', HiddenType::class, ['mapped' => false]); diff --git a/sources/AppBundle/Event/Model/Repository/SpeakerRepository.php b/sources/AppBundle/Event/Model/Repository/SpeakerRepository.php index 540141325..0d30cbe8b 100644 --- a/sources/AppBundle/Event/Model/Repository/SpeakerRepository.php +++ b/sources/AppBundle/Event/Model/Repository/SpeakerRepository.php @@ -54,7 +54,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.mastodon, speaker.user_github, speaker.photo, talk.titre, talk.session_id, + speaker.biographie, speaker.twitter, speaker.mastodon, speaker.bluesky, speaker.user_github, speaker.photo, talk.titre, talk.session_id, speaker.will_attend_speakers_diner, speaker.has_special_diet, speaker.referent_person, @@ -255,6 +255,11 @@ public static function initMetadata(SerializerFactoryInterface $serializerFactor 'fieldName' => 'mastodon', 'type' => 'string' ]) + ->addField([ + 'columnName' => 'bluesky', + 'fieldName' => 'bluesky', + 'type' => 'string' + ]) ->addField([ 'columnName' => 'user_github', 'fieldName' => 'user', diff --git a/sources/AppBundle/Event/Model/Speaker.php b/sources/AppBundle/Event/Model/Speaker.php index ca50c8378..7e63dbd00 100644 --- a/sources/AppBundle/Event/Model/Speaker.php +++ b/sources/AppBundle/Event/Model/Speaker.php @@ -86,6 +86,8 @@ class Speaker implements NotifyPropertyInterface */ private $mastodon; + private ?string $bluesky = null; + /** * @var GithubUser */ @@ -402,6 +404,20 @@ public function getMastodon(): string return (string) $this->mastodon; } + public function getBluesky(): ?string + { + return $this->bluesky; + } + + public function getUrlBluesky(): ?string + { + if ($this->bluesky === null) { + return null; + } + + return 'https://bsky.app/profile/' . $this->bluesky; + } + public function getUsernameTwitter(): string { $twitter = $this->getTwitter(); @@ -473,6 +489,17 @@ public function setMastodon($mastodon) return $this; } + public function setBluesky(?string $bluesky): self + { + if ($bluesky !== null) { + $bluesky = str_replace('https://bsky.app/profile/', '', $bluesky); + } + + $this->propertyChanged('bluesky', $this->bluesky, $bluesky); + $this->bluesky = $bluesky; + return $this; + } + /** * @return GithubUser */