page titles

This commit is contained in:
byte[] 2019-12-16 14:24:38 -05:00
parent 70b077e4e7
commit 7ee4934e8f
64 changed files with 151 additions and 143 deletions

View file

@ -92,6 +92,7 @@ defmodule PhilomenaWeb.ActivityController do
render( render(
conn, conn,
"index.html", "index.html",
title: "Homepage",
images: images, images: images,
comments: comments, comments: comments,
top_scoring: top_scoring, top_scoring: top_scoring,

View file

@ -15,12 +15,12 @@ defmodule PhilomenaWeb.Admin.AdvertController do
|> order_by(desc: :finish_date) |> order_by(desc: :finish_date)
|> Repo.paginate(conn.assigns.scrivener) |> Repo.paginate(conn.assigns.scrivener)
render(conn, "index.html", layout_class: "layout--wide", adverts: adverts) render(conn, "index.html", title: "Admin - Adverts", layout_class: "layout--wide", adverts: adverts)
end end
def new(conn, _params) do def new(conn, _params) do
changeset = Adverts.change_advert(%Advert{}) changeset = Adverts.change_advert(%Advert{})
render(conn, "new.html", changeset: changeset) render(conn, "new.html", title: "New Advert", changeset: changeset)
end end
def create(conn, %{"advert" => advert_params}) do def create(conn, %{"advert" => advert_params}) do
@ -37,7 +37,7 @@ defmodule PhilomenaWeb.Admin.AdvertController do
def edit(conn, _params) do def edit(conn, _params) do
changeset = Adverts.change_advert(conn.assigns.advert) changeset = Adverts.change_advert(conn.assigns.advert)
render(conn, "edit.html", changeset: changeset) render(conn, "edit.html", title: "Editing Advert", changeset: changeset)
end end
def update(conn, %{"advert" => advert_params}) do def update(conn, %{"advert" => advert_params}) do

View file

@ -15,12 +15,12 @@ defmodule PhilomenaWeb.Admin.BadgeController do
|> order_by(asc: :title) |> order_by(asc: :title)
|> Repo.paginate(conn.assigns.scrivener) |> Repo.paginate(conn.assigns.scrivener)
render(conn, "index.html", badges: badges) render(conn, "index.html", title: "Admin - Badges", badges: badges)
end end
def new(conn, _params) do def new(conn, _params) do
changeset = Badges.change_badge(%Badge{}) changeset = Badges.change_badge(%Badge{})
render(conn, "new.html", changeset: changeset) render(conn, "new.html", title: "New Badge", changeset: changeset)
end end
def create(conn, %{"badge" => badge_params}) do def create(conn, %{"badge" => badge_params}) do
@ -37,7 +37,7 @@ defmodule PhilomenaWeb.Admin.BadgeController do
def edit(conn, _params) do def edit(conn, _params) do
changeset = Badges.change_badge(conn.assigns.badge) changeset = Badges.change_badge(conn.assigns.badge)
render(conn, "edit.html", changeset: changeset) render(conn, "edit.html", title: "Editing Badge", changeset: changeset)
end end
def update(conn, %{"badge" => badge_params}) do def update(conn, %{"badge" => badge_params}) do

View file

@ -46,7 +46,7 @@ defmodule PhilomenaWeb.Admin.DnpEntryController do
dnp_entries = dnp_entries =
%{dnp_entries | entries: Enum.zip(bodies, dnp_entries.entries)} %{dnp_entries | entries: Enum.zip(bodies, dnp_entries.entries)}
render(conn, "index.html", layout_class: "layout--wide", dnp_entries: dnp_entries) render(conn, "index.html", layout_class: "layout--wide", title: "Admin - DNP Entries", dnp_entries: dnp_entries)
end end
defp verify_authorized(conn, _opts) do defp verify_authorized(conn, _opts) do

View file

@ -32,12 +32,12 @@ defmodule PhilomenaWeb.Admin.FingerprintBanController do
def new(conn, %{"fingerprint" => fingerprint}) do def new(conn, %{"fingerprint" => fingerprint}) do
changeset = Bans.change_fingerprint(%FingerprintBan{fingerprint: fingerprint}) changeset = Bans.change_fingerprint(%FingerprintBan{fingerprint: fingerprint})
render(conn, "new.html", changeset: changeset) render(conn, "new.html", title: "New Fingerprint Ban", changeset: changeset)
end end
def new(conn, _params) do def new(conn, _params) do
changeset = Bans.change_fingerprint(%FingerprintBan{}) changeset = Bans.change_fingerprint(%FingerprintBan{})
render(conn, "new.html", changeset: changeset) render(conn, "new.html", title: "New Fingerprint Ban", changeset: changeset)
end end
def create(conn, %{"fingerprint" => fingerprint_ban_params}) do def create(conn, %{"fingerprint" => fingerprint_ban_params}) do
@ -54,7 +54,7 @@ defmodule PhilomenaWeb.Admin.FingerprintBanController do
def edit(conn, _params) do def edit(conn, _params) do
changeset = Bans.change_fingerprint(conn.assigns.fingerprint) changeset = Bans.change_fingerprint(conn.assigns.fingerprint)
render(conn, "edit.html", changeset: changeset) render(conn, "edit.html", title: "Editing Fingerprint Ban", changeset: changeset)
end end
def update(conn, %{"fingerprint" => fingerprint_ban_params}) do def update(conn, %{"fingerprint" => fingerprint_ban_params}) do
@ -84,7 +84,7 @@ defmodule PhilomenaWeb.Admin.FingerprintBanController do
|> preload(:banning_user) |> preload(:banning_user)
|> Repo.paginate(conn.assigns.scrivener) |> Repo.paginate(conn.assigns.scrivener)
render(conn, "index.html", layout_class: "layout--wide", fingerprint_bans: fingerprint_bans) render(conn, "index.html", layout_class: "layout--wide", title: "Admin - Fingerprint Bans", fingerprint_bans: fingerprint_bans)
end end
defp verify_authorized(conn, _opts) do defp verify_authorized(conn, _opts) do

View file

@ -8,12 +8,12 @@ defmodule PhilomenaWeb.Admin.ForumController do
plug :load_resource, model: Forum, id_field: "short_name" plug :load_resource, model: Forum, id_field: "short_name"
def index(conn, _params) do def index(conn, _params) do
render(conn, "index.html") render(conn, "index.html", title: "Admin - Forums")
end end
def new(conn, _params) do def new(conn, _params) do
changeset = Forums.change_forum(%Forum{}) changeset = Forums.change_forum(%Forum{})
render(conn, "new.html", changeset: changeset) render(conn, "new.html", title: "New Forum", changeset: changeset)
end end
def create(conn, %{"forum" => forum_params}) do def create(conn, %{"forum" => forum_params}) do
@ -30,7 +30,7 @@ defmodule PhilomenaWeb.Admin.ForumController do
def edit(conn, _params) do def edit(conn, _params) do
changeset = Forums.change_forum(conn.assigns.forum) changeset = Forums.change_forum(conn.assigns.forum)
render(conn, "edit.html", changeset: changeset) render(conn, "edit.html", title: "Editing Forum", changeset: changeset)
end end
def update(conn, %{"forum" => forum_params}) do def update(conn, %{"forum" => forum_params}) do

View file

@ -33,12 +33,12 @@ defmodule PhilomenaWeb.Admin.ModNoteController do
preloaded = Polymorphic.load_polymorphic(mod_notes, notable: [notable_id: :notable_type]) preloaded = Polymorphic.load_polymorphic(mod_notes, notable: [notable_id: :notable_type])
mod_notes = %{mod_notes | entries: Enum.zip(bodies, preloaded)} mod_notes = %{mod_notes | entries: Enum.zip(bodies, preloaded)}
render(conn, "index.html", mod_notes: mod_notes) render(conn, "index.html", title: "Admin - Mod Notes", mod_notes: mod_notes)
end end
def new(conn, %{"notable_type" => type, "notable_id" => id}) do def new(conn, %{"notable_type" => type, "notable_id" => id}) do
changeset = ModNotes.change_mod_note(%ModNote{notable_type: type, notable_id: id}) changeset = ModNotes.change_mod_note(%ModNote{notable_type: type, notable_id: id})
render(conn, "new.html", changeset: changeset) render(conn, "new.html", title: "New Mod Note", changeset: changeset)
end end
def create(conn, %{"mod_note" => mod_note_params}) do def create(conn, %{"mod_note" => mod_note_params}) do
@ -55,7 +55,7 @@ defmodule PhilomenaWeb.Admin.ModNoteController do
def edit(conn, _params) do def edit(conn, _params) do
changeset = ModNotes.change_mod_note(conn.assigns.mod_note) changeset = ModNotes.change_mod_note(conn.assigns.mod_note)
render(conn, "edit.html", changeset: changeset) render(conn, "edit.html", title: "Editing Mod Note", changeset: changeset)
end end
def update(conn, %{"mod_note" => mod_note_params}) do def update(conn, %{"mod_note" => mod_note_params}) do

View file

@ -16,7 +16,7 @@ defmodule PhilomenaWeb.Admin.ReportController do
reports = load_reports(conn, query) reports = load_reports(conn, query)
render(conn, "index.html", layout_class: "layout--wide", reports: reports, my_reports: []) render(conn, "index.html", title: "Admin - Reports", layout_class: "layout--wide", reports: reports, my_reports: [])
end end
def index(conn, _params) do def index(conn, _params) do
@ -47,14 +47,14 @@ defmodule PhilomenaWeb.Admin.ReportController do
|> Repo.all() |> Repo.all()
|> Polymorphic.load_polymorphic(reportable: [reportable_id: :reportable_type]) |> Polymorphic.load_polymorphic(reportable: [reportable_id: :reportable_type])
render(conn, "index.html", layout_class: "layout--wide", reports: reports, my_reports: my_reports) render(conn, "index.html", title: "Admin - Reports", layout_class: "layout--wide", reports: reports, my_reports: my_reports)
end end
def show(conn, _params) do def show(conn, _params) do
[report] = Polymorphic.load_polymorphic([conn.assigns.report], reportable: [reportable_id: :reportable_type]) [report] = Polymorphic.load_polymorphic([conn.assigns.report], reportable: [reportable_id: :reportable_type])
body = Renderer.render_one(%{body: report.reason}, conn) body = Renderer.render_one(%{body: report.reason}, conn)
render(conn, "show.html", report: report, body: body) render(conn, "show.html", title: "Showing Report", report: report, body: body)
end end
defp load_reports(conn, query) do defp load_reports(conn, query) do

View file

@ -15,12 +15,12 @@ defmodule PhilomenaWeb.Admin.SiteNoticeController do
|> order_by(desc: :start_date) |> order_by(desc: :start_date)
|> Repo.paginate(conn.assigns.scrivener) |> Repo.paginate(conn.assigns.scrivener)
render(conn, "index.html", admin_site_notices: site_notices) render(conn, "index.html", title: "Admin - Site Notices", admin_site_notices: site_notices)
end end
def new(conn, _params) do def new(conn, _params) do
changeset = SiteNotices.change_site_notice(%SiteNotice{}) changeset = SiteNotices.change_site_notice(%SiteNotice{})
render(conn, "new.html", changeset: changeset) render(conn, "new.html", title: "New Site Notice", changeset: changeset)
end end
def create(conn, %{"site_notice" => site_notice_params}) do def create(conn, %{"site_notice" => site_notice_params}) do
@ -37,7 +37,7 @@ defmodule PhilomenaWeb.Admin.SiteNoticeController do
def edit(conn, _params) do def edit(conn, _params) do
changeset = SiteNotices.change_site_notice(conn.assigns.site_notice) changeset = SiteNotices.change_site_notice(conn.assigns.site_notice)
render(conn, "edit.html", changeset: changeset) render(conn, "edit.html", title: "Editing Site Notices", changeset: changeset)
end end
def update(conn, %{"site_notice" => site_notice_params}) do def update(conn, %{"site_notice" => site_notice_params}) do

View file

@ -34,12 +34,12 @@ defmodule PhilomenaWeb.Admin.SubnetBanController do
def new(conn, %{"specification" => ip}) do def new(conn, %{"specification" => ip}) do
{:ok, ip} = EctoNetwork.INET.cast(ip) {:ok, ip} = EctoNetwork.INET.cast(ip)
changeset = Bans.change_subnet(%SubnetBan{specification: ip}) changeset = Bans.change_subnet(%SubnetBan{specification: ip})
render(conn, "new.html", changeset: changeset) render(conn, "new.html", title: "New Subnet Ban", changeset: changeset)
end end
def new(conn, _params) do def new(conn, _params) do
changeset = Bans.change_subnet(%SubnetBan{}) changeset = Bans.change_subnet(%SubnetBan{})
render(conn, "new.html", changeset: changeset) render(conn, "new.html", title: "New Subnet Ban", changeset: changeset)
end end
def create(conn, %{"subnet" => subnet_ban_params}) do def create(conn, %{"subnet" => subnet_ban_params}) do
@ -56,7 +56,7 @@ defmodule PhilomenaWeb.Admin.SubnetBanController do
def edit(conn, _params) do def edit(conn, _params) do
changeset = Bans.change_subnet(conn.assigns.subnet) changeset = Bans.change_subnet(conn.assigns.subnet)
render(conn, "edit.html", changeset: changeset) render(conn, "edit.html", title: "Editing Subnet Ban", changeset: changeset)
end end
def update(conn, %{"subnet" => subnet_ban_params}) do def update(conn, %{"subnet" => subnet_ban_params}) do
@ -86,7 +86,7 @@ defmodule PhilomenaWeb.Admin.SubnetBanController do
|> preload(:banning_user) |> preload(:banning_user)
|> Repo.paginate(conn.assigns.scrivener) |> Repo.paginate(conn.assigns.scrivener)
render(conn, "index.html", layout_class: "layout--wide", subnet_bans: subnet_bans) render(conn, "index.html", title: "Admin - Subnet Bans", layout_class: "layout--wide", subnet_bans: subnet_bans)
end end
defp verify_authorized(conn, _opts) do defp verify_authorized(conn, _opts) do

View file

@ -35,12 +35,12 @@ defmodule PhilomenaWeb.Admin.UserBanController do
def new(conn, %{"username" => username}) do def new(conn, %{"username" => username}) do
changeset = Bans.change_user(%UserBan{username: username}) changeset = Bans.change_user(%UserBan{username: username})
render(conn, "new.html", changeset: changeset) render(conn, "new.html", title: "New User Ban", changeset: changeset)
end end
def new(conn, _params) do def new(conn, _params) do
changeset = Bans.change_user(%UserBan{}) changeset = Bans.change_user(%UserBan{})
render(conn, "new.html", changeset: changeset) render(conn, "new.html", title: "New User Ban", changeset: changeset)
end end
def create(conn, %{"user" => user_ban_params}) do def create(conn, %{"user" => user_ban_params}) do
@ -57,7 +57,7 @@ defmodule PhilomenaWeb.Admin.UserBanController do
def edit(conn, _params) do def edit(conn, _params) do
changeset = Bans.change_user(conn.assigns.user) changeset = Bans.change_user(conn.assigns.user)
render(conn, "edit.html", changeset: changeset) render(conn, "edit.html", title: "Editing User Ban", changeset: changeset)
end end
def update(conn, %{"user" => user_ban_params}) do def update(conn, %{"user" => user_ban_params}) do
@ -87,7 +87,7 @@ defmodule PhilomenaWeb.Admin.UserBanController do
|> preload([:user, :banning_user]) |> preload([:user, :banning_user])
|> Repo.paginate(conn.assigns.scrivener) |> Repo.paginate(conn.assigns.scrivener)
render(conn, "index.html", layout_class: "layout--wide", user_bans: user_bans) render(conn, "index.html", title: "Admin - User Bans", layout_class: "layout--wide", user_bans: user_bans)
end end
defp verify_authorized(conn, _opts) do defp verify_authorized(conn, _opts) do

View file

@ -39,12 +39,12 @@ defmodule PhilomenaWeb.Admin.UserController do
|> order_by(desc: :id) |> order_by(desc: :id)
|> Repo.paginate(conn.assigns.scrivener) |> Repo.paginate(conn.assigns.scrivener)
render(conn, "index.html", layout_class: "layout--medium", users: users) render(conn, "index.html", title: "Admin - Users", layout_class: "layout--medium", users: users)
end end
def edit(conn, _params) do def edit(conn, _params) do
changeset = Users.change_user(conn.assigns.user) changeset = Users.change_user(conn.assigns.user)
render(conn, "edit.html", changeset: changeset) render(conn, "edit.html", title: "Editing User", changeset: changeset)
end end
def update(conn, %{"user" => user_params}) do def update(conn, %{"user" => user_params}) do

View file

@ -33,7 +33,7 @@ defmodule PhilomenaWeb.Admin.UserLinkController do
|> preload([:tag, :verified_by_user, :contacted_by_user, user: [:linked_tags, awards: :badge]]) |> preload([:tag, :verified_by_user, :contacted_by_user, user: [:linked_tags, awards: :badge]])
|> Repo.paginate(conn.assigns.scrivener) |> Repo.paginate(conn.assigns.scrivener)
render(conn, "index.html", user_links: links) render(conn, "index.html", title: "Admin - User Links", user_links: links)
end end
defp verify_authorized(conn, _opts) do defp verify_authorized(conn, _opts) do

View file

@ -8,7 +8,7 @@ defmodule PhilomenaWeb.AvatarController do
def edit(conn, _params) do def edit(conn, _params) do
changeset = Users.change_user(conn.assigns.current_user) changeset = Users.change_user(conn.assigns.current_user)
render(conn, "edit.html", changeset: changeset) render(conn, "edit.html", title: "Editing Avatar", changeset: changeset)
end end
def update(conn, %{"user" => user_params}) do def update(conn, %{"user" => user_params}) do

View file

@ -20,7 +20,7 @@ defmodule PhilomenaWeb.ChannelController do
subscriptions = Channels.subscriptions(channels, conn.assigns.current_user) subscriptions = Channels.subscriptions(channels, conn.assigns.current_user)
render(conn, "index.html", layout_class: "layout--wide", channels: channels, subscriptions: subscriptions) render(conn, "index.html", title: "Livestreams", layout_class: "layout--wide", channels: channels, subscriptions: subscriptions)
end end
def show(conn, _params) do def show(conn, _params) do

View file

@ -37,6 +37,6 @@ defmodule PhilomenaWeb.CommentController do
comments = comments =
%{comments | entries: Enum.zip(rendered, comments.entries)} %{comments | entries: Enum.zip(rendered, comments.entries)}
render(conn, "index.html", comments: comments) render(conn, "index.html", title: "Comments", comments: comments)
end end
end end

View file

@ -12,7 +12,7 @@ defmodule PhilomenaWeb.CommissionController do
commission_search(params["commission"]) commission_search(params["commission"])
|> Repo.paginate(conn.assigns.scrivener) |> Repo.paginate(conn.assigns.scrivener)
render(conn, "index.html", commissions: commissions, layout_class: "layout--wide") render(conn, "index.html", title: "Commissions", commissions: commissions, layout_class: "layout--wide")
end end
defp commission_search(attrs) when is_map(attrs) do defp commission_search(attrs) when is_map(attrs) do

View file

@ -22,7 +22,7 @@ defmodule PhilomenaWeb.Conversation.ReportController do
conn conn
|> put_view(ReportView) |> put_view(ReportView)
|> render("new.html", reportable: conversation, changeset: changeset, action: action) |> render("new.html", title: "Reporting Conversation", reportable: conversation, changeset: changeset, action: action)
end end
def create(conn, params) do def create(conn, params) do

View file

@ -22,7 +22,7 @@ defmodule PhilomenaWeb.ConversationController do
|> select([c, cnt], {c, cnt.count}) |> select([c, cnt], {c, cnt.count})
|> Repo.paginate(conn.assigns.scrivener) |> Repo.paginate(conn.assigns.scrivener)
render(conn, "index.html", conversations: conversations) render(conn, "index.html", title: "Conversations", conversations: conversations)
end end
def show(conn, _params) do def show(conn, _params) do
@ -53,7 +53,7 @@ defmodule PhilomenaWeb.ConversationController do
# Update the conversation ticker in the header # Update the conversation ticker in the header
conn = NotificationCountPlug.call(conn) conn = NotificationCountPlug.call(conn)
render(conn, "show.html", conversation: conversation, messages: messages, changeset: changeset) render(conn, "show.html", title: "Showing Conversation", conversation: conversation, messages: messages, changeset: changeset)
end end
def new(conn, params) do def new(conn, params) do
@ -61,7 +61,7 @@ defmodule PhilomenaWeb.ConversationController do
%Conversation{recipient: params["recipient"], messages: [%Message{}]} %Conversation{recipient: params["recipient"], messages: [%Message{}]}
|> Conversations.change_conversation() |> Conversations.change_conversation()
render(conn, "new.html", changeset: changeset) render(conn, "new.html", title: "New Conversation", changeset: changeset)
end end
def create(conn, %{"conversation" => conversation_params}) do def create(conn, %{"conversation" => conversation_params}) do

View file

@ -39,7 +39,7 @@ defmodule PhilomenaWeb.DnpEntryController do
dnp_entries = dnp_entries =
%{dnp_entries | entries: Enum.zip(bodies, dnp_entries.entries)} %{dnp_entries | entries: Enum.zip(bodies, dnp_entries.entries)}
render(conn, "index.html", layout_class: "layout--medium", dnp_entries: dnp_entries, status_column: status) render(conn, "index.html", title: "Do-Not-Post List", layout_class: "layout--medium", dnp_entries: dnp_entries, status_column: status)
end end
def show(conn, _params) do def show(conn, _params) do
@ -55,12 +55,12 @@ defmodule PhilomenaWeb.DnpEntryController do
conn conn
) )
render(conn, "show.html", dnp_entry: dnp_entry, conditions: conditions, reason: reason, instructions: instructions) render(conn, "show.html", title: "Showing DNP Listing", dnp_entry: dnp_entry, conditions: conditions, reason: reason, instructions: instructions)
end end
def new(conn, _params) do def new(conn, _params) do
changeset = DnpEntries.change_dnp_entry(%DnpEntry{}) changeset = DnpEntries.change_dnp_entry(%DnpEntry{})
render(conn, "new.html", changeset: changeset, selectable_tags: selectable_tags(conn)) render(conn, "new.html", title: "New DNP Listing", changeset: changeset, selectable_tags: selectable_tags(conn))
end end
def create(conn, %{"dnp_entry" => dnp_entry_params}) do def create(conn, %{"dnp_entry" => dnp_entry_params}) do
@ -77,14 +77,14 @@ defmodule PhilomenaWeb.DnpEntryController do
def edit(conn, _params) do def edit(conn, _params) do
changeset = DnpEntries.change_dnp_entry(conn.assigns.dnp_entry) changeset = DnpEntries.change_dnp_entry(conn.assigns.dnp_entry)
render(conn, "edit.html", changeset: changeset, selectable_tags: selectable_tags(conn)) render(conn, "edit.html", title: "Editing DNP Listing", changeset: changeset, selectable_tags: selectable_tags(conn))
end end
def update(conn, %{"dnp_entry" => dnp_entry_params}) do def update(conn, %{"dnp_entry" => dnp_entry_params}) do
case DnpEntries.update_dnp_entry(conn.assigns.dnp_entry, selectable_tags(conn), dnp_entry_params) do case DnpEntries.update_dnp_entry(conn.assigns.dnp_entry, selectable_tags(conn), dnp_entry_params) do
{:ok, dnp_entry} -> {:ok, dnp_entry} ->
conn conn
|> put_flash(:info, "Successfully submupdateditted DNP request.") |> put_flash(:info, "Successfully updated DNP request.")
|> redirect(to: Routes.dnp_entry_path(conn, :show, dnp_entry)) |> redirect(to: Routes.dnp_entry_path(conn, :show, dnp_entry))
{:error, changeset} -> {:error, changeset} ->

