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 @@ -
+
<%= label(f, :github_handle, "GitHub Handle") %> <%= text_input(f, :github_handle, placeholder: "gracehopper", autocapitalize: "none", mask: "slug") %> @@ -45,6 +45,12 @@ <%= text_input(f, :mastodon_handle, placeholder: "gracehopper@changelog.social", autocapitalize: "none", mask: "slug") %> <%= AdminHelpers.error_message(f, :mastodon_handle) %>
+ +
+ <%= label(f, :bsky_handle, "Bluesky Handle") %> + <%= text_input(f, :bsky_handle, placeholder: "gracehopper", autocapitalize: "none", mask: "slug") %> + <%= AdminHelpers.error_message(f, :bsky_handle) %> +
diff --git a/lib/changelog_web/templates/admin/podcast/_form.html.heex b/lib/changelog_web/templates/admin/podcast/_form.html.heex index 4efb7d6689..1674abac14 100644 --- a/lib/changelog_web/templates/admin/podcast/_form.html.heex +++ b/lib/changelog_web/templates/admin/podcast/_form.html.heex @@ -36,15 +36,22 @@ <%= AdminHelpers.error_message(f, :twitter_handle) %>
+
+ <%= label(f, :bsky_handle, "On Bluesky") %> + <%= text_input(f, :bsky_handle, placeholder: "changelog.com") %> +
+
+ +
<%= label(f, :mastodon_handle, "On Mastodon") %> <%= text_input(f, :mastodon_handle, placeholder: "changelog@changelog.social") %>
-
-
- <%= label(f, :mastodon_token, "Mastodon API Token") %> - <%= text_input(f, :mastodon_token) %> +
+ <%= label(f, :mastodon_token, "Mastodon API Token") %> + <%= text_input(f, :mastodon_token) %> +
diff --git a/lib/changelog_web/templates/home/profile.html.eex b/lib/changelog_web/templates/home/profile.html.heex similarity index 76% rename from lib/changelog_web/templates/home/profile.html.eex rename to lib/changelog_web/templates/home/profile.html.heex index 49938d4f44..74bf3fe569 100644 --- a/lib/changelog_web/templates/home/profile.html.eex +++ b/lib/changelog_web/templates/home/profile.html.heex @@ -15,13 +15,13 @@
-
+
<%= text_input(f, :name, placeholder: "Grace Hopper") %> <%= PublicHelpers.error_message(f, :name) %>
-
+
<%= text_input(f, :handle, placeholder: "gracehopper", autocapitalize: "none") %> <%= PublicHelpers.error_message(f, :handle) %> @@ -29,7 +29,7 @@
-
+
<%= file_input(f, :avatar) %> <%= PublicHelpers.error_message(f, :avatar) %> @@ -38,12 +38,12 @@
<%= SharedHelpers.maybe_lazy_image(@conn, PersonView.avatar_url(@changeset.data), @changeset.data.name, width: 67, height: 67) %> -

<%= 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" %>

-
-
+
+
github.com/ @@ -52,27 +52,38 @@ <%= PublicHelpers.error_message(f, :github_handle) %>
-
- +
+ +
+ linked.com/in/ + <%= text_input(f, :linkedin_handle, placeholder: "gracehopper", autocapitalize: "none") %> +
+ <%= PublicHelpers.error_message(f, :linkedin_handle) %> +
+
+ +
+
+
- twitter.com/ + x.com/ <%= text_input(f, :twitter_handle, placeholder: "gracehopper", autocapitalize: "none") %>
<%= PublicHelpers.error_message(f, :twitter_handle) %>
-
- +
+
- linked.com/in/ - <%= text_input(f, :linkedin_handle, placeholder: "gracehopper", autocapitalize: "none") %> + bsky.app/profile/ + <%= text_input(f, :bsky_handle, placeholder: "gracehopper", autocapitalize: "none") %>
- <%= PublicHelpers.error_message(f, :linkedin_handle) %> + <%= PublicHelpers.error_message(f, :bsky_handle) %>
-
+
@ @@ -81,13 +92,13 @@ <%= PublicHelpers.error_message(f, :mastodon_handle) %>
-
+
<%= text_input(f, :location, placeholder: "New York, New York") %> <%= PublicHelpers.error_message(f, :location) %>
-
+
<%= text_input(f, :website, placeholder: "https://gracehopper.com", autocapitalize: "none") %> <%= PublicHelpers.error_message(f, :website) %> @@ -95,7 +106,7 @@
-
+
<%= textarea(f, :bio) %> <%= PublicHelpers.error_message(f, :bio) %> @@ -104,7 +115,7 @@
-
+
<%= if Changelog.Policies.Person.profile(@current_user, @current_user) do %>