diff --git a/assets/app/layout/show.scss b/assets/app/layout/show.scss index 1b795bb30d..65680cdafe 100644 --- a/assets/app/layout/show.scss +++ b/assets/app/layout/show.scss @@ -296,8 +296,11 @@ &--mastodon { background-image: url("../images/icons/podcast_icon-mastodon.png"); } - &--twitter { - background-image: url("../images/icons/podcast_icon-twitter.png"); + &--bsky { + background-image: url("../images/icons/podcast_icon-bsky.png"); + } + &--x { + background-image: url("../images/icons/podcast_icon-x.png"); } } } diff --git a/assets/static/images/icons/icon-bsky-black.svg b/assets/static/images/icons/icon-bsky-black.svg new file mode 100644 index 0000000000..aac10ab3c4 --- /dev/null +++ b/assets/static/images/icons/icon-bsky-black.svg @@ -0,0 +1,4 @@ + + diff --git a/assets/static/images/icons/icon-bsky.svg b/assets/static/images/icons/icon-bsky.svg new file mode 100644 index 0000000000..0e0702c776 --- /dev/null +++ b/assets/static/images/icons/icon-bsky.svg @@ -0,0 +1,7 @@ + + diff --git a/assets/static/images/icons/icon-x-black.svg b/assets/static/images/icons/icon-x-black.svg new file mode 100644 index 0000000000..1e694a9ab1 --- /dev/null +++ b/assets/static/images/icons/icon-x-black.svg @@ -0,0 +1,12 @@ + diff --git a/assets/static/images/icons/icon-x.svg b/assets/static/images/icons/icon-x.svg new file mode 100644 index 0000000000..c0b2d810bf --- /dev/null +++ b/assets/static/images/icons/icon-x.svg @@ -0,0 +1,12 @@ + diff --git a/assets/static/images/icons/podcast_icon-bsky.png b/assets/static/images/icons/podcast_icon-bsky.png new file mode 100644 index 0000000000..1828919493 Binary files /dev/null and b/assets/static/images/icons/podcast_icon-bsky.png differ diff --git a/assets/static/images/icons/podcast_icon-x.png b/assets/static/images/icons/podcast_icon-x.png new file mode 100644 index 0000000000..4fb3a6b2d5 Binary files /dev/null and b/assets/static/images/icons/podcast_icon-x.png differ diff --git a/lib/changelog/schema/person.ex b/lib/changelog/schema/person.ex index c3b2f9e8ad..946dba47fa 100644 --- a/lib/changelog/schema/person.ex +++ b/lib/changelog/schema/person.ex @@ -54,6 +54,7 @@ defmodule Changelog.Person do field :linkedin_handle, :string field :mastodon_handle, :string field :twitter_handle, :string + field :bsky_handle, :string field :slack_id, :string field :zulip_id, :string field :website, :string @@ -215,7 +216,7 @@ defmodule Changelog.Person do def admin_insert_changeset(person, attrs \\ %{}) do allowed = ~w(name email handle github_handle linkedin_handle mastodon_handle - twitter_handle bio website location admin host editor + twitter_handle bsky_handle bio website location admin host editor public_profile approved)a changeset_with_allowed_attrs(person, attrs, allowed) @@ -232,7 +233,7 @@ defmodule Changelog.Person do def insert_changeset(person, attrs \\ %{}) do allowed = ~w(name email handle github_handle linkedin_handle mastodon_handle - twitter_handle bio website location public_profile)a + twitter_handle bsky_handle bio website location public_profile)a changeset_with_allowed_attrs(person, attrs, allowed) end @@ -271,6 +272,7 @@ defmodule Changelog.Person do |> unique_constraint(:linkedin_handle) |> unique_constraint(:mastodon_handle) |> unique_constraint(:twitter_handle) + |> unique_constraint(:bsky_handle) end defp validate_handle_allowed(changeset) do diff --git a/lib/changelog/schema/podcast/podcast.ex b/lib/changelog/schema/podcast/podcast.ex index cb60917bd0..925f9e86cb 100644 --- a/lib/changelog/schema/podcast/podcast.ex +++ b/lib/changelog/schema/podcast/podcast.ex @@ -35,6 +35,7 @@ defmodule Changelog.Podcast do field :mastodon_handle, :string field :mastodon_token, :string field :twitter_handle, :string + field :bsky_handle, :string field :apple_url, :string field :spotify_url, :string field :riverside_url, :string @@ -79,6 +80,7 @@ defmodule Changelog.Podcast do status: :publishing, is_meta: true, twitter_handle: "changelog", + bsky_handle: "changelog.com", mastodon_handle: "changelog@changelog.social", mastodon_token: nil, welcome: "Your one-stop shop for all Changelog podcasts", @@ -105,6 +107,7 @@ defmodule Changelog.Podcast do is_meta: true, vanity_domain: "https://changelog.fm", twitter_handle: "changelog", + bsky_handle: "changelog.com", mastodon_handle: "changelog@changelog.social", mastodon_token: nil, welcome: "Software's best weekly news brief, deep technical interviews & talk show", @@ -147,7 +150,7 @@ defmodule Changelog.Podcast do podcast |> cast( attrs, - ~w(name slug status vanity_domain schedule_note welcome description extended_description keywords mastodon_handle mastodon_token twitter_handle apple_url spotify_url riverside_url youtube_url clips_url zulip_url recorded_live partner position)a + ~w(name slug status vanity_domain schedule_note welcome description extended_description keywords mastodon_handle mastodon_token twitter_handle bsky_handle apple_url spotify_url riverside_url youtube_url clips_url zulip_url recorded_live partner position)a ) |> validate_required([:name, :slug, :status]) |> validate_format(:vanity_domain, Regexp.http(), message: Regexp.http_message()) diff --git a/lib/changelog_web/helpers/shared_helpers.ex b/lib/changelog_web/helpers/shared_helpers.ex index cab60dff6e..7f02a0949f 100644 --- a/lib/changelog_web/helpers/shared_helpers.ex +++ b/lib/changelog_web/helpers/shared_helpers.ex @@ -28,6 +28,11 @@ defmodule ChangelogWeb.Helpers.SharedHelpers do def action_name(conn), do: Controller.action_name(conn) + def bsky_url(nil), do: "" + def bsky_url(%{bsky_handle: nil}), do: "" + def bsky_url(%{bsky_handle: handle}), do: bsky_url(handle) + def bsky_url(handle), do: "https://bsky.app/profile/#{handle}" + def comma_separated(number) do number |> Integer.to_charlist() @@ -201,6 +206,11 @@ defmodule ChangelogWeb.Helpers.SharedHelpers do end end + def x_url(nil), do: "" + def x_url(%{twitter_handle: nil}), do: "" + def x_url(%{twitter_handle: handle}), do: x_url(handle) + def x_url(handle) when is_binary(handle), do: "https://x.com/#{handle}" + def word_count(nil), do: 0 def word_count(text) when is_binary(text) do diff --git a/lib/changelog_web/templates/admin/person/_form.html.eex b/lib/changelog_web/templates/admin/person/_form.html.eex index bb6dcc05b2..cdd2efa920 100644 --- a/lib/changelog_web/templates/admin/person/_form.html.eex +++ b/lib/changelog_web/templates/admin/person/_form.html.eex @@ -27,7 +27,7 @@ -
<%= if @changeset.data.avatar, do: "This image was uploaded to changelog.com", else: "This image is loaded from Gravatar" %> +
<%= if @changeset.data.avatar, do: "This image was uploaded to changelog.com", else: "This image is loaded from Gravatar" %>