View file

@ -26,7 +26,7 @@ defmodule PhilomenaWeb.DuplicateReportController do
|> order_by(desc: :created_at) |> order_by(desc: :created_at)
|> Repo.paginate(conn.assigns.pagination) |> Repo.paginate(conn.assigns.pagination)
render(conn, "index.html", duplicate_reports: duplicate_reports, layout_class: "layout--wide") render(conn, "index.html", title: "Duplicate Reports", duplicate_reports: duplicate_reports, layout_class: "layout--wide")
end end
def create(conn, %{"duplicate_report" => duplicate_report_params}) do def create(conn, %{"duplicate_report" => duplicate_report_params}) do
@ -50,7 +50,7 @@ defmodule PhilomenaWeb.DuplicateReportController do
def show(conn, _params) do def show(conn, _params) do
dr = conn.assigns.duplicate_report dr = conn.assigns.duplicate_report
render(conn, "show.html", duplicate_report: dr, layout_class: "layout--wide") render(conn, "show.html", title: "Showing Duplicate Report", duplicate_report: dr, layout_class: "layout--wide")
end end
defp wrap(list) when is_list(list), do: list defp wrap(list) when is_list(list), do: list

View file

@ -28,7 +28,7 @@ defmodule PhilomenaWeb.FilterController do
|> preload(:user) |> preload(:user)
|> Repo.all() |> Repo.all()
render(conn, "index.html", my_filters: my_filters, system_filters: system_filters) render(conn, "index.html", title: "Filters", my_filters: my_filters, system_filters: system_filters)
end end
def show(conn, _params) do def show(conn, _params) do
@ -46,13 +46,12 @@ defmodule PhilomenaWeb.FilterController do
|> order_by(asc: :name) |> order_by(asc: :name)
|> Repo.all() |> Repo.all()
render(conn, "show.html", filter: filter, spoilered_tags: spoilered_tags, hidden_tags: hidden_tags) render(conn, "show.html", title: "Showing Filter", filter: filter, spoilered_tags: spoilered_tags, hidden_tags: hidden_tags)
end end
def new(conn, _params) do def new(conn, _params) do
changeset = Filters.change_filter(%Filter{}) changeset = Filters.change_filter(%Filter{})
render(conn, "new.html", title: "New Filter", changeset: changeset)
render(conn, "new.html", changeset: changeset)
end end
def create(conn, %{"filter" => filter_params}) do def create(conn, %{"filter" => filter_params}) do
@ -75,7 +74,7 @@ defmodule PhilomenaWeb.FilterController do
changeset = Filters.change_filter(filter) changeset = Filters.change_filter(filter)
render(conn, "edit.html", filter: filter, changeset: changeset) render(conn, "edit.html", title: "Editing Filter", filter: filter, changeset: changeset)
end end
def update(conn, %{"filter" => filter_params}) do def update(conn, %{"filter" => filter_params}) do

