Skip to content

Commit

Permalink
Migrate a few calls to Routes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jerodsanto committed Sep 17, 2024
1 parent 85fbe3f commit 543f4b7
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/changelog_web/controllers/admin/podcast_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ defmodule ChangelogWeb.Admin.PodcastController do

conn
|> put_flash(:result, "success")
|> redirect(to: Routes.admin_podcast_path(conn, :index))
|> redirect(to: ~p"/admin/podcasts")
end

def agents(conn = %{assigns: %{podcast: podcast}}, params) do
Expand Down
2 changes: 1 addition & 1 deletion lib/changelog_web/templates/auth/create.html.eex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<article class="auth">
<h1 class="auth-header">Signing In...</h1>

<%= form_for @conn, Routes.sign_in_path(@conn, :create, @token), [id: "in", class: "form form--full_width"], fn _f -> %>
<%= form_for @conn, ~p"/in/#{@token}", [id: "in", class: "form form--full_width"], fn _f -> %>
<noscript>
<div class="form-submit">
<div class="form-submit-note">
Expand Down
4 changes: 2 additions & 2 deletions lib/changelog_web/templates/auth/new.html.eex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<% end %>
<% else %>
<p class="auth-links">via <a href="/auth/github" title="Sign in via GitHub">GitHub</a></p>
<%= form_for @conn, Routes.sign_in_path(@conn, :new), [as: :auth, class: "form form--full_width"], fn f -> %>
<%= form_for @conn, ~p"/in", [as: :auth, class: "form form--full_width"], fn f -> %>
<div class="form-element_wrap">
<div class="form-element">
<label>via Email Address</label>
Expand All @@ -17,7 +17,7 @@
</div>
<div class="form-submit">
<div class="form-submit-note">
<div>Need an account? <em><%= link "Sign up", to: Routes.person_path(@conn, :join), title: "" %></em></div>
<div>Need an account? <em><%= link "Sign up", to: ~p"/join", title: "" %></em></div>
</div>
<input type="submit" value="Enter">
</div>
Expand Down
4 changes: 2 additions & 2 deletions lib/changelog_web/templates/email/_account_actions.html.eex
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<ul>
<li>Complete your profile</li>
<li>Gain access to our Slack</li>
<li><%= link("Submit", to: Routes.news_item_path(Endpoint, :new)) %> news links for coverage</li>
<li><%= link("Submit", to: ~p"/submit") %> news links for coverage</li>
<li>Comment on podcast episodes</li>
<li><%= link("Request", to: Routes.episode_request_path(Endpoint, :new)) %> podcast topics &amp; guests</li>
<li><%= link("Request", to: ~p"/request") %> podcast topics &amp; guests</li>
<li>Manage your email subscriptions</li>
</ul>
4 changes: 2 additions & 2 deletions lib/changelog_web/templates/layout/_header.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<li><%= link("Account Settings", to: ~p"/~/account") %></li>
</ul>
<div class="tooltip-footer">
<%= link("Sign Out", to: Routes.sign_out_path(@conn, :delete)) %>
<%= link("Sign Out", to: ~p"/out") %>
</div>
</div>
</div>
Expand All @@ -66,7 +66,7 @@
</ul>
<% end %>

<form action={Routes.search_path(@conn, :search)} method="get" class="header-search">
<form action={~p"/search"} method="get" class="header-search">
<input name="q" type="text" placeholder="Search Changelog" value="" aria-label="Search">
</form>

Expand Down
2 changes: 1 addition & 1 deletion lib/changelog_web/templates/page/index.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</li>

<li class="subnav-list-item subnav-list-item--right">
<%= link("🙏 Request!", to: Routes.episode_request_path(@conn, :new), title: "Request an episode") %>
<%= link("🙏 Request!", to: ~p"/request", title: "Request an episode") %>
</li>
</ul>
</nav>
Expand Down
4 changes: 2 additions & 2 deletions lib/changelog_web/views/podcast_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defmodule ChangelogWeb.PodcastView do
use ChangelogWeb, :public_view

alias Changelog.{Podcast, StringKit, UrlKit}
alias ChangelogWeb.{Endpoint, EpisodeView, PersonView, SharedView}
alias ChangelogWeb.{EpisodeView, PersonView, SharedView}
alias Changelog.Files.Cover

def active_podcasts_for_index(podcasts) do
Expand Down Expand Up @@ -90,7 +90,7 @@ defmodule ChangelogWeb.PodcastView do
# Exists to special-case /interviews
def feed_url(podcast) do
slug = if Podcast.is_interviews(podcast), do: "interviews", else: podcast.slug
Routes.feed_url(Endpoint, :podcast, slug)
url(~p"/#{slug}/feed")
end

def published_episode_count(podcast), do: Podcast.published_episode_count(podcast)
Expand Down

0 comments on commit 543f4b7

Please sign in to comment.