diff --git a/lib/atomic_web/live/activity_live/edit.ex b/lib/atomic_web/live/activity_live/edit.ex index a8c09a6fa..f94559f80 100644 --- a/lib/atomic_web/live/activity_live/edit.ex +++ b/lib/atomic_web/live/activity_live/edit.ex @@ -13,20 +13,8 @@ defmodule AtomicWeb.ActivityLive.Edit do def handle_params(%{"id" => id}, _, socket) do activity = Activities.get_activity!(id, [:speakers]) - entries = [ - %{ - name: gettext("Activities"), - route: Routes.activity_index_path(socket, :index) - }, - %{ - name: gettext("Edit Activity"), - route: Routes.activity_edit_path(socket, :edit, activity.organization_id, id) - } - ] - {:noreply, socket - |> assign(:breadcrumb_entries, entries) |> assign(:current_page, :activities) |> assign(:page_title, gettext("Edit Activity")) |> assign(:activity, activity)} diff --git a/lib/atomic_web/live/activity_live/index.ex b/lib/atomic_web/live/activity_live/index.ex index d441a3c09..7cd507a61 100644 --- a/lib/atomic_web/live/activity_live/index.ex +++ b/lib/atomic_web/live/activity_live/index.ex @@ -15,20 +15,12 @@ defmodule AtomicWeb.ActivityLive.Index do @impl true def handle_params(params, _, socket) do - entries = [ - %{ - name: gettext("Activities"), - route: Routes.activity_index_path(socket, :index) - } - ] - activities_with_flop = list_activities(socket, params) {:noreply, socket |> assign(:page_title, gettext("Activities")) |> assign(:current_page, :activities) - |> assign(:breadcrumb_entries, entries) |> assign(:current_tab, current_tab(socket, params)) |> assign(:params, params) |> assign(activities_with_flop) diff --git a/lib/atomic_web/live/activity_live/new.ex b/lib/atomic_web/live/activity_live/new.ex index e9aeb356b..c937e286a 100644 --- a/lib/atomic_web/live/activity_live/new.ex +++ b/lib/atomic_web/live/activity_live/new.ex @@ -11,21 +11,9 @@ defmodule AtomicWeb.ActivityLive.New do @impl true def handle_params(%{"organization_id" => organization_id}, _, socket) do - entries = [ - %{ - name: gettext("Activities"), - route: Routes.activity_index_path(socket, :index) - }, - %{ - name: gettext("New Activity"), - route: Routes.activity_new_path(socket, :new, socket.assigns.current_organization) - } - ] - {:noreply, socket |> assign(:page_title, gettext("New Activity")) - |> assign(:breadcrumb_entries, entries) |> assign(:current_page, :activities) |> assign(:activity, %Activity{organization_id: organization_id})} end diff --git a/lib/atomic_web/live/activity_live/show.ex b/lib/atomic_web/live/activity_live/show.ex index 883162df5..bea1ad5ee 100644 --- a/lib/atomic_web/live/activity_live/show.ex +++ b/lib/atomic_web/live/activity_live/show.ex @@ -19,21 +19,9 @@ defmodule AtomicWeb.ActivityLive.Show do def handle_params(%{"id" => id}, _, socket) do activity = Activities.get_activity!(id, [:speakers, :organization]) - entries = [ - %{ - name: gettext("Activities"), - route: Routes.activity_index_path(socket, :index) - }, - %{ - name: activity.title, - route: Routes.activity_show_path(socket, :show, id) - } - ] - {:noreply, socket |> assign(:page_title, "#{activity.title}") - |> assign(:breadcrumb_entries, entries) |> assign(:current_page, :activities) |> assign(:activity, %{activity | enrolled: Activities.get_total_enrolled(id)}) |> assign(:enrolled?, maybe_put_enrolled(socket)) diff --git a/lib/atomic_web/live/announcement_live/edit.ex b/lib/atomic_web/live/announcement_live/edit.ex index e5abc9833..fad2685aa 100644 --- a/lib/atomic_web/live/announcement_live/edit.ex +++ b/lib/atomic_web/live/announcement_live/edit.ex @@ -10,23 +10,11 @@ defmodule AtomicWeb.AnnouncementLive.Edit do end @impl true - def handle_params(%{"organization_id" => organization_id, "id" => id}, _, socket) do + def handle_params(%{"organization_id" => _organization_id, "id" => id}, _, socket) do announcement = Organizations.get_announcement!(id) - entries = [ - %{ - name: gettext("Announcements"), - route: Routes.announcement_index_path(socket, :index) - }, - %{ - name: gettext("Edit Announcements"), - route: Routes.announcement_edit_path(socket, :edit, id, organization_id) - } - ] - {:noreply, socket - |> assign(:breadcrumb_entries, entries) |> assign(:current_page, :activities) |> assign(:page_title, gettext("Edit Announcements")) |> assign(:announcement, announcement)} diff --git a/lib/atomic_web/live/announcement_live/index.ex b/lib/atomic_web/live/announcement_live/index.ex index 562c786dc..06186fd51 100644 --- a/lib/atomic_web/live/announcement_live/index.ex +++ b/lib/atomic_web/live/announcement_live/index.ex @@ -15,20 +15,12 @@ defmodule AtomicWeb.AnnouncementLive.Index do @impl true def handle_params(params, _, socket) do - entries = [ - %{ - name: gettext("Announcements"), - route: Routes.announcement_index_path(socket, :index) - } - ] - announcements_with_flop = list_announcements(socket, params) {:noreply, socket |> assign(:page_title, gettext("Announcements")) |> assign(:current_page, :announcements) - |> assign(:breadcrumb_entries, entries) |> assign(:current_tab, current_tab(socket, params)) |> assign(:params, params) |> assign(announcements_with_flop) diff --git a/lib/atomic_web/live/announcement_live/show.ex b/lib/atomic_web/live/announcement_live/show.ex index 97c1f3624..0fd4f91d5 100644 --- a/lib/atomic_web/live/announcement_live/show.ex +++ b/lib/atomic_web/live/announcement_live/show.ex @@ -13,22 +13,10 @@ defmodule AtomicWeb.AnnouncementLive.Show do def handle_params(%{"id" => id}, _, socket) do announcement = Organizations.get_announcement!(id, preloads: [:organization]) - entries = [ - %{ - name: gettext("Announcements"), - route: Routes.announcement_index_path(socket, :index) - }, - %{ - name: announcement.title, - route: Routes.announcement_show_path(socket, :show, id) - } - ] - {:noreply, socket |> assign(:page_title, "#{announcement.title}") |> assign(:current_page, :announcements) - |> assign(:breadcrumb_entries, entries) |> assign(:announcement, announcement) |> assign(:has_permissions?, has_permissions?(socket))} end diff --git a/lib/atomic_web/live/board_live/index.ex b/lib/atomic_web/live/board_live/index.ex index 03d6045ad..8f75b63a3 100644 --- a/lib/atomic_web/live/board_live/index.ex +++ b/lib/atomic_web/live/board_live/index.ex @@ -27,19 +27,10 @@ defmodule AtomicWeb.BoardLive.Index do organization = Organizations.get_organization!(organization_id) role = Organizations.get_role(socket.assigns.current_user.id, organization_id) - entries = [ - %{ - name: "#{organization.name}'s #{gettext("Board")}", - route: Routes.board_index_path(socket, :index, organization_id) - } - ] - {:noreply, socket |> assign(:current_page, :board) |> assign(:page_title, "#{organization.name}'s #{gettext("Board")}") - |> assign(:breadcrumb_entries, entries) - |> assign(:organization, organization) |> assign(:board_departments, board_departments) |> assign(:empty?, Enum.empty?(board_departments)) |> assign(:has_permissions?, has_permissions?(socket, organization_id)) diff --git a/lib/atomic_web/live/board_live/new.ex b/lib/atomic_web/live/board_live/new.ex index 9af55f628..bda0bf760 100644 --- a/lib/atomic_web/live/board_live/new.ex +++ b/lib/atomic_web/live/board_live/new.ex @@ -11,18 +11,10 @@ defmodule AtomicWeb.BoardLive.New do end @impl true - def handle_params(%{"organization_id" => organization_id}, _, socket) do - entries = [ - %{ - name: gettext("New Board"), - route: Routes.board_new_path(socket, :new, organization_id) - } - ] - + def handle_params(%{"organization_id" => _organization_id}, _, socket) do {:noreply, socket |> assign(:current_page, :board) - |> assign(:breadcrumb_entries, entries) |> assign(:page_title, gettext("New Board")) |> assign(:user_organization, %UserOrganization{}) |> assign(:users, Enum.map(Accounts.list_users(), fn u -> [key: u.email, value: u.id] end))} diff --git a/lib/atomic_web/live/calendar_live/show.ex b/lib/atomic_web/live/calendar_live/show.ex index e13c2e9fd..706b3dc6e 100644 --- a/lib/atomic_web/live/calendar_live/show.ex +++ b/lib/atomic_web/live/calendar_live/show.ex @@ -16,18 +16,10 @@ defmodule AtomicWeb.CalendarLive.Show do def handle_params(params, _, socket) do mode = default_mode(params) - entries = [ - %{ - name: gettext("Calendar"), - route: Routes.calendar_show_path(socket, :show) - } - ] - {:noreply, socket |> assign(:page_title, "Calendar") |> assign(:current_page, :calendar) - |> assign(:breadcrumb_entries, entries) |> assign(:params, params) |> assign(:mode, mode) |> assign(:activities, list_activities(socket.assigns.timezone, mode, params))} diff --git a/lib/atomic_web/live/department_live/index.ex b/lib/atomic_web/live/department_live/index.ex index fb7ddfbbb..af0b6250a 100644 --- a/lib/atomic_web/live/department_live/index.ex +++ b/lib/atomic_web/live/department_live/index.ex @@ -16,13 +16,6 @@ defmodule AtomicWeb.DepartmentLive.Index do def handle_params(%{"organization_id" => organization_id}, _, socket) do organization = Organizations.get_organization!(organization_id) - entries = [ - %{ - name: "#{organization.name}'s #{gettext("Departments")}", - route: Routes.department_index_path(socket, :index, organization.id) - } - ] - departments = Departments.list_departments_by_organization_id(organization_id, preloads: [:organization]) @@ -30,7 +23,6 @@ defmodule AtomicWeb.DepartmentLive.Index do socket |> assign(:page_title, "#{organization.name}'s #{gettext("Departments")}") |> assign(:current_page, :departments) - |> assign(:breadcrumb_entries, entries) |> assign(:organization, organization) |> assign(:departments, departments) |> assign(:empty?, Enum.empty?(departments)) diff --git a/lib/atomic_web/live/department_live/show.ex b/lib/atomic_web/live/department_live/show.ex index 0dde91c9c..5eae961fd 100644 --- a/lib/atomic_web/live/department_live/show.ex +++ b/lib/atomic_web/live/department_live/show.ex @@ -16,22 +16,10 @@ defmodule AtomicWeb.DepartmentLive.Show do organization = Organizations.get_organization!(organization_id) department = Departments.get_department!(id) - entries = [ - %{ - name: gettext("Departments"), - route: Routes.department_index_path(socket, :index, organization_id) - }, - %{ - name: department.name, - route: Routes.department_show_path(socket, :show, organization_id, department.id) - } - ] - {:noreply, socket |> assign(:current_page, :departments) |> assign(:page_title, department.name) - |> assign(:breadcrumb_entries, entries) |> assign(:organization, organization) |> assign(:department, department) |> assign(:collaborator, maybe_put_collaborator(socket, department.id)) diff --git a/lib/atomic_web/live/home_live/index.ex b/lib/atomic_web/live/home_live/index.ex index 77845276a..e56a14f15 100644 --- a/lib/atomic_web/live/home_live/index.ex +++ b/lib/atomic_web/live/home_live/index.ex @@ -9,17 +9,9 @@ defmodule AtomicWeb.HomeLive.Index do @impl true def handle_params(_params, _, socket) do - entries = [ - %{ - name: gettext("Home"), - route: Routes.home_index_path(socket, :index) - } - ] - {:noreply, socket |> assign(:page_title, gettext("Home")) - |> assign(:breadcrumb_entries, entries) |> assign(:current_page, :home)} end end diff --git a/lib/atomic_web/live/membership_live/edit.ex b/lib/atomic_web/live/membership_live/edit.ex index e30238454..13f6112bf 100644 --- a/lib/atomic_web/live/membership_live/edit.ex +++ b/lib/atomic_web/live/membership_live/edit.ex @@ -13,22 +13,10 @@ defmodule AtomicWeb.MembershipLive.Edit do membership = Organizations.get_membership!(id, [:user, :organization, :created_by]) organization = Organizations.get_organization!(organization_id) - entries = [ - %{ - name: "#{organization.name}'s #{gettext("Memberships")}", - route: Routes.membership_index_path(socket, :index, organization_id) - }, - %{ - name: gettext("Edit Membership"), - route: Routes.membership_edit_path(socket, :edit, organization_id, id) - } - ] - {:noreply, socket |> assign(:page_title, "Edit Membership") |> assign(:current_page, :memberships) - |> assign(:breadcrumb_entries, entries) |> assign(:organization, organization) |> assign(:membership, membership) |> assign(:current_user, socket.assigns.current_user) diff --git a/lib/atomic_web/live/membership_live/index.ex b/lib/atomic_web/live/membership_live/index.ex index 8b8b0d09d..927a84bf2 100644 --- a/lib/atomic_web/live/membership_live/index.ex +++ b/lib/atomic_web/live/membership_live/index.ex @@ -16,18 +16,10 @@ defmodule AtomicWeb.MembershipLive.Index do def handle_params(%{"organization_id" => organization_id} = params, _, socket) do organization = Organizations.get_organization!(organization_id) - entries = [ - %{ - name: "#{organization.name}'s #{gettext("Memberships")}", - route: Routes.membership_index_path(socket, :index, organization_id) - } - ] - {:noreply, socket |> assign(:page_title, "#{organization.name}'s #{gettext("Memberships")}") |> assign(:current_page, :memberships) - |> assign(:breadcrumb_entries, entries) |> assign(:params, params) |> assign(list_memberships(organization_id, params))} end diff --git a/lib/atomic_web/live/organization_live/edit.ex b/lib/atomic_web/live/organization_live/edit.ex index bd8b9c309..bef1e7f98 100644 --- a/lib/atomic_web/live/organization_live/edit.ex +++ b/lib/atomic_web/live/organization_live/edit.ex @@ -12,25 +12,9 @@ defmodule AtomicWeb.OrganizationLive.Edit do def handle_params(%{"organization_id" => organization_id}, _, socket) do organization = Organizations.get_organization!(organization_id) - entries = [ - %{ - name: gettext("Organizations"), - route: Routes.organization_index_path(socket, :index) - }, - %{ - name: gettext("%{name}", name: organization.name), - route: Routes.organization_show_path(socket, :show, organization_id) - }, - %{ - name: gettext("Edit"), - route: Routes.organization_edit_path(socket, :edit, organization_id) - } - ] - {:noreply, socket |> assign(:page_title, organization.name) - |> assign(:breadcrumb_entries, entries) |> assign(:organization, organization) |> assign(:current_page, :organizations)} end diff --git a/lib/atomic_web/live/organization_live/index.ex b/lib/atomic_web/live/organization_live/index.ex index 3677952c1..9eab9f685 100644 --- a/lib/atomic_web/live/organization_live/index.ex +++ b/lib/atomic_web/live/organization_live/index.ex @@ -14,20 +14,12 @@ defmodule AtomicWeb.OrganizationLive.Index do @impl true def handle_params(params, _url, socket) do - entries = [ - %{ - name: gettext("Organizations"), - route: Routes.organization_index_path(socket, :index) - } - ] - organizations_with_flop = list_organizations(params) {:noreply, socket |> assign(:page_title, gettext("Organizations")) |> assign(:current_page, :organizations) - |> assign(:breadcrumb_entries, entries) |> assign(:params, params) |> assign(organizations_with_flop) |> assign(:empty?, Enum.empty?(organizations_with_flop.organizations)) diff --git a/lib/atomic_web/live/organization_live/show.ex b/lib/atomic_web/live/organization_live/show.ex index 0454461f9..6a5933215 100644 --- a/lib/atomic_web/live/organization_live/show.ex +++ b/lib/atomic_web/live/organization_live/show.ex @@ -16,17 +16,6 @@ defmodule AtomicWeb.OrganizationLive.Show do def handle_params(%{"organization_id" => organization_id} = _params, _, socket) do organization = Organizations.get_organization!(organization_id) - entries = [ - %{ - name: gettext("Organizations"), - route: Routes.organization_index_path(socket, :index) - }, - %{ - name: organization.name, - route: Routes.organization_show_path(socket, :show, organization_id) - } - ] - {:noreply, socket |> assign(:page_title, organization.name) @@ -34,7 +23,6 @@ defmodule AtomicWeb.OrganizationLive.Show do |> assign(:people, Organizations.list_organizations_members(organization)) |> assign(:breadcrumb_entries, entries) |> assign(:current_page, :organizations) - |> assign(:breadcrumb_entries, entries) |> assign(:organization, organization) |> assign(:departments, Departments.list_departments_by_organization_id(organization_id)) |> assign(list_activities(organization_id)) diff --git a/lib/atomic_web/live/partner_live/index.ex b/lib/atomic_web/live/partner_live/index.ex index 12571a62a..289038c37 100644 --- a/lib/atomic_web/live/partner_live/index.ex +++ b/lib/atomic_web/live/partner_live/index.ex @@ -17,20 +17,12 @@ defmodule AtomicWeb.PartnerLive.Index do def handle_params(%{"organization_id" => organization_id} = params, _, socket) do organization = Organizations.get_organization!(organization_id) - entries = [ - %{ - name: "#{organization.name}'s #{gettext("Partners")}", - route: Routes.partner_index_path(socket, :index, organization_id) - } - ] - partners_with_flop = list_partners(organization_id) {:noreply, socket |> assign(:page_title, "#{organization.name}'s #{gettext("Partners")}") |> assign(:current_page, :partners) - |> assign(:breadcrumb_entries, entries) |> assign(:params, params) |> assign(:organization, organization) |> assign(partners_with_flop) diff --git a/lib/atomic_web/live/partner_live/show.ex b/lib/atomic_web/live/partner_live/show.ex index 15d395219..a274503e3 100644 --- a/lib/atomic_web/live/partner_live/show.ex +++ b/lib/atomic_web/live/partner_live/show.ex @@ -15,22 +15,10 @@ defmodule AtomicWeb.PartnerLive.Show do organization = Organizations.get_organization!(organization_id) partner = Partners.get_partner!(id) - entries = [ - %{ - name: gettext("Partners"), - route: Routes.partner_index_path(socket, :index, organization_id) - }, - %{ - name: gettext("%{name}", name: partner.name), - route: Routes.partner_show_path(socket, :show, organization_id, id) - } - ] - {:noreply, socket |> assign(:page_title, partner.name) |> assign(:current_page, :partners) - |> assign(:breadcrumb_entries, entries) |> assign(:organization, organization) |> assign(:partner, partner) |> assign(:has_permissions?, has_permissions?(socket, organization_id))} diff --git a/lib/atomic_web/live/profile_live/edit.ex b/lib/atomic_web/live/profile_live/edit.ex index 8801ef60a..354261c72 100644 --- a/lib/atomic_web/live/profile_live/edit.ex +++ b/lib/atomic_web/live/profile_live/edit.ex @@ -12,23 +12,11 @@ defmodule AtomicWeb.ProfileLive.Edit do def handle_params(%{"slug" => user_slug}, _, socket) do user = Accounts.get_user_by_slug(user_slug) - entries = [ - %{ - name: gettext("%{name}", name: user.name), - route: Routes.profile_show_path(socket, :show, user_slug) - }, - %{ - name: gettext("Edit Profile", name: user.name), - route: Routes.profile_edit_path(socket, :edit, user_slug) - } - ] - if socket.assigns.current_user.slug == user_slug do {:noreply, socket |> assign(:page_title, user.name) |> assign(:current_page, :profile) - |> assign(:breadcrumb_entries, entries) |> assign(:user, user)} else {:noreply, socket |> redirect(to: Routes.profile_show_path(socket, :show, user_slug))} diff --git a/lib/atomic_web/live/profile_live/show.ex b/lib/atomic_web/live/profile_live/show.ex index f9a857ada..864d112f4 100644 --- a/lib/atomic_web/live/profile_live/show.ex +++ b/lib/atomic_web/live/profile_live/show.ex @@ -20,18 +20,10 @@ defmodule AtomicWeb.ProfileLive.Show do organizations = Organizations.list_user_organizations(user.id) - entries = [ - %{ - name: gettext("%{name}", name: user.name), - route: Routes.profile_show_path(socket, :show, user_slug) - } - ] - {:noreply, socket |> assign(:page_title, user.name) |> assign(:current_page, :profile) - |> assign(:breadcrumb_entries, entries) |> assign(:user, user) |> assign(:organizations, organizations) |> assign(:is_current_user, is_current_user)} diff --git a/lib/atomic_web/live/scanner_live/index.ex b/lib/atomic_web/live/scanner_live/index.ex index 0d21fb203..b66b16e10 100644 --- a/lib/atomic_web/live/scanner_live/index.ex +++ b/lib/atomic_web/live/scanner_live/index.ex @@ -12,18 +12,10 @@ defmodule AtomicWeb.ScannerLive.Index do @impl true def handle_params(_params, _, socket) do - entries = [ - %{ - name: gettext("Scanner"), - route: Routes.scanner_index_path(socket, :index) - } - ] - {:noreply, socket |> assign(:current_page, :scanner) - |> assign(:title, "Scanner") - |> assign(:breadcrumb_entries, entries)} + |> assign(:title, "Scanner")} end @doc """ diff --git a/lib/atomic_web/live/speaker_live/index.ex b/lib/atomic_web/live/speaker_live/index.ex index de988fd6e..d8d4be798 100644 --- a/lib/atomic_web/live/speaker_live/index.ex +++ b/lib/atomic_web/live/speaker_live/index.ex @@ -11,17 +11,9 @@ defmodule AtomicWeb.SpeakerLive.Index do @impl true def handle_params(params, _, socket) do - entries = [ - %{ - name: gettext("Speakers"), - route: Routes.speaker_index_path(socket, :index, params["organization_id"]) - } - ] - {:noreply, socket |> assign(:current_page, :speakers) - |> assign(:breadcrumb_entries, entries) |> apply_action(socket.assigns.live_action, params)} end diff --git a/lib/atomic_web/live/speaker_live/show.ex b/lib/atomic_web/live/speaker_live/show.ex index f823dc8f1..3a72a9e67 100644 --- a/lib/atomic_web/live/speaker_live/show.ex +++ b/lib/atomic_web/live/speaker_live/show.ex @@ -9,23 +9,11 @@ defmodule AtomicWeb.SpeakerLive.Show do end @impl true - def handle_params(%{"organization_id" => organization_id, "id" => id}, _, socket) do - entries = [ - %{ - name: gettext("Speakers"), - route: Routes.speaker_index_path(socket, :index, organization_id) - }, - %{ - name: gettext("Show"), - route: Routes.speaker_show_path(socket, :show, organization_id, id) - } - ] - + def handle_params(%{"organization_id" => _organization_id, "id" => id}, _, socket) do {:noreply, socket |> assign(:page_title, page_title(socket.assigns.live_action)) |> assign(:current_page, :speakers) - |> assign(:breadcrumb_entries, entries) |> assign(:speaker, Activities.get_speaker!(id))} end diff --git a/lib/atomic_web/templates/layout/live.html.heex b/lib/atomic_web/templates/layout/live.html.heex index cd35ab821..9aec91a9f 100644 --- a/lib/atomic_web/templates/layout/live.html.heex +++ b/lib/atomic_web/templates/layout/live.html.heex @@ -181,40 +181,14 @@