View file

@ -21,7 +21,7 @@ defmodule PhilomenaWeb.FingerprintProfileController do
|> where(fingerprint: ^fingerprint) |> where(fingerprint: ^fingerprint)
|> Repo.all() |> Repo.all()
render(conn, "show.html", fingerprint: fingerprint, user_fps: user_fps, fingerprint_bans: fp_bans) render(conn, "show.html", title: "#{fingerprint}'s fingerprint profile", fingerprint: fingerprint, user_fps: user_fps, fingerprint_bans: fp_bans)
end end
defp authorize_ip(conn, _opts) do defp authorize_ip(conn, _opts) do

View file

@ -18,7 +18,7 @@ defmodule PhilomenaWeb.ForumController do
topic_count = Repo.aggregate(Forum, :sum, :topic_count) topic_count = Repo.aggregate(Forum, :sum, :topic_count)
render(conn, "index.html", forums: forums, topic_count: topic_count) render(conn, "index.html", title: "Forums", forums: forums, topic_count: topic_count)
end end
def show(conn, %{"id" => _id}) do def show(conn, %{"id" => _id}) do
@ -35,6 +35,6 @@ defmodule PhilomenaWeb.ForumController do
watching = Forums.subscribed?(forum, user) watching = Forums.subscribed?(forum, user)
render(conn, "show.html", forum: conn.assigns.forum, watching: watching, topics: topics) render(conn, "show.html", title: "Showing Forum", forum: conn.assigns.forum, watching: watching, topics: topics)
end end
end end

