-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Rename published to publishing - Change retired to inactive, add archived - Show inactive on /podcasts and in footer
- Loading branch information
1 parent
d378172
commit a328b8d
Showing
20 changed files
with
107 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ defmodule Changelog.Podcast do | |
|
||
require Logger | ||
|
||
defenum(Status, draft: 0, soon: 1, published: 2, retired: 3) | ||
defenum(Status, draft: 0, soon: 1, publishing: 2, inactive: 3, archived: 4) | ||
|
||
schema "podcasts" do | ||
field :name, :string | ||
|
@@ -70,7 +70,7 @@ defmodule Changelog.Podcast do | |
%__MODULE__{ | ||
name: "Changelog Master Feed", | ||
slug: "master", | ||
status: :published, | ||
status: :publishing, | ||
is_meta: true, | ||
twitter_handle: "changelog", | ||
mastodon_handle: "[email protected]", | ||
|
@@ -91,7 +91,7 @@ defmodule Changelog.Podcast do | |
%__MODULE__{ | ||
name: "The Changelog", | ||
slug: "podcast", | ||
status: :published, | ||
status: :publishing, | ||
is_meta: true, | ||
vanity_domain: "https://changelog.fm", | ||
twitter_handle: "changelog", | ||
|
@@ -135,20 +135,19 @@ defmodule Changelog.Podcast do | |
|> file_changeset(attrs) | ||
end | ||
|
||
def active(query \\ __MODULE__), do: from(q in query, where: q.status in [^:soon, ^:published]) | ||
def draft(query \\ __MODULE__), do: from(q in query, where: q.status == ^:draft) | ||
def private(query \\ __MODULE__), do: from(q in query, where: q.status in [^:draft, ^:archived]) | ||
|
||
def public(query \\ __MODULE__), do: from(q in query, where: q.status in [^:soon, ^:publishing, ^:inactive]) | ||
def active(query \\ __MODULE__), do: from(q in query, where: q.status in [^:soon, ^:publishing]) | ||
def inactive(query \\ __MODULE__), do: from(q in query, where: q.status == ^:inactive) | ||
|
||
def public(query \\ __MODULE__), | ||
do: from(q in query, where: q.status in [^:soon, ^:published, ^:retired]) | ||
def draft(query \\ __MODULE__), do: from(q in query, where: q.status == ^:draft) | ||
def archived(query \\ __MODULE__), do: from(q in query, where: q.status == ^:archived) | ||
|
||
def retired(query \\ __MODULE__), do: from(q in query, where: q.status == ^:retired) | ||
def not_retired(query \\ __MODULE__), do: from(q in query, where: q.status != ^:retired) | ||
def oldest_first(query \\ __MODULE__), do: from(q in query, order_by: [asc: q.id]) | ||
def retired_last(query \\ __MODULE__), do: from(q in query, order_by: [asc: q.status]) | ||
|
||
def with_vanity_domain(query \\ __MODULE__), do: from(q in query, where: not is_nil(q.vanity_domain)) | ||
|
||
|
||
def get_by_slug!("interviews"), do: get_by_slug!("podcast") | ||
def get_by_slug!("master"), do: master() | ||
|
||
|
@@ -198,6 +197,10 @@ defmodule Changelog.Podcast do | |
|
||
def is_master(podcast), do: podcast.slug == "master" | ||
|
||
def is_active(podcast), do: Enum.member?([:soon, :publishing], podcast.status) | ||
|
||
def is_publishing(podcast), do: podcast.status == :publishing | ||
|
||
def published_episode_count(%{slug: "master"}), do: Repo.count(Episode.published()) | ||
|
||
def published_episode_count(podcast) do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
lib/changelog_web/templates/podcast/_index_active.html.eex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<section class="show_list"> | ||
<header class="show_list-header"> | ||
<h2>Changelog makes great podcasts for developers</h2> | ||
<p><%= link("The Changelog", to: "/podcast", title: "The Changelog") %> podcast is the software world's best weekly <%= link("news brief", to: "/news") %> (Mondays), deep <%= link("technical interviews", to: "/interviews") %> (Wednesdays) and <%= link("talk show", to: "/friends") %> (Fridays) that's like putting the hallway track at your favorite tech conference on repeat.</p> | ||
<p class="show_list-header-master_cta"><a href="/subscribe/news"><strong>Subscribe to the Changelog News(letter)!</strong> We keep it brief, entertaining & always on-point.</a></p> | ||
<p>But that's not all! We produce other great shows about web development, open source, building startups, AI & the human brain.</p> | ||
</header> | ||
<div class="show_list-shows"> | ||
<%= render_many(active_podcasts_for_index(@podcasts), __MODULE__, "_summary.html", assigns) %> | ||
</div> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<section class="show_list"> | ||
<header class="show_list-header"> | ||
<h2>More great podcasts that are not currently in production</h2> | ||
</header> | ||
<div class="show_list-shows"> | ||
<%= render_many(inactive_podcasts_for_index(@podcasts), __MODULE__, "_summary.html", assigns) %> | ||
</div> | ||
</section> |
2 changes: 1 addition & 1 deletion
2
lib/changelog_web/templates/podcast/_subscribe_buttons.html.eex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,4 @@ | ||
<div class="page_podcasts"> | ||
<section class="show_list"> | ||
<header class="show_list-header"> | ||
<h2>Changelog makes great podcasts for developers</h2> | ||
<p><%= link("The Changelog", to: "/podcast", title: "The Changelog") %> podcast is the software world's best weekly <%= link("news brief", to: "/news") %> (Mondays), deep <%= link("technical interviews", to: "/interviews") %> (Wednesdays) and <%= link("talk show", to: "/friends") %> (Fridays) that's like putting the hallway track at your favorite tech conference on repeat.</p> | ||
<p class="show_list-header-master_cta"><a href="/subscribe/news"><strong>Subscribe to the Changelog News(letter)!</strong> We keep it brief, entertaining & always on-point.</a></p> | ||
<p>But that's not all! We produce other great shows about web development, open source, building startups, AI & the human brain.</p> | ||
</header> | ||
<div class="show_list-shows"> | ||
<%= render_many(podcasts_for_index(@podcasts), __MODULE__, "_summary.html", assigns) %> | ||
</div> | ||
</section> | ||
<%= render("_index_active.html", assigns) %> | ||
<%= render("_index_inactive.html", assigns) %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters