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(
conn,
"index.html",
title: "Homepage",
images: images,
comments: comments,
top_scoring: top_scoring,

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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
end

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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
end

View file

@ -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
end

View file

@ -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

View file

@ -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

View file

@ -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
end

View file

@ -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
end

View file

@ -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
end

View file

@ -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} ->

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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
end

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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
end

View file

@ -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

View file

@ -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
end

View file

@ -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
end

View file

@ -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

View file

@ -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
end

View file

@ -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
end

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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
end

View file

@ -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
end

View file

@ -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
end

View file

@ -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
end

View file

@ -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
end

View file

@ -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
end

View file

@ -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
end

View file

@ -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

View file

@ -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

View file

@ -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
end

View file

@ -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
end

View file

@ -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
end

View file

@ -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

View file

@ -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
end

View file

@ -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
end

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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
end

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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