View file

@ -22,7 +22,7 @@ defmodule PhilomenaWeb.Gallery.ReportController do
conn conn
|> put_view(ReportView) |> put_view(ReportView)
|> render("new.html", reportable: gallery, changeset: changeset, action: action) |> render("new.html", title: "Reporting Gallery", reportable: gallery, changeset: changeset, action: action)
end end
def create(conn, params) do def create(conn, params) do

View file

@ -27,7 +27,7 @@ defmodule PhilomenaWeb.GalleryController do
Gallery |> preload([:creator, thumbnail: :tags]) Gallery |> preload([:creator, thumbnail: :tags])
) )
render(conn, "index.html", galleries: galleries, layout_class: "layout--wide") render(conn, "index.html", title: "Galleries", galleries: galleries, layout_class: "layout--wide")
end end
def show(conn, _params) do def show(conn, _params) do
@ -49,12 +49,12 @@ defmodule PhilomenaWeb.GalleryController do
|> NotificationCountPlug.call([]) |> NotificationCountPlug.call([])
|> Map.put(:params, params) |> Map.put(:params, params)
|> assign(:clientside_data, [gallery_images: gallery_images]) |> assign(:clientside_data, [gallery_images: gallery_images])
|> render("show.html", layout_class: "layout--wide", watching: watching, gallery: gallery, images: images, interactions: interactions) |> render("show.html", title: "Showing Gallery", layout_class: "layout--wide", watching: watching, gallery: gallery, images: images, interactions: interactions)
end end
def new(conn, _params) do def new(conn, _params) do
changeset = Galleries.change_gallery(%Gallery{}) changeset = Galleries.change_gallery(%Gallery{})
render(conn, "new.html", changeset: changeset) render(conn, "new.html", title: "New Gallery", changeset: changeset)
end end
def create(conn, %{"gallery" => gallery_params}) do def create(conn, %{"gallery" => gallery_params}) do
@ -78,7 +78,7 @@ defmodule PhilomenaWeb.GalleryController do
gallery = conn.assigns.gallery gallery = conn.assigns.gallery
changeset = Galleries.change_gallery(gallery) changeset = Galleries.change_gallery(gallery)
render(conn, "edit.html", gallery: gallery, changeset: changeset) render(conn, "edit.html", title: "Editing Gallery", gallery: gallery, changeset: changeset)
end end
def update(conn, %{"gallery" => gallery_params}) do def update(conn, %{"gallery" => gallery_params}) do

