diff --git a/lib/philomena_web/controllers/activity_controller.ex b/lib/philomena_web/controllers/activity_controller.ex index 665d9317..453a4dfa 100644 --- a/lib/philomena_web/controllers/activity_controller.ex +++ b/lib/philomena_web/controllers/activity_controller.ex @@ -92,6 +92,7 @@ defmodule PhilomenaWeb.ActivityController do render( conn, "index.html", + title: "Homepage", images: images, comments: comments, top_scoring: top_scoring, diff --git a/lib/philomena_web/controllers/admin/advert_controller.ex b/lib/philomena_web/controllers/admin/advert_controller.ex index bce97d3e..6890dddc 100644 --- a/lib/philomena_web/controllers/admin/advert_controller.ex +++ b/lib/philomena_web/controllers/admin/advert_controller.ex @@ -15,12 +15,12 @@ defmodule PhilomenaWeb.Admin.AdvertController do |> order_by(desc: :finish_date) |> 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 def new(conn, _params) do changeset = Adverts.change_advert(%Advert{}) - render(conn, "new.html", changeset: changeset) + render(conn, "new.html", title: "New Advert", changeset: changeset) end def create(conn, %{"advert" => advert_params}) do @@ -37,7 +37,7 @@ defmodule PhilomenaWeb.Admin.AdvertController do def edit(conn, _params) do changeset = Adverts.change_advert(conn.assigns.advert) - render(conn, "edit.html", changeset: changeset) + render(conn, "edit.html", title: "Editing Advert", changeset: changeset) end def update(conn, %{"advert" => advert_params}) do diff --git a/lib/philomena_web/controllers/admin/badge_controller.ex b/lib/philomena_web/controllers/admin/badge_controller.ex index 16d0f893..88270f64 100644 --- a/lib/philomena_web/controllers/admin/badge_controller.ex +++ b/lib/philomena_web/controllers/admin/badge_controller.ex @@ -15,12 +15,12 @@ defmodule PhilomenaWeb.Admin.BadgeController do |> order_by(asc: :title) |> Repo.paginate(conn.assigns.scrivener) - render(conn, "index.html", badges: badges) + render(conn, "index.html", title: "Admin - Badges", badges: badges) end def new(conn, _params) do changeset = Badges.change_badge(%Badge{}) - render(conn, "new.html", changeset: changeset) + render(conn, "new.html", title: "New Badge", changeset: changeset) end def create(conn, %{"badge" => badge_params}) do @@ -37,7 +37,7 @@ defmodule PhilomenaWeb.Admin.BadgeController do def edit(conn, _params) do changeset = Badges.change_badge(conn.assigns.badge) - render(conn, "edit.html", changeset: changeset) + render(conn, "edit.html", title: "Editing Badge", changeset: changeset) end def update(conn, %{"badge" => badge_params}) do diff --git a/lib/philomena_web/controllers/admin/dnp_entry_controller.ex b/lib/philomena_web/controllers/admin/dnp_entry_controller.ex index 23448d44..ad0976e0 100644 --- a/lib/philomena_web/controllers/admin/dnp_entry_controller.ex +++ b/lib/philomena_web/controllers/admin/dnp_entry_controller.ex @@ -46,7 +46,7 @@ defmodule PhilomenaWeb.Admin.DnpEntryController do dnp_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 defp verify_authorized(conn, _opts) do diff --git a/lib/philomena_web/controllers/admin/fingerprint_ban_controller.ex b/lib/philomena_web/controllers/admin/fingerprint_ban_controller.ex index e7f14410..0a7d5cd8 100644 --- a/lib/philomena_web/controllers/admin/fingerprint_ban_controller.ex +++ b/lib/philomena_web/controllers/admin/fingerprint_ban_controller.ex @@ -32,12 +32,12 @@ defmodule PhilomenaWeb.Admin.FingerprintBanController do def new(conn, %{"fingerprint" => fingerprint}) do changeset = Bans.change_fingerprint(%FingerprintBan{fingerprint: fingerprint}) - render(conn, "new.html", changeset: changeset) + render(conn, "new.html", title: "New Fingerprint Ban", changeset: changeset) end def new(conn, _params) do changeset = Bans.change_fingerprint(%FingerprintBan{}) - render(conn, "new.html", changeset: changeset) + render(conn, "new.html", title: "New Fingerprint Ban", changeset: changeset) end def create(conn, %{"fingerprint" => fingerprint_ban_params}) do @@ -54,7 +54,7 @@ defmodule PhilomenaWeb.Admin.FingerprintBanController do def edit(conn, _params) do changeset = Bans.change_fingerprint(conn.assigns.fingerprint) - render(conn, "edit.html", changeset: changeset) + render(conn, "edit.html", title: "Editing Fingerprint Ban", changeset: changeset) end def update(conn, %{"fingerprint" => fingerprint_ban_params}) do @@ -84,7 +84,7 @@ defmodule PhilomenaWeb.Admin.FingerprintBanController do |> preload(:banning_user) |> 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 defp verify_authorized(conn, _opts) do diff --git a/lib/philomena_web/controllers/admin/forum_controller.ex b/lib/philomena_web/controllers/admin/forum_controller.ex index 34a091c1..54d58948 100644 --- a/lib/philomena_web/controllers/admin/forum_controller.ex +++ b/lib/philomena_web/controllers/admin/forum_controller.ex @@ -8,12 +8,12 @@ defmodule PhilomenaWeb.Admin.ForumController do plug :load_resource, model: Forum, id_field: "short_name" def index(conn, _params) do - render(conn, "index.html") + render(conn, "index.html", title: "Admin - Forums") end def new(conn, _params) do changeset = Forums.change_forum(%Forum{}) - render(conn, "new.html", changeset: changeset) + render(conn, "new.html", title: "New Forum", changeset: changeset) end def create(conn, %{"forum" => forum_params}) do @@ -30,7 +30,7 @@ defmodule PhilomenaWeb.Admin.ForumController do def edit(conn, _params) do changeset = Forums.change_forum(conn.assigns.forum) - render(conn, "edit.html", changeset: changeset) + render(conn, "edit.html", title: "Editing Forum", changeset: changeset) end def update(conn, %{"forum" => forum_params}) do diff --git a/lib/philomena_web/controllers/admin/mod_note_controller.ex b/lib/philomena_web/controllers/admin/mod_note_controller.ex index 02a5bd94..630cd445 100644 --- a/lib/philomena_web/controllers/admin/mod_note_controller.ex +++ b/lib/philomena_web/controllers/admin/mod_note_controller.ex @@ -33,12 +33,12 @@ defmodule PhilomenaWeb.Admin.ModNoteController do preloaded = Polymorphic.load_polymorphic(mod_notes, notable: [notable_id: :notable_type]) 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 def new(conn, %{"notable_type" => type, "notable_id" => id}) do 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 def create(conn, %{"mod_note" => mod_note_params}) do @@ -55,7 +55,7 @@ defmodule PhilomenaWeb.Admin.ModNoteController do def edit(conn, _params) do 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 def update(conn, %{"mod_note" => mod_note_params}) do diff --git a/lib/philomena_web/controllers/admin/report_controller.ex b/lib/philomena_web/controllers/admin/report_controller.ex index 5a2f032c..1dac7b70 100644 --- a/lib/philomena_web/controllers/admin/report_controller.ex +++ b/lib/philomena_web/controllers/admin/report_controller.ex @@ -16,7 +16,7 @@ defmodule PhilomenaWeb.Admin.ReportController do 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 def index(conn, _params) do @@ -47,14 +47,14 @@ defmodule PhilomenaWeb.Admin.ReportController do |> Repo.all() |> 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 def show(conn, _params) do [report] = Polymorphic.load_polymorphic([conn.assigns.report], reportable: [reportable_id: :reportable_type]) 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 defp load_reports(conn, query) do @@ -88,4 +88,4 @@ defmodule PhilomenaWeb.Admin.ReportController do false -> PhilomenaWeb.NotAuthorizedPlug.call(conn) end end -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/admin/site_notice_controller.ex b/lib/philomena_web/controllers/admin/site_notice_controller.ex index b1ece9da..a6eef65f 100644 --- a/lib/philomena_web/controllers/admin/site_notice_controller.ex +++ b/lib/philomena_web/controllers/admin/site_notice_controller.ex @@ -15,12 +15,12 @@ defmodule PhilomenaWeb.Admin.SiteNoticeController do |> order_by(desc: :start_date) |> 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 def new(conn, _params) do changeset = SiteNotices.change_site_notice(%SiteNotice{}) - render(conn, "new.html", changeset: changeset) + render(conn, "new.html", title: "New Site Notice", changeset: changeset) end def create(conn, %{"site_notice" => site_notice_params}) do @@ -37,7 +37,7 @@ defmodule PhilomenaWeb.Admin.SiteNoticeController do def edit(conn, _params) do 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 def update(conn, %{"site_notice" => site_notice_params}) do diff --git a/lib/philomena_web/controllers/admin/subnet_ban_controller.ex b/lib/philomena_web/controllers/admin/subnet_ban_controller.ex index 38e8db24..bf8706d4 100644 --- a/lib/philomena_web/controllers/admin/subnet_ban_controller.ex +++ b/lib/philomena_web/controllers/admin/subnet_ban_controller.ex @@ -34,12 +34,12 @@ defmodule PhilomenaWeb.Admin.SubnetBanController do def new(conn, %{"specification" => ip}) do {:ok, ip} = EctoNetwork.INET.cast(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 def new(conn, _params) do changeset = Bans.change_subnet(%SubnetBan{}) - render(conn, "new.html", changeset: changeset) + render(conn, "new.html", title: "New Subnet Ban", changeset: changeset) end def create(conn, %{"subnet" => subnet_ban_params}) do @@ -56,7 +56,7 @@ defmodule PhilomenaWeb.Admin.SubnetBanController do def edit(conn, _params) do changeset = Bans.change_subnet(conn.assigns.subnet) - render(conn, "edit.html", changeset: changeset) + render(conn, "edit.html", title: "Editing Subnet Ban", changeset: changeset) end def update(conn, %{"subnet" => subnet_ban_params}) do @@ -86,7 +86,7 @@ defmodule PhilomenaWeb.Admin.SubnetBanController do |> preload(:banning_user) |> 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 defp verify_authorized(conn, _opts) do diff --git a/lib/philomena_web/controllers/admin/user_ban_controller.ex b/lib/philomena_web/controllers/admin/user_ban_controller.ex index 5c6431be..862bf839 100644 --- a/lib/philomena_web/controllers/admin/user_ban_controller.ex +++ b/lib/philomena_web/controllers/admin/user_ban_controller.ex @@ -35,12 +35,12 @@ defmodule PhilomenaWeb.Admin.UserBanController do def new(conn, %{"username" => username}) do changeset = Bans.change_user(%UserBan{username: username}) - render(conn, "new.html", changeset: changeset) + render(conn, "new.html", title: "New User Ban", changeset: changeset) end def new(conn, _params) do changeset = Bans.change_user(%UserBan{}) - render(conn, "new.html", changeset: changeset) + render(conn, "new.html", title: "New User Ban", changeset: changeset) end def create(conn, %{"user" => user_ban_params}) do @@ -57,7 +57,7 @@ defmodule PhilomenaWeb.Admin.UserBanController do def edit(conn, _params) do changeset = Bans.change_user(conn.assigns.user) - render(conn, "edit.html", changeset: changeset) + render(conn, "edit.html", title: "Editing User Ban", changeset: changeset) end def update(conn, %{"user" => user_ban_params}) do @@ -87,7 +87,7 @@ defmodule PhilomenaWeb.Admin.UserBanController do |> preload([:user, :banning_user]) |> 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 defp verify_authorized(conn, _opts) do diff --git a/lib/philomena_web/controllers/admin/user_controller.ex b/lib/philomena_web/controllers/admin/user_controller.ex index b5d6a50b..bdf6921c 100644 --- a/lib/philomena_web/controllers/admin/user_controller.ex +++ b/lib/philomena_web/controllers/admin/user_controller.ex @@ -39,12 +39,12 @@ defmodule PhilomenaWeb.Admin.UserController do |> order_by(desc: :id) |> 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 def edit(conn, _params) do changeset = Users.change_user(conn.assigns.user) - render(conn, "edit.html", changeset: changeset) + render(conn, "edit.html", title: "Editing User", changeset: changeset) end def update(conn, %{"user" => user_params}) do diff --git a/lib/philomena_web/controllers/admin/user_link_controller.ex b/lib/philomena_web/controllers/admin/user_link_controller.ex index 6b75285b..c3770538 100644 --- a/lib/philomena_web/controllers/admin/user_link_controller.ex +++ b/lib/philomena_web/controllers/admin/user_link_controller.ex @@ -33,7 +33,7 @@ defmodule PhilomenaWeb.Admin.UserLinkController do |> preload([:tag, :verified_by_user, :contacted_by_user, user: [:linked_tags, awards: :badge]]) |> Repo.paginate(conn.assigns.scrivener) - render(conn, "index.html", user_links: links) + render(conn, "index.html", title: "Admin - User Links", user_links: links) end defp verify_authorized(conn, _opts) do @@ -42,4 +42,4 @@ defmodule PhilomenaWeb.Admin.UserLinkController do false -> PhilomenaWeb.NotAuthorizedPlug.call(conn) end end -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/avatar_controller.ex b/lib/philomena_web/controllers/avatar_controller.ex index 9ae4b5c4..d6106b6c 100644 --- a/lib/philomena_web/controllers/avatar_controller.ex +++ b/lib/philomena_web/controllers/avatar_controller.ex @@ -8,7 +8,7 @@ defmodule PhilomenaWeb.AvatarController do def edit(conn, _params) do changeset = Users.change_user(conn.assigns.current_user) - render(conn, "edit.html", changeset: changeset) + render(conn, "edit.html", title: "Editing Avatar", changeset: changeset) end def update(conn, %{"user" => user_params}) do @@ -30,4 +30,4 @@ defmodule PhilomenaWeb.AvatarController do |> put_flash(:info, "Successfully removed avatar.") |> redirect(to: Routes.avatar_path(conn, :edit)) end -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/channel_controller.ex b/lib/philomena_web/controllers/channel_controller.ex index 4780f872..e2508879 100644 --- a/lib/philomena_web/controllers/channel_controller.ex +++ b/lib/philomena_web/controllers/channel_controller.ex @@ -20,7 +20,7 @@ defmodule PhilomenaWeb.ChannelController do 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 def show(conn, _params) do diff --git a/lib/philomena_web/controllers/comment_controller.ex b/lib/philomena_web/controllers/comment_controller.ex index b665fb3a..5bbf7d40 100644 --- a/lib/philomena_web/controllers/comment_controller.ex +++ b/lib/philomena_web/controllers/comment_controller.ex @@ -37,6 +37,6 @@ defmodule PhilomenaWeb.CommentController do comments = %{comments | entries: Enum.zip(rendered, comments.entries)} - render(conn, "index.html", comments: comments) + render(conn, "index.html", title: "Comments", comments: comments) end end diff --git a/lib/philomena_web/controllers/commission_controller.ex b/lib/philomena_web/controllers/commission_controller.ex index 9f326963..7444ca47 100644 --- a/lib/philomena_web/controllers/commission_controller.ex +++ b/lib/philomena_web/controllers/commission_controller.ex @@ -12,7 +12,7 @@ defmodule PhilomenaWeb.CommissionController do commission_search(params["commission"]) |> 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 defp commission_search(attrs) when is_map(attrs) do @@ -96,4 +96,4 @@ defmodule PhilomenaWeb.CommissionController do Pow.Plug.assign_current_user(conn, user, config) end end -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/conversation/report_controller.ex b/lib/philomena_web/controllers/conversation/report_controller.ex index 97a0d38c..f6b12113 100644 --- a/lib/philomena_web/controllers/conversation/report_controller.ex +++ b/lib/philomena_web/controllers/conversation/report_controller.ex @@ -22,7 +22,7 @@ defmodule PhilomenaWeb.Conversation.ReportController do conn |> 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 def create(conn, params) do @@ -31,4 +31,4 @@ defmodule PhilomenaWeb.Conversation.ReportController do ReportController.create(conn, action, conversation, "Conversation", params) end -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/conversation_controller.ex b/lib/philomena_web/controllers/conversation_controller.ex index 71e2edd6..ea34332a 100644 --- a/lib/philomena_web/controllers/conversation_controller.ex +++ b/lib/philomena_web/controllers/conversation_controller.ex @@ -22,7 +22,7 @@ defmodule PhilomenaWeb.ConversationController do |> select([c, cnt], {c, cnt.count}) |> Repo.paginate(conn.assigns.scrivener) - render(conn, "index.html", conversations: conversations) + render(conn, "index.html", title: "Conversations", conversations: conversations) end def show(conn, _params) do @@ -53,7 +53,7 @@ defmodule PhilomenaWeb.ConversationController do # Update the conversation ticker in the header 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 def new(conn, params) do @@ -61,7 +61,7 @@ defmodule PhilomenaWeb.ConversationController do %Conversation{recipient: params["recipient"], messages: [%Message{}]} |> Conversations.change_conversation() - render(conn, "new.html", changeset: changeset) + render(conn, "new.html", title: "New Conversation", changeset: changeset) end def create(conn, %{"conversation" => conversation_params}) do @@ -78,4 +78,4 @@ defmodule PhilomenaWeb.ConversationController do |> render("new.html", changeset: changeset) end end -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/dnp_entry_controller.ex b/lib/philomena_web/controllers/dnp_entry_controller.ex index be2de467..5f4eab5e 100644 --- a/lib/philomena_web/controllers/dnp_entry_controller.ex +++ b/lib/philomena_web/controllers/dnp_entry_controller.ex @@ -39,7 +39,7 @@ defmodule PhilomenaWeb.DnpEntryController do dnp_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 def show(conn, _params) do @@ -55,12 +55,12 @@ defmodule PhilomenaWeb.DnpEntryController do 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 def new(conn, _params) do 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 def create(conn, %{"dnp_entry" => dnp_entry_params}) do @@ -77,14 +77,14 @@ defmodule PhilomenaWeb.DnpEntryController do def edit(conn, _params) do 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 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 {:ok, dnp_entry} -> 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)) {:error, changeset} -> diff --git a/lib/philomena_web/controllers/duplicate_report_controller.ex b/lib/philomena_web/controllers/duplicate_report_controller.ex index 06773784..0879b5d4 100644 --- a/lib/philomena_web/controllers/duplicate_report_controller.ex +++ b/lib/philomena_web/controllers/duplicate_report_controller.ex @@ -26,7 +26,7 @@ defmodule PhilomenaWeb.DuplicateReportController do |> order_by(desc: :created_at) |> 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 def create(conn, %{"duplicate_report" => duplicate_report_params}) do @@ -50,7 +50,7 @@ defmodule PhilomenaWeb.DuplicateReportController do def show(conn, _params) do 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 defp wrap(list) when is_list(list), do: list diff --git a/lib/philomena_web/controllers/filter_controller.ex b/lib/philomena_web/controllers/filter_controller.ex index dbf76432..a0a68bd5 100644 --- a/lib/philomena_web/controllers/filter_controller.ex +++ b/lib/philomena_web/controllers/filter_controller.ex @@ -28,7 +28,7 @@ defmodule PhilomenaWeb.FilterController do |> preload(:user) |> 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 def show(conn, _params) do @@ -46,13 +46,12 @@ defmodule PhilomenaWeb.FilterController do |> order_by(asc: :name) |> 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 def new(conn, _params) do changeset = Filters.change_filter(%Filter{}) - - render(conn, "new.html", changeset: changeset) + render(conn, "new.html", title: "New Filter", changeset: changeset) end def create(conn, %{"filter" => filter_params}) do @@ -75,7 +74,7 @@ defmodule PhilomenaWeb.FilterController do 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 def update(conn, %{"filter" => filter_params}) do diff --git a/lib/philomena_web/controllers/fingerprint_profile_controller.ex b/lib/philomena_web/controllers/fingerprint_profile_controller.ex index 0c230516..ee5010fd 100644 --- a/lib/philomena_web/controllers/fingerprint_profile_controller.ex +++ b/lib/philomena_web/controllers/fingerprint_profile_controller.ex @@ -21,7 +21,7 @@ defmodule PhilomenaWeb.FingerprintProfileController do |> where(fingerprint: ^fingerprint) |> 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 defp authorize_ip(conn, _opts) do diff --git a/lib/philomena_web/controllers/forum_controller.ex b/lib/philomena_web/controllers/forum_controller.ex index 7eac8537..aa44c8a8 100644 --- a/lib/philomena_web/controllers/forum_controller.ex +++ b/lib/philomena_web/controllers/forum_controller.ex @@ -18,7 +18,7 @@ defmodule PhilomenaWeb.ForumController do 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 def show(conn, %{"id" => _id}) do @@ -35,6 +35,6 @@ defmodule PhilomenaWeb.ForumController do 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 diff --git a/lib/philomena_web/controllers/gallery/report_controller.ex b/lib/philomena_web/controllers/gallery/report_controller.ex index 18c953bf..d2d812f2 100644 --- a/lib/philomena_web/controllers/gallery/report_controller.ex +++ b/lib/philomena_web/controllers/gallery/report_controller.ex @@ -22,7 +22,7 @@ defmodule PhilomenaWeb.Gallery.ReportController do conn |> 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 def create(conn, params) do @@ -31,4 +31,4 @@ defmodule PhilomenaWeb.Gallery.ReportController do ReportController.create(conn, action, gallery, "Gallery", params) end -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/gallery_controller.ex b/lib/philomena_web/controllers/gallery_controller.ex index b0852975..92bb6844 100644 --- a/lib/philomena_web/controllers/gallery_controller.ex +++ b/lib/philomena_web/controllers/gallery_controller.ex @@ -27,7 +27,7 @@ defmodule PhilomenaWeb.GalleryController do 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 def show(conn, _params) do @@ -49,12 +49,12 @@ defmodule PhilomenaWeb.GalleryController do |> NotificationCountPlug.call([]) |> Map.put(:params, params) |> 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 def new(conn, _params) do changeset = Galleries.change_gallery(%Gallery{}) - render(conn, "new.html", changeset: changeset) + render(conn, "new.html", title: "New Gallery", changeset: changeset) end def create(conn, %{"gallery" => gallery_params}) do @@ -78,7 +78,7 @@ defmodule PhilomenaWeb.GalleryController do gallery = conn.assigns.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 def update(conn, %{"gallery" => gallery_params}) do diff --git a/lib/philomena_web/controllers/image/comment/history_controller.ex b/lib/philomena_web/controllers/image/comment/history_controller.ex index 1c7f409e..be1afe2d 100644 --- a/lib/philomena_web/controllers/image/comment/history_controller.ex +++ b/lib/philomena_web/controllers/image/comment/history_controller.ex @@ -13,6 +13,7 @@ defmodule PhilomenaWeb.Image.Comment.HistoryController do plug PhilomenaWeb.LoadCommentPlug def index(conn, _params) do + image = conn.assigns.image comment = conn.assigns.comment versions = @@ -23,6 +24,6 @@ defmodule PhilomenaWeb.Image.Comment.HistoryController do |> Repo.all() |> 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 diff --git a/lib/philomena_web/controllers/image/comment/report_controller.ex b/lib/philomena_web/controllers/image/comment/report_controller.ex index 6cb85df4..ee5e8927 100644 --- a/lib/philomena_web/controllers/image/comment/report_controller.ex +++ b/lib/philomena_web/controllers/image/comment/report_controller.ex @@ -25,7 +25,7 @@ defmodule PhilomenaWeb.Image.Comment.ReportController do conn |> 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 def create(conn, params) do diff --git a/lib/philomena_web/controllers/image/comment_controller.ex b/lib/philomena_web/controllers/image/comment_controller.ex index 8180d3c8..4f9de241 100644 --- a/lib/philomena_web/controllers/image/comment_controller.ex +++ b/lib/philomena_web/controllers/image/comment_controller.ex @@ -89,7 +89,7 @@ defmodule PhilomenaWeb.Image.CommentController do conn.assigns.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 def update(conn, %{"comment" => comment_params}) do diff --git a/lib/philomena_web/controllers/image/report_controller.ex b/lib/philomena_web/controllers/image/report_controller.ex index 11fa696c..e6b99342 100644 --- a/lib/philomena_web/controllers/image/report_controller.ex +++ b/lib/philomena_web/controllers/image/report_controller.ex @@ -22,7 +22,7 @@ defmodule PhilomenaWeb.Image.ReportController do conn |> 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 def create(conn, params) do @@ -31,4 +31,4 @@ defmodule PhilomenaWeb.Image.ReportController do ReportController.create(conn, action, image, "Image", params) end -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/image/scratchpad_controller.ex b/lib/philomena_web/controllers/image/scratchpad_controller.ex index 09040150..80e7ce8b 100644 --- a/lib/philomena_web/controllers/image/scratchpad_controller.ex +++ b/lib/philomena_web/controllers/image/scratchpad_controller.ex @@ -9,7 +9,7 @@ defmodule PhilomenaWeb.Image.ScratchpadController do def edit(conn, _params) do changeset = Images.change_image(conn.assigns.image) - render(conn, "edit.html", changeset: changeset) + render(conn, "edit.html", title: "Editing Moderation Notes", changeset: changeset) end def update(conn, %{"image" => image_params}) do diff --git a/lib/philomena_web/controllers/image/source_change_controller.ex b/lib/philomena_web/controllers/image/source_change_controller.ex index 2fcd1c60..744a0764 100644 --- a/lib/philomena_web/controllers/image/source_change_controller.ex +++ b/lib/philomena_web/controllers/image/source_change_controller.ex @@ -19,6 +19,6 @@ defmodule PhilomenaWeb.Image.SourceChangeController do |> order_by(desc: :created_at) |> 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 \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/image/tag_change_controller.ex b/lib/philomena_web/controllers/image/tag_change_controller.ex index 903a7051..ee6c6847 100644 --- a/lib/philomena_web/controllers/image/tag_change_controller.ex +++ b/lib/philomena_web/controllers/image/tag_change_controller.ex @@ -20,7 +20,7 @@ defmodule PhilomenaWeb.Image.TagChangeController do |> order_by(desc: :created_at) |> 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 defp added_filter(query, %{"added" => "1"}), @@ -29,4 +29,4 @@ defmodule PhilomenaWeb.Image.TagChangeController do do: where(query, added: false) defp added_filter(query, _params), do: query -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/image_controller.ex b/lib/philomena_web/controllers/image_controller.ex index 0032afc2..eb94676c 100644 --- a/lib/philomena_web/controllers/image_controller.ex +++ b/lib/philomena_web/controllers/image_controller.ex @@ -26,7 +26,7 @@ defmodule PhilomenaWeb.ImageController do interactions = 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 def show(conn, %{"id" => _id}) do @@ -83,7 +83,8 @@ defmodule PhilomenaWeb.ImageController do description: description, interactions: interactions, watching: watching, - layout_class: "layout--wide" + layout_class: "layout--wide", + title: "Image ##{image.id} - #{image.tag_list_cache}" ] if image.hidden_from_users do @@ -98,7 +99,7 @@ defmodule PhilomenaWeb.ImageController do %Image{} |> Images.change_image() - render(conn, "new.html", changeset: changeset) + render(conn, "new.html", title: "New Image", changeset: changeset) end def create(conn, %{"image" => image_params}) do diff --git a/lib/philomena_web/controllers/ip_profile_controller.ex b/lib/philomena_web/controllers/ip_profile_controller.ex index d828c346..e93e7d48 100644 --- a/lib/philomena_web/controllers/ip_profile_controller.ex +++ b/lib/philomena_web/controllers/ip_profile_controller.ex @@ -23,7 +23,7 @@ defmodule PhilomenaWeb.IpProfileController do |> where([s], fragment("? >>= ?", s.specification, ^ip)) |> 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 defp authorize_ip(conn, _opts) do @@ -32,4 +32,4 @@ defmodule PhilomenaWeb.IpProfileController do true -> conn end end -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/notification_controller.ex b/lib/philomena_web/controllers/notification_controller.ex index bef8cd3f..e4fcc311 100644 --- a/lib/philomena_web/controllers/notification_controller.ex +++ b/lib/philomena_web/controllers/notification_controller.ex @@ -28,6 +28,6 @@ defmodule PhilomenaWeb.NotificationController do notifications = %{notifications | entries: entries} - render(conn, "index.html", notifications: notifications) + render(conn, "index.html", title: "Notification Area", notifications: notifications) end -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/page/history_controller.ex b/lib/philomena_web/controllers/page/history_controller.ex index f3b13f2d..c0e25665 100644 --- a/lib/philomena_web/controllers/page/history_controller.ex +++ b/lib/philomena_web/controllers/page/history_controller.ex @@ -19,7 +19,7 @@ defmodule PhilomenaWeb.Page.HistoryController do |> Repo.all() |> 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 defp generate_differences(pages, current_body) do diff --git a/lib/philomena_web/controllers/page_controller.ex b/lib/philomena_web/controllers/page_controller.ex index 6d330907..dd7a8495 100644 --- a/lib/philomena_web/controllers/page_controller.ex +++ b/lib/philomena_web/controllers/page_controller.ex @@ -7,16 +7,16 @@ defmodule PhilomenaWeb.PageController do plug :load_and_authorize_resource, model: StaticPage, id_field: "slug" def index(conn, _params) do - render(conn, "index.html") + render(conn, "index.html", title: "Pages") end def show(conn, _params) do - render(conn, "show.html") + render(conn, "show.html", title: conn.assigns.page.title) end def new(conn, _params) do changeset = StaticPages.change_static_page(%StaticPage{}) - render(conn, "new.html", changeset: changeset) + render(conn, "new.html", title: "New Page", changeset: changeset) end def create(conn, %{"static_page" => static_page_params}) do @@ -33,7 +33,7 @@ defmodule PhilomenaWeb.PageController do def edit(conn, _params) do 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 def update(conn, %{"static_page" => static_page_params}) do diff --git a/lib/philomena_web/controllers/post_controller.ex b/lib/philomena_web/controllers/post_controller.ex index f5082e30..0bd6ad02 100644 --- a/lib/philomena_web/controllers/post_controller.ex +++ b/lib/philomena_web/controllers/post_controller.ex @@ -39,6 +39,6 @@ defmodule PhilomenaWeb.PostController do posts = %{posts | entries: Enum.zip(rendered, posts.entries)} - render(conn, "index.html", posts: posts) + render(conn, "index.html", title: "Posts", posts: posts) end end diff --git a/lib/philomena_web/controllers/profile/award_controller.ex b/lib/philomena_web/controllers/profile/award_controller.ex index da7ebc43..bbdff47e 100644 --- a/lib/philomena_web/controllers/profile/award_controller.ex +++ b/lib/philomena_web/controllers/profile/award_controller.ex @@ -15,7 +15,7 @@ defmodule PhilomenaWeb.Profile.AwardController do def new(conn, _params) do changeset = Badges.change_badge_award(%Award{}) - render(conn, "new.html", changeset: changeset) + render(conn, "new.html", title: "New Award", changeset: changeset) end def create(conn, %{"award" => award_params}) do @@ -32,7 +32,7 @@ defmodule PhilomenaWeb.Profile.AwardController do def edit(conn, _params) do changeset = Badges.change_badge_award(conn.assigns.award) - render(conn, "edit.html", changeset: changeset) + render(conn, "edit.html", title: "Editing Award", changeset: changeset) end def update(conn, %{"award" => award_params}) do diff --git a/lib/philomena_web/controllers/profile/commission/item_controller.ex b/lib/philomena_web/controllers/profile/commission/item_controller.ex index d1a230e9..fff25fbf 100644 --- a/lib/philomena_web/controllers/profile/commission/item_controller.ex +++ b/lib/philomena_web/controllers/profile/commission/item_controller.ex @@ -16,7 +16,7 @@ defmodule PhilomenaWeb.Profile.Commission.ItemController do commission = user.commission 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 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) 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 def update(conn, %{"id" => id, "item" => item_params}) do @@ -86,4 +86,4 @@ defmodule PhilomenaWeb.Profile.Commission.ItemController do _other -> PhilomenaWeb.NotAuthorizedPlug.call(conn) end end -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/profile/commission/report_controller.ex b/lib/philomena_web/controllers/profile/commission/report_controller.ex index fc85d3b8..6b530977 100644 --- a/lib/philomena_web/controllers/profile/commission/report_controller.ex +++ b/lib/philomena_web/controllers/profile/commission/report_controller.ex @@ -24,7 +24,7 @@ defmodule PhilomenaWeb.Profile.Commission.ReportController do conn |> 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 def create(conn, params) do @@ -41,4 +41,4 @@ defmodule PhilomenaWeb.Profile.Commission.ReportController do false -> conn end end -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/profile/commission_controller.ex b/lib/philomena_web/controllers/profile/commission_controller.ex index 8176eb4b..80aacb58 100644 --- a/lib/philomena_web/controllers/profile/commission_controller.ex +++ b/lib/philomena_web/controllers/profile/commission_controller.ex @@ -47,12 +47,12 @@ defmodule PhilomenaWeb.Profile.CommissionController do 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 def new(conn, _params) do changeset = Commissions.change_commission(%Commission{}) - render(conn, "new.html", changeset: changeset) + render(conn, "new.html", title: "New Commission", changeset: changeset) end def create(conn, %{"commission" => commission_params}) do @@ -71,7 +71,7 @@ defmodule PhilomenaWeb.Profile.CommissionController do def edit(conn, _params) do changeset = Commissions.change_commission(conn.assigns.user.commission) - render(conn, "edit.html", changeset: changeset) + render(conn, "edit.html", title: "Editing Commission", changeset: changeset) end def update(conn, %{"commission" => commission_params}) do @@ -130,4 +130,4 @@ defmodule PhilomenaWeb.Profile.CommissionController do |> redirect(to: Routes.commission_path(conn, :index)) end end -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/profile/description_controller.ex b/lib/philomena_web/controllers/profile/description_controller.ex index 0d8f4068..816968ff 100644 --- a/lib/philomena_web/controllers/profile/description_controller.ex +++ b/lib/philomena_web/controllers/profile/description_controller.ex @@ -10,7 +10,7 @@ defmodule PhilomenaWeb.Profile.DescriptionController do def edit(conn, _params) do 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 def update(conn, %{"user" => user_params}) do @@ -26,4 +26,4 @@ defmodule PhilomenaWeb.Profile.DescriptionController do render(conn, "edit.html", changeset: changeset) end end -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/profile/report_controller.ex b/lib/philomena_web/controllers/profile/report_controller.ex index 613d2d24..c909c2e2 100644 --- a/lib/philomena_web/controllers/profile/report_controller.ex +++ b/lib/philomena_web/controllers/profile/report_controller.ex @@ -22,7 +22,7 @@ defmodule PhilomenaWeb.Profile.ReportController do conn |> 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 def create(conn, params) do @@ -31,4 +31,4 @@ defmodule PhilomenaWeb.Profile.ReportController do ReportController.create(conn, action, user, "User", params) end -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/profile/source_change_controller.ex b/lib/philomena_web/controllers/profile/source_change_controller.ex index 3467614a..1346cb64 100644 --- a/lib/philomena_web/controllers/profile/source_change_controller.ex +++ b/lib/philomena_web/controllers/profile/source_change_controller.ex @@ -21,6 +21,6 @@ defmodule PhilomenaWeb.Profile.SourceChangeController do |> order_by(desc: :created_at) |> 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 \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/profile/tag_change_controller.ex b/lib/philomena_web/controllers/profile/tag_change_controller.ex index fcc61428..1cafc69e 100644 --- a/lib/philomena_web/controllers/profile/tag_change_controller.ex +++ b/lib/philomena_web/controllers/profile/tag_change_controller.ex @@ -22,7 +22,7 @@ defmodule PhilomenaWeb.Profile.TagChangeController do |> order_by(desc: :created_at) |> 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 defp added_filter(query, %{"added" => "1"}), @@ -31,4 +31,4 @@ defmodule PhilomenaWeb.Profile.TagChangeController do do: where(query, added: false) defp added_filter(query, _params), do: query -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/profile/user_link_controller.ex b/lib/philomena_web/controllers/profile/user_link_controller.ex index 694d18a0..c0f7e7a9 100644 --- a/lib/philomena_web/controllers/profile/user_link_controller.ex +++ b/lib/philomena_web/controllers/profile/user_link_controller.ex @@ -27,12 +27,12 @@ defmodule PhilomenaWeb.Profile.UserLinkController do |> where(user_id: ^user.id) |> Repo.all() - render(conn, "index.html", user_links: user_links) + render(conn, "index.html", title: "User Links", user_links: user_links) end def new(conn, _params) do changeset = UserLinks.change_user_link(%UserLink{}) - render(conn, "new.html", changeset: changeset) + render(conn, "new.html", title: "New User Link", changeset: changeset) end def create(conn, %{"user_link" => user_link_params}) do @@ -49,13 +49,13 @@ defmodule PhilomenaWeb.Profile.UserLinkController do def show(conn, _params) do 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 def edit(conn, _params) do 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 def update(conn, %{"user_link" => user_link_params}) do diff --git a/lib/philomena_web/controllers/profile_controller.ex b/lib/philomena_web/controllers/profile_controller.ex index 8bb5df4e..325c6939 100644 --- a/lib/philomena_web/controllers/profile_controller.ex +++ b/lib/philomena_web/controllers/profile_controller.ex @@ -137,7 +137,8 @@ defmodule PhilomenaWeb.ProfileController do about_me: about_me, tags: tags, bans: bans, - layout_class: "layout--medium" + layout_class: "layout--medium", + title: "#{user.name}'s profile" ) end diff --git a/lib/philomena_web/controllers/registration/totp_controller.ex b/lib/philomena_web/controllers/registration/totp_controller.ex index d3aaede6..3d76bc66 100644 --- a/lib/philomena_web/controllers/registration/totp_controller.ex +++ b/lib/philomena_web/controllers/registration/totp_controller.ex @@ -20,7 +20,7 @@ defmodule PhilomenaWeb.Registration.TotpController do changeset = Pow.Plug.change_user(conn) secret = User.totp_secret(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 @@ -44,4 +44,4 @@ defmodule PhilomenaWeb.Registration.TotpController do |> redirect(to: Routes.registration_totp_path(conn, :edit)) end end -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/report_controller.ex b/lib/philomena_web/controllers/report_controller.ex index 6c99f96d..b6afb46a 100644 --- a/lib/philomena_web/controllers/report_controller.ex +++ b/lib/philomena_web/controllers/report_controller.ex @@ -21,7 +21,7 @@ defmodule PhilomenaWeb.ReportController do reports = %{reports | entries: polymorphic} - render(conn, "index.html", reports: reports) + render(conn, "index.html", title: "My Reports", reports: reports) end # Make sure that you load the resource in your controller: @@ -89,4 +89,4 @@ defmodule PhilomenaWeb.ReportController do defp redirect_path(_conn, nil), do: "/" defp redirect_path(conn, _user), do: Routes.report_path(conn, :index) -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/search/reverse_controller.ex b/lib/philomena_web/controllers/search/reverse_controller.ex index 3ab6d4e7..247a3214 100644 --- a/lib/philomena_web/controllers/search/reverse_controller.ex +++ b/lib/philomena_web/controllers/search/reverse_controller.ex @@ -6,13 +6,13 @@ defmodule PhilomenaWeb.Search.ReverseController do plug PhilomenaWeb.ScraperPlug, [params_key: "image", params_name: "image"] when action in [:create] def index(conn, _params) do - render(conn, "index.html", images: nil) + render(conn, "index.html", title: "Reverse Search", images: nil) end def create(conn, %{"image" => image_params}) do images = ImageReverse.images(image_params) conn - |> render("index.html", images: images) + |> render("index.html", title: "Reverse Search", images: images) end -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/search_controller.ex b/lib/philomena_web/controllers/search_controller.ex index 07bd656b..ad5f1078 100644 --- a/lib/philomena_web/controllers/search_controller.ex +++ b/lib/philomena_web/controllers/search_controller.ex @@ -15,10 +15,10 @@ defmodule PhilomenaWeb.SearchController do Interactions.user_interactions(images, user) 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} -> - 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 diff --git a/lib/philomena_web/controllers/session/totp_controller.ex b/lib/philomena_web/controllers/session/totp_controller.ex index 05d3dabd..51dae78a 100644 --- a/lib/philomena_web/controllers/session/totp_controller.ex +++ b/lib/philomena_web/controllers/session/totp_controller.ex @@ -7,7 +7,7 @@ defmodule PhilomenaWeb.Session.TotpController do def new(conn, _params) do changeset = Pow.Plug.change_user(conn) - render(conn, "new.html", changeset: changeset) + render(conn, "new.html", title: "Two-Factor Authentication", changeset: changeset) end def create(conn, params) do @@ -31,4 +31,4 @@ defmodule PhilomenaWeb.Session.TotpController do |> redirect(to: "/") end end -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/setting_controller.ex b/lib/philomena_web/controllers/setting_controller.ex index 426a80a2..9294374c 100644 --- a/lib/philomena_web/controllers/setting_controller.ex +++ b/lib/philomena_web/controllers/setting_controller.ex @@ -12,7 +12,7 @@ defmodule PhilomenaWeb.SettingController do |> TagList.assign_tag_list(:watched_tag_ids, :watched_tag_list) |> Users.change_user() - render(conn, "edit.html", changeset: changeset) + render(conn, "edit.html", title: "Editing Settings", changeset: changeset) end def update(conn, %{"user" => user_params}) do @@ -56,4 +56,4 @@ defmodule PhilomenaWeb.SettingController do error end end -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/staff_controller.ex b/lib/philomena_web/controllers/staff_controller.ex index 69b5d0df..3aa11089 100644 --- a/lib/philomena_web/controllers/staff_controller.ex +++ b/lib/philomena_web/controllers/staff_controller.ex @@ -20,6 +20,6 @@ defmodule PhilomenaWeb.StaffController do "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 diff --git a/lib/philomena_web/controllers/stat_controller.ex b/lib/philomena_web/controllers/stat_controller.ex index d633dff4..9bf1e726 100644 --- a/lib/philomena_web/controllers/stat_controller.ex +++ b/lib/philomena_web/controllers/stat_controller.ex @@ -41,7 +41,8 @@ defmodule PhilomenaWeb.StatController do gallery_count: gallery_count, gallery_size: gallery_size, distinct_creators: distinct_creators, - images_in_galleries: images_in_galleries + images_in_galleries: images_in_galleries, + title: "Statistics" ) end diff --git a/lib/philomena_web/controllers/tag/alias_controller.ex b/lib/philomena_web/controllers/tag/alias_controller.ex index a28c02ec..6b687a2a 100644 --- a/lib/philomena_web/controllers/tag/alias_controller.ex +++ b/lib/philomena_web/controllers/tag/alias_controller.ex @@ -9,7 +9,7 @@ defmodule PhilomenaWeb.Tag.AliasController do def edit(conn, _params) do changeset = Tags.change_tag(conn.assigns.tag) - render(conn, "edit.html", changeset: changeset) + render(conn, "edit.html", title: "Editing Tag Alias", changeset: changeset) end def update(conn, %{"tag" => tag_params}) do diff --git a/lib/philomena_web/controllers/tag/image_controller.ex b/lib/philomena_web/controllers/tag/image_controller.ex index f82670b3..e9fb8ccc 100644 --- a/lib/philomena_web/controllers/tag/image_controller.ex +++ b/lib/philomena_web/controllers/tag/image_controller.ex @@ -9,7 +9,7 @@ defmodule PhilomenaWeb.Tag.ImageController do def edit(conn, _params) do 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 def update(conn, %{"tag" => tag_params}) do diff --git a/lib/philomena_web/controllers/tag/tag_change_controller.ex b/lib/philomena_web/controllers/tag/tag_change_controller.ex index 1850f1b3..2bc0d2c2 100644 --- a/lib/philomena_web/controllers/tag/tag_change_controller.ex +++ b/lib/philomena_web/controllers/tag/tag_change_controller.ex @@ -20,7 +20,7 @@ defmodule PhilomenaWeb.Tag.TagChangeController do |> order_by(desc: :created_at) |> 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 defp added_filter(query, %{"added" => "1"}), @@ -29,4 +29,4 @@ defmodule PhilomenaWeb.Tag.TagChangeController do do: where(query, added: false) defp added_filter(query, _params), do: query -end \ No newline at end of file +end diff --git a/lib/philomena_web/controllers/tag_controller.ex b/lib/philomena_web/controllers/tag_controller.ex index 8b6bf541..b5fe748f 100644 --- a/lib/philomena_web/controllers/tag_controller.ex +++ b/lib/philomena_web/controllers/tag_controller.ex @@ -26,10 +26,10 @@ defmodule PhilomenaWeb.TagController do Tag ) - render(conn, "index.html", tags: tags) + render(conn, "index.html", title: "Tags", tags: tags) else {:error, msg} -> - render(conn, "index.html", tags: [], error: msg) + render(conn, "index.html", title: "Tags", tags: [], error: msg) end end @@ -65,13 +65,14 @@ defmodule PhilomenaWeb.TagController do dnp_entries: dnp_entries, interactions: interactions, images: images, - layout_class: "layout--wide" + layout_class: "layout--wide", + title: "#{tag.name} - Tags" ) end def edit(conn, _params) do changeset = Tags.change_tag(conn.assigns.tag) - render(conn, "edit.html", changeset: changeset) + render(conn, "edit.html", title: "Editing Tag", changeset: changeset) end def update(conn, %{"tag" => tag_params}) do diff --git a/lib/philomena_web/controllers/topic/post/history_controller.ex b/lib/philomena_web/controllers/topic/post/history_controller.ex index 3a6947a2..bc8bd4c8 100644 --- a/lib/philomena_web/controllers/topic/post/history_controller.ex +++ b/lib/philomena_web/controllers/topic/post/history_controller.ex @@ -14,6 +14,7 @@ defmodule PhilomenaWeb.Topic.Post.HistoryController do plug PhilomenaWeb.LoadPostPlug def index(conn, _params) do + topic = conn.assigns.topic post = conn.assigns.post versions = @@ -24,6 +25,6 @@ defmodule PhilomenaWeb.Topic.Post.HistoryController do |> Repo.all() |> 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 diff --git a/lib/philomena_web/controllers/topic/post_controller.ex b/lib/philomena_web/controllers/topic/post_controller.ex index b046921a..feef4aaf 100644 --- a/lib/philomena_web/controllers/topic/post_controller.ex +++ b/lib/philomena_web/controllers/topic/post_controller.ex @@ -43,7 +43,7 @@ defmodule PhilomenaWeb.Topic.PostController do def edit(conn, _params) do changeset = Posts.change_post(conn.assigns.post) - render(conn, "edit.html", changeset: changeset) + render(conn, "edit.html", title: "Editing Post", changeset: changeset) end def update(conn, %{"post" => post_params}) do diff --git a/lib/philomena_web/controllers/topic_controller.ex b/lib/philomena_web/controllers/topic_controller.ex index 36dd46d7..b2aab648 100644 --- a/lib/philomena_web/controllers/topic_controller.ex +++ b/lib/philomena_web/controllers/topic_controller.ex @@ -72,7 +72,9 @@ defmodule PhilomenaWeb.TopicController do %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 def new(conn, _params) do @@ -80,7 +82,7 @@ defmodule PhilomenaWeb.TopicController do %Topic{poll: %Poll{options: [%PollOption{}, %PollOption{}]}, posts: [%Post{}]} |> Topics.change_topic() - render(conn, "new.html", changeset: changeset) + render(conn, "new.html", title: "New Topic", changeset: changeset) end def create(conn, %{"topic" => topic_params}) do