View file

@ -13,6 +13,7 @@ defmodule PhilomenaWeb.Image.Comment.HistoryController do
plug PhilomenaWeb.LoadCommentPlug plug PhilomenaWeb.LoadCommentPlug
def index(conn, _params) do def index(conn, _params) do
image = conn.assigns.image
comment = conn.assigns.comment comment = conn.assigns.comment
versions = versions =
@ -23,6 +24,6 @@ defmodule PhilomenaWeb.Image.Comment.HistoryController do
|> Repo.all() |> Repo.all()
|> Versions.load_data_and_associations(comment) |> Versions.load_data_and_associations(comment)
render(conn, "index.html", versions: versions) render(conn, "index.html", title: "Comment History for comment #{comment.id} on image #{image.id}", versions: versions)
end end
end end

View file

@ -25,7 +25,7 @@ defmodule PhilomenaWeb.Image.Comment.ReportController do
conn conn
|> put_view(ReportView) |> put_view(ReportView)
|> render("new.html", reportable: comment, changeset: changeset, action: action) |> render("new.html", title: "Reporting Comment", reportable: comment, changeset: changeset, action: action)
end end
def create(conn, params) do def create(conn, params) do

View file

@ -89,7 +89,7 @@ defmodule PhilomenaWeb.Image.CommentController do
conn.assigns.comment conn.assigns.comment
|> Comments.change_comment() |> Comments.change_comment()
render(conn, "edit.html", comment: conn.assigns.comment, changeset: changeset) render(conn, "edit.html", title: "Editing Comment", comment: conn.assigns.comment, changeset: changeset)
end end
def update(conn, %{"comment" => comment_params}) do def update(conn, %{"comment" => comment_params}) do

View file

@ -22,7 +22,7 @@ defmodule PhilomenaWeb.Image.ReportController do
conn conn
|> put_view(ReportView) |> put_view(ReportView)
|> render("new.html", reportable: image, changeset: changeset, action: action) |> render("new.html", title: "Reporting Image", reportable: image, changeset: changeset, action: action)
end end
def create(conn, params) do def create(conn, params) do

View file

@ -9,7 +9,7 @@ defmodule PhilomenaWeb.Image.ScratchpadController do
def edit(conn, _params) do def edit(conn, _params) do
changeset = Images.change_image(conn.assigns.image) changeset = Images.change_image(conn.assigns.image)
render(conn, "edit.html", changeset: changeset) render(conn, "edit.html", title: "Editing Moderation Notes", changeset: changeset)
end end
def update(conn, %{"image" => image_params}) do def update(conn, %{"image" => image_params}) do

View file

@ -19,6 +19,6 @@ defmodule PhilomenaWeb.Image.SourceChangeController do
|> order_by(desc: :created_at) |> order_by(desc: :created_at)
|> Repo.paginate(conn.assigns.scrivener) |> Repo.paginate(conn.assigns.scrivener)
render(conn, "index.html", image: image, source_changes: source_changes) render(conn, "index.html", title: "Source Changes on Image #{image.id}", image: image, source_changes: source_changes)
end end
end end

View file

@ -20,7 +20,7 @@ defmodule PhilomenaWeb.Image.TagChangeController do
|> order_by(desc: :created_at) |> order_by(desc: :created_at)
|> Repo.paginate(conn.assigns.scrivener) |> Repo.paginate(conn.assigns.scrivener)
render(conn, "index.html", image: image, tag_changes: tag_changes) render(conn, "index.html", title: "Tag Changes on Image #{image.id}", image: image, tag_changes: tag_changes)
end end
defp added_filter(query, %{"added" => "1"}), defp added_filter(query, %{"added" => "1"}),

View file

@ -26,7 +26,7 @@ defmodule PhilomenaWeb.ImageController do
interactions = interactions =
Interactions.user_interactions(images, conn.assigns.current_user) Interactions.user_interactions(images, conn.assigns.current_user)
render(conn, "index.html", layout_class: "layout--wide", images: images, interactions: interactions) render(conn, "index.html", title: "Images", layout_class: "layout--wide", images: images, interactions: interactions)
end end
def show(conn, %{"id" => _id}) do def show(conn, %{"id" => _id}) do
@ -83,7 +83,8 @@ defmodule PhilomenaWeb.ImageController do
description: description, description: description,
interactions: interactions, interactions: interactions,
watching: watching, watching: watching,
layout_class: "layout--wide" layout_class: "layout--wide",
title: "Image ##{image.id} - #{image.tag_list_cache}"
] ]
if image.hidden_from_users do if image.hidden_from_users do
@ -98,7 +99,7 @@ defmodule PhilomenaWeb.ImageController do
%Image{} %Image{}
|> Images.change_image() |> Images.change_image()
render(conn, "new.html", changeset: changeset) render(conn, "new.html", title: "New Image", changeset: changeset)
end end
def create(conn, %{"image" => image_params}) do def create(conn, %{"image" => image_params}) do

View file

@ -23,7 +23,7 @@ defmodule PhilomenaWeb.IpProfileController do
|> where([s], fragment("? >>= ?", s.specification, ^ip)) |> where([s], fragment("? >>= ?", s.specification, ^ip))
|> Repo.all() |> Repo.all()
render(conn, "show.html", ip: ip, user_ips: user_ips, subnet_bans: subnet_bans) render(conn, "show.html", title: "#{ip}'s IP profile", ip: ip, user_ips: user_ips, subnet_bans: subnet_bans)
end end
defp authorize_ip(conn, _opts) do defp authorize_ip(conn, _opts) do

View file

@ -28,6 +28,6 @@ defmodule PhilomenaWeb.NotificationController do
notifications = notifications =
%{notifications | entries: entries} %{notifications | entries: entries}
render(conn, "index.html", notifications: notifications) render(conn, "index.html", title: "Notification Area", notifications: notifications)
end end
end end

View file

@ -19,7 +19,7 @@ defmodule PhilomenaWeb.Page.HistoryController do
|> Repo.all() |> Repo.all()
|> generate_differences(page.body) |> generate_differences(page.body)
render(conn, "index.html", layout_class: "layout--wide", versions: versions) render(conn, "index.html", title: "Revision History for Page `#{page.title}'", layout_class: "layout--wide", versions: versions)
end end
defp generate_differences(pages, current_body) do defp generate_differences(pages, current_body) do

View file

@ -7,16 +7,16 @@ defmodule PhilomenaWeb.PageController do
plug :load_and_authorize_resource, model: StaticPage, id_field: "slug" plug :load_and_authorize_resource, model: StaticPage, id_field: "slug"
def index(conn, _params) do def index(conn, _params) do
render(conn, "index.html") render(conn, "index.html", title: "Pages")
end end
def show(conn, _params) do def show(conn, _params) do
render(conn, "show.html") render(conn, "show.html", title: conn.assigns.page.title)
end end
def new(conn, _params) do def new(conn, _params) do
changeset = StaticPages.change_static_page(%StaticPage{}) changeset = StaticPages.change_static_page(%StaticPage{})
render(conn, "new.html", changeset: changeset) render(conn, "new.html", title: "New Page", changeset: changeset)
end end
def create(conn, %{"static_page" => static_page_params}) do def create(conn, %{"static_page" => static_page_params}) do
@ -33,7 +33,7 @@ defmodule PhilomenaWeb.PageController do
def edit(conn, _params) do def edit(conn, _params) do
changeset = StaticPages.change_static_page(conn.assigns.static_page) changeset = StaticPages.change_static_page(conn.assigns.static_page)
render(conn, "edit.html", changeset: changeset) render(conn, "edit.html", title: "Editing Page", changeset: changeset)
end end
def update(conn, %{"static_page" => static_page_params}) do def update(conn, %{"static_page" => static_page_params}) do

View file

@ -39,6 +39,6 @@ defmodule PhilomenaWeb.PostController do
posts = posts =
%{posts | entries: Enum.zip(rendered, posts.entries)} %{posts | entries: Enum.zip(rendered, posts.entries)}
render(conn, "index.html", posts: posts) render(conn, "index.html", title: "Posts", posts: posts)
end end
end end

View file

@ -15,7 +15,7 @@ defmodule PhilomenaWeb.Profile.AwardController do
def new(conn, _params) do def new(conn, _params) do
changeset = Badges.change_badge_award(%Award{}) changeset = Badges.change_badge_award(%Award{})
render(conn, "new.html", changeset: changeset) render(conn, "new.html", title: "New Award", changeset: changeset)
end end
def create(conn, %{"award" => award_params}) do def create(conn, %{"award" => award_params}) do
@ -32,7 +32,7 @@ defmodule PhilomenaWeb.Profile.AwardController do
def edit(conn, _params) do def edit(conn, _params) do
changeset = Badges.change_badge_award(conn.assigns.award) changeset = Badges.change_badge_award(conn.assigns.award)
render(conn, "edit.html", changeset: changeset) render(conn, "edit.html", title: "Editing Award", changeset: changeset)
end end
def update(conn, %{"award" => award_params}) do def update(conn, %{"award" => award_params}) do

View file

@ -16,7 +16,7 @@ defmodule PhilomenaWeb.Profile.Commission.ItemController do
commission = user.commission commission = user.commission
changeset = Commissions.change_item(%Item{}) changeset = Commissions.change_item(%Item{})
render(conn, "new.html", user: user, commission: commission, changeset: changeset) render(conn, "new.html", title: "New Commission Item", user: user, commission: commission, changeset: changeset)
end end
def create(conn, %{"item" => item_params}) do def create(conn, %{"item" => item_params}) do
@ -40,7 +40,7 @@ defmodule PhilomenaWeb.Profile.Commission.ItemController do
item = Repo.get_by!(Item, commission_id: commission.id, id: id) item = Repo.get_by!(Item, commission_id: commission.id, id: id)
changeset = Commissions.change_item(item) changeset = Commissions.change_item(item)
render(conn, "edit.html", user: user, commission: commission, item: item, changeset: changeset) render(conn, "edit.html", title: "Editing Commission Item", user: user, commission: commission, item: item, changeset: changeset)
end end
def update(conn, %{"id" => id, "item" => item_params}) do def update(conn, %{"id" => id, "item" => item_params}) do

View file

@ -24,7 +24,7 @@ defmodule PhilomenaWeb.Profile.Commission.ReportController do
conn conn
|> put_view(ReportView) |> put_view(ReportView)
|> render("new.html", reportable: commission, changeset: changeset, action: action) |> render("new.html", title: "Reporting Commission", reportable: commission, changeset: changeset, action: action)
end end
def create(conn, params) do def create(conn, params) do

View file

@ -47,12 +47,12 @@ defmodule PhilomenaWeb.Profile.CommissionController do
items = Enum.zip([item_descriptions, item_add_ons, commission.items]) items = Enum.zip([item_descriptions, item_add_ons, commission.items])
render(conn, "show.html", rendered: rendered, commission: commission, items: items, layout_class: "layout--wide") render(conn, "show.html", title: "Showing Commission", rendered: rendered, commission: commission, items: items, layout_class: "layout--wide")
end end
def new(conn, _params) do def new(conn, _params) do
changeset = Commissions.change_commission(%Commission{}) changeset = Commissions.change_commission(%Commission{})
render(conn, "new.html", changeset: changeset) render(conn, "new.html", title: "New Commission", changeset: changeset)
end end
def create(conn, %{"commission" => commission_params}) do def create(conn, %{"commission" => commission_params}) do
@ -71,7 +71,7 @@ defmodule PhilomenaWeb.Profile.CommissionController do
def edit(conn, _params) do def edit(conn, _params) do
changeset = Commissions.change_commission(conn.assigns.user.commission) changeset = Commissions.change_commission(conn.assigns.user.commission)
render(conn, "edit.html", changeset: changeset) render(conn, "edit.html", title: "Editing Commission", changeset: changeset)
end end
def update(conn, %{"commission" => commission_params}) do def update(conn, %{"commission" => commission_params}) do

View file

@ -10,7 +10,7 @@ defmodule PhilomenaWeb.Profile.DescriptionController do
def edit(conn, _params) do def edit(conn, _params) do
changeset = Users.change_user(conn.assigns.user) changeset = Users.change_user(conn.assigns.user)
render(conn, "edit.html", changeset: changeset, user: conn.assigns.user) render(conn, "edit.html", title: "Editing Profile Description", changeset: changeset, user: conn.assigns.user)
end end
def update(conn, %{"user" => user_params}) do def update(conn, %{"user" => user_params}) do

View file

@ -22,7 +22,7 @@ defmodule PhilomenaWeb.Profile.ReportController do
conn conn
|> put_view(ReportView) |> put_view(ReportView)
|> render("new.html", reportable: user, changeset: changeset, action: action) |> render("new.html", title: "Reporting User", reportable: user, changeset: changeset, action: action)
end end
def create(conn, params) do def create(conn, params) do

View file

@ -21,6 +21,6 @@ defmodule PhilomenaWeb.Profile.SourceChangeController do
|> order_by(desc: :created_at) |> order_by(desc: :created_at)
|> Repo.paginate(conn.assigns.scrivener) |> Repo.paginate(conn.assigns.scrivener)
render(conn, "index.html", user: user, source_changes: source_changes) render(conn, "index.html", title: "Source Changes for User `#{user.name}'", user: user, source_changes: source_changes)
end end
end end

View file

@ -22,7 +22,7 @@ defmodule PhilomenaWeb.Profile.TagChangeController do
|> order_by(desc: :created_at) |> order_by(desc: :created_at)
|> Repo.paginate(conn.assigns.scrivener) |> Repo.paginate(conn.assigns.scrivener)
render(conn, "index.html", user: user, tag_changes: tag_changes) render(conn, "index.html", title: "Tag Changes for User `#{user.name}'", user: user, tag_changes: tag_changes)
end end
defp added_filter(query, %{"added" => "1"}), defp added_filter(query, %{"added" => "1"}),

View file

@ -27,12 +27,12 @@ defmodule PhilomenaWeb.Profile.UserLinkController do
|> where(user_id: ^user.id) |> where(user_id: ^user.id)
|> Repo.all() |> Repo.all()
render(conn, "index.html", user_links: user_links) render(conn, "index.html", title: "User Links", user_links: user_links)
end end
def new(conn, _params) do def new(conn, _params) do
changeset = UserLinks.change_user_link(%UserLink{}) changeset = UserLinks.change_user_link(%UserLink{})
render(conn, "new.html", changeset: changeset) render(conn, "new.html", title: "New User Link", changeset: changeset)
end end
def create(conn, %{"user_link" => user_link_params}) do def create(conn, %{"user_link" => user_link_params}) do
@ -49,13 +49,13 @@ defmodule PhilomenaWeb.Profile.UserLinkController do
def show(conn, _params) do def show(conn, _params) do
user_link = conn.assigns.user_link user_link = conn.assigns.user_link
render(conn, "show.html", user_link: user_link) render(conn, "show.html", title: "Showing User Link", user_link: user_link)
end end
def edit(conn, _params) do def edit(conn, _params) do
changeset = UserLinks.change_user_link(conn.assigns.user_link) changeset = UserLinks.change_user_link(conn.assigns.user_link)
render(conn, "edit.html", changeset: changeset) render(conn, "edit.html", title: "Editing User Link", changeset: changeset)
end end
def update(conn, %{"user_link" => user_link_params}) do def update(conn, %{"user_link" => user_link_params}) do

View file

@ -137,7 +137,8 @@ defmodule PhilomenaWeb.ProfileController do
about_me: about_me, about_me: about_me,
tags: tags, tags: tags,
bans: bans, bans: bans,
layout_class: "layout--medium" layout_class: "layout--medium",
title: "#{user.name}'s profile"
) )
end end

View file

@ -20,7 +20,7 @@ defmodule PhilomenaWeb.Registration.TotpController do
changeset = Pow.Plug.change_user(conn) changeset = Pow.Plug.change_user(conn)
secret = User.totp_secret(user) secret = User.totp_secret(user)
qrcode = User.totp_qrcode(user) qrcode = User.totp_qrcode(user)
render(conn, "edit.html", changeset: changeset, totp_secret: secret, totp_qrcode: qrcode) render(conn, "edit.html", title: "Two-Factor Authentication", changeset: changeset, totp_secret: secret, totp_qrcode: qrcode)
end end
end end

View file

@ -21,7 +21,7 @@ defmodule PhilomenaWeb.ReportController do
reports = reports =
%{reports | entries: polymorphic} %{reports | entries: polymorphic}
render(conn, "index.html", reports: reports) render(conn, "index.html", title: "My Reports", reports: reports)
end end
# Make sure that you load the resource in your controller: # Make sure that you load the resource in your controller:

View file

@ -6,13 +6,13 @@ defmodule PhilomenaWeb.Search.ReverseController do
plug PhilomenaWeb.ScraperPlug, [params_key: "image", params_name: "image"] when action in [:create] plug PhilomenaWeb.ScraperPlug, [params_key: "image", params_name: "image"] when action in [:create]
def index(conn, _params) do def index(conn, _params) do
render(conn, "index.html", images: nil) render(conn, "index.html", title: "Reverse Search", images: nil)
end end
def create(conn, %{"image" => image_params}) do def create(conn, %{"image" => image_params}) do
images = ImageReverse.images(image_params) images = ImageReverse.images(image_params)
conn conn
|> render("index.html", images: images) |> render("index.html", title: "Reverse Search", images: images)
end end
end end

View file

@ -15,10 +15,10 @@ defmodule PhilomenaWeb.SearchController do
Interactions.user_interactions(images, user) Interactions.user_interactions(images, user)
conn conn
|> render("index.html", images: images, tags: tags, search_query: params["q"], interactions: interactions, layout_class: "layout--wide") |> render("index.html", title: "Searching for #{params["q"]}", images: images, tags: tags, search_query: params["q"], interactions: interactions, layout_class: "layout--wide")
{:error, msg} -> {:error, msg} ->
render(conn, "index.html", images: [], error: msg, search_query: params["q"]) render(conn, "index.html", title: "Searching for #{params["q"]}", images: [], error: msg, search_query: params["q"])
end end
end end
end end

View file

@ -7,7 +7,7 @@ defmodule PhilomenaWeb.Session.TotpController do
def new(conn, _params) do def new(conn, _params) do
changeset = Pow.Plug.change_user(conn) changeset = Pow.Plug.change_user(conn)
render(conn, "new.html", changeset: changeset) render(conn, "new.html", title: "Two-Factor Authentication", changeset: changeset)
end end
def create(conn, params) do def create(conn, params) do

View file

@ -12,7 +12,7 @@ defmodule PhilomenaWeb.SettingController do
|> TagList.assign_tag_list(:watched_tag_ids, :watched_tag_list) |> TagList.assign_tag_list(:watched_tag_ids, :watched_tag_list)
|> Users.change_user() |> Users.change_user()
render(conn, "edit.html", changeset: changeset) render(conn, "edit.html", title: "Editing Settings", changeset: changeset)
end end
def update(conn, %{"user" => user_params}) do def update(conn, %{"user" => user_params}) do

View file

@ -20,6 +20,6 @@ defmodule PhilomenaWeb.StaffController do
"Assistants": Enum.filter(users, & &1.role == "assistant" and &1.secondary_role in [nil, ""]) "Assistants": Enum.filter(users, & &1.role == "assistant" and &1.secondary_role in [nil, ""])
] ]
render(conn, "index.html", categories: categories) render(conn, "index.html", index: "Site Staff", categories: categories)
end end
end end

View file

@ -41,7 +41,8 @@ defmodule PhilomenaWeb.StatController do
gallery_count: gallery_count, gallery_count: gallery_count,
gallery_size: gallery_size, gallery_size: gallery_size,
distinct_creators: distinct_creators, distinct_creators: distinct_creators,
images_in_galleries: images_in_galleries images_in_galleries: images_in_galleries,
title: "Statistics"
) )
end end

View file

@ -9,7 +9,7 @@ defmodule PhilomenaWeb.Tag.AliasController do
def edit(conn, _params) do def edit(conn, _params) do
changeset = Tags.change_tag(conn.assigns.tag) changeset = Tags.change_tag(conn.assigns.tag)
render(conn, "edit.html", changeset: changeset) render(conn, "edit.html", title: "Editing Tag Alias", changeset: changeset)
end end
def update(conn, %{"tag" => tag_params}) do def update(conn, %{"tag" => tag_params}) do

View file

@ -9,7 +9,7 @@ defmodule PhilomenaWeb.Tag.ImageController do
def edit(conn, _params) do def edit(conn, _params) do
changeset = Tags.change_tag(conn.assigns.tag) changeset = Tags.change_tag(conn.assigns.tag)
render(conn, "edit.html", changeset: changeset) render(conn, "edit.html", title: "Editing Tag Spoiler Image", changeset: changeset)
end end
def update(conn, %{"tag" => tag_params}) do def update(conn, %{"tag" => tag_params}) do

View file

@ -20,7 +20,7 @@ defmodule PhilomenaWeb.Tag.TagChangeController do
|> order_by(desc: :created_at) |> order_by(desc: :created_at)
|> Repo.paginate(conn.assigns.scrivener) |> Repo.paginate(conn.assigns.scrivener)
render(conn, "index.html", tag: tag, tag_changes: tag_changes) render(conn, "index.html", title: "Tag Changes for Tag `#{tag.name}'", tag: tag, tag_changes: tag_changes)
end end
defp added_filter(query, %{"added" => "1"}), defp added_filter(query, %{"added" => "1"}),

View file

@ -26,10 +26,10 @@ defmodule PhilomenaWeb.TagController do
Tag Tag
) )
render(conn, "index.html", tags: tags) render(conn, "index.html", title: "Tags", tags: tags)
else else
{:error, msg} -> {:error, msg} ->
render(conn, "index.html", tags: [], error: msg) render(conn, "index.html", title: "Tags", tags: [], error: msg)
end end
end end
@ -65,13 +65,14 @@ defmodule PhilomenaWeb.TagController do
dnp_entries: dnp_entries, dnp_entries: dnp_entries,
interactions: interactions, interactions: interactions,
images: images, images: images,
layout_class: "layout--wide" layout_class: "layout--wide",
title: "#{tag.name} - Tags"
) )
end end
def edit(conn, _params) do def edit(conn, _params) do
changeset = Tags.change_tag(conn.assigns.tag) changeset = Tags.change_tag(conn.assigns.tag)
render(conn, "edit.html", changeset: changeset) render(conn, "edit.html", title: "Editing Tag", changeset: changeset)
end end
def update(conn, %{"tag" => tag_params}) do def update(conn, %{"tag" => tag_params}) do

View file

@ -14,6 +14,7 @@ defmodule PhilomenaWeb.Topic.Post.HistoryController do
plug PhilomenaWeb.LoadPostPlug plug PhilomenaWeb.LoadPostPlug
def index(conn, _params) do def index(conn, _params) do
topic = conn.assigns.topic
post = conn.assigns.post post = conn.assigns.post
versions = versions =
@ -24,6 +25,6 @@ defmodule PhilomenaWeb.Topic.Post.HistoryController do
|> Repo.all() |> Repo.all()
|> Versions.load_data_and_associations(post) |> Versions.load_data_and_associations(post)
render(conn, "index.html", versions: versions) render(conn, "index.html", title: "Post History for Post #{post.id} - #{topic.title} - Forums", versions: versions)
end end
end end

View file

@ -43,7 +43,7 @@ defmodule PhilomenaWeb.Topic.PostController do
def edit(conn, _params) do def edit(conn, _params) do
changeset = Posts.change_post(conn.assigns.post) changeset = Posts.change_post(conn.assigns.post)
render(conn, "edit.html", changeset: changeset) render(conn, "edit.html", title: "Editing Post", changeset: changeset)
end end
def update(conn, %{"post" => post_params}) do def update(conn, %{"post" => post_params}) do

View file

@ -72,7 +72,9 @@ defmodule PhilomenaWeb.TopicController do
%Post{} %Post{}
|> Posts.change_post() |> Posts.change_post()
render(conn, "show.html", posts: posts, changeset: changeset, watching: watching) title = "#{topic.title} - #{forum.name} - Forums"
render(conn, "show.html", title: title, posts: posts, changeset: changeset, watching: watching)
end end
def new(conn, _params) do def new(conn, _params) do
@ -80,7 +82,7 @@ defmodule PhilomenaWeb.TopicController do
%Topic{poll: %Poll{options: [%PollOption{}, %PollOption{}]}, posts: [%Post{}]} %Topic{poll: %Poll{options: [%PollOption{}, %PollOption{}]}, posts: [%Post{}]}
|> Topics.change_topic() |> Topics.change_topic()
render(conn, "new.html", changeset: changeset) render(conn, "new.html", title: "New Topic", changeset: changeset)
end end
def create(conn, %{"topic" => topic_params}) do def create(conn, %{"topic" => topic_params}) do