From 060298ee9552ac5467cacc4b110420d35d83b430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Lobo?= Date: Fri, 28 Feb 2025 17:38:47 +0000 Subject: [PATCH 1/7] build: upgrade to Phoenix LiveView 1.0 --- .formatter.exs | 2 +- .tool-versions | 4 +- lib/atomic_web.ex | 5 +- lib/atomic_web/components/activity.ex | 14 +-- lib/atomic_web/components/announcement.ex | 8 +- lib/atomic_web/components/avatar.ex | 4 +- lib/atomic_web/components/badge.ex | 2 +- lib/atomic_web/components/button.ex | 14 +-- lib/atomic_web/components/dropdown.ex | 8 +- lib/atomic_web/components/empty.ex | 6 +- lib/atomic_web/components/forms.ex | 64 ++++++------- lib/atomic_web/components/image_uploader.ex | 2 +- .../components/legal_pages_links.ex | 6 +- lib/atomic_web/components/modal.ex | 2 +- lib/atomic_web/components/notification.ex | 8 +- lib/atomic_web/components/organizations.ex | 2 +- lib/atomic_web/components/page.ex | 10 +- lib/atomic_web/components/pagination.ex | 6 +- lib/atomic_web/components/sidebar.ex | 8 +- lib/atomic_web/components/socials.ex | 2 +- lib/atomic_web/components/table.ex | 22 ++--- lib/atomic_web/components/tabs.ex | 18 +--- lib/atomic_web/components/unauthenticated.ex | 6 +- .../activity_live/form_component.html.heex | 18 ++-- .../live/activity_live/index.html.heex | 28 +++--- .../live/activity_live/show.html.heex | 56 +++++------ .../components/announcement_card.ex | 8 +- .../live/announcement_live/edit.html.heex | 4 +- .../form_component.html.heex | 4 +- .../live/announcement_live/index.html.heex | 2 +- .../live/announcement_live/new.html.heex | 2 +- .../live/announcement_live/show.html.heex | 24 ++--- .../components/calendar_utils.ex | 4 +- .../live/calendar_live/components/month.ex | 16 ++-- .../live/calendar_live/components/week.ex | 29 +++--- .../live/calendar_live/show.html.heex | 26 ++--- .../live/collaborator_live/form_component.ex | 26 ++--- .../components/department_card.ex | 4 +- .../live/department_live/edit.html.heex | 18 ++-- .../live/department_live/form_component.ex | 10 +- .../live/department_live/index.html.heex | 4 +- .../live/department_live/show.html.heex | 32 +++---- .../follow_suggestions/follow_suggestions.ex | 4 +- .../follow_suggestions/suggestion.ex | 4 +- .../live/home_live/components/schedule.ex | 32 +++---- lib/atomic_web/live/home_live/index.ex | 5 +- lib/atomic_web/live/home_live/index.html.heex | 44 ++++----- .../legal_terms_live/components/black_bar.ex | 2 +- .../legal_terms_live/components/header.ex | 6 +- .../legal_terms_live/components/main_title.ex | 2 +- .../cookies_live/show.html.heex | 64 ++++++------- .../privacy_live/show.html.heex | 96 +++++++++---------- .../legal_terms_live/tos_live/show.html.heex | 56 +++++------ .../form_component.html.heex | 16 ++-- .../live/organization_live/index.html.heex | 18 ++-- .../live/organization_live/show.html.heex | 40 ++++---- .../live/partner_live/edit.html.heex | 18 ++-- .../live/partner_live/form_component.ex | 12 +-- .../live/partner_live/index.html.heex | 20 ++-- .../live/partner_live/show.html.heex | 40 ++++---- .../profile_live/form_component.html.heex | 76 +++++++-------- .../live/profile_live/show.html.heex | 20 ++-- .../live/scanner_live/index.html.heex | 6 +- .../live/user_live/form_component.html.heex | 14 +-- lib/atomic_web/templates/error/404.html.heex | 16 ++-- lib/atomic_web/templates/error/500.html.heex | 6 +- .../templates/layout/_user_menu.html.heex | 8 +- lib/atomic_web/templates/layout/app.html.heex | 26 ++--- .../templates/layout/live.html.heex | 14 +-- .../templates/layout/root.html.heex | 8 +- .../user_change_password/edit.html.heex | 82 ++++++++-------- .../templates/user_confirmation/new.html.heex | 8 +- .../templates/user_registration/new.html.heex | 72 +++++++------- .../user_reset_password/edit.html.heex | 64 ++++++------- .../user_reset_password/new.html.heex | 36 +++---- .../templates/user_session/new.html.heex | 68 ++++++------- .../templates/user_settings/edit.html.heex | 68 ++++++------- .../templates/user_setup/edit.html.heex | 68 ++++++------- lib/atomic_web/views/error_helpers.ex | 4 +- lib/atomic_web/views/helpers.ex | 4 +- mix.exs | 22 ++--- mix.lock | 87 ++++++++--------- 82 files changed, 888 insertions(+), 906 deletions(-) diff --git a/.formatter.exs b/.formatter.exs index 5d9765e67..ae780ec3a 100644 --- a/.formatter.exs +++ b/.formatter.exs @@ -1,6 +1,6 @@ [ import_deps: [:ecto, :phoenix], - plugins: [Phoenix.LiveView.HTMLFormatter, TailwindFormatter.MultiFormatter, DoctestFormatter], + plugins: [TailwindFormatter, DoctestFormatter, Phoenix.LiveView.HTMLFormatter], heex_line_length: 300, inputs: [ "*.{heex,ex,exs}", diff --git a/.tool-versions b/.tool-versions index 6aeeff733..9471d325c 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ -elixir 1.14.4-otp-26 -erlang 26.1.1 +elixir 1.17.2-otp-27 +erlang 27.0 diff --git a/lib/atomic_web.ex b/lib/atomic_web.ex index 7581894af..b99cc3315 100644 --- a/lib/atomic_web.ex +++ b/lib/atomic_web.ex @@ -98,8 +98,9 @@ defmodule AtomicWeb do defp view_helpers do quote do - # Use all HTML functionality (forms, tags, etc) - use Phoenix.HTML + import Phoenix.HTML + import Phoenix.HTML.Form + use PhoenixHTMLHelpers # Import LiveView and .heex helpers (<.link>, <.form>, etc) import Phoenix.LiveView.Helpers diff --git a/lib/atomic_web/components/activity.ex b/lib/atomic_web/components/activity.ex index 70839ebe5..15cd7db89 100644 --- a/lib/atomic_web/components/activity.ex +++ b/lib/atomic_web/components/activity.ex @@ -21,19 +21,19 @@ defmodule AtomicWeb.Components.Activity do <.link navigate={~p"/organizations/#{@activity.organization.id}"}> - <%= @activity.organization.name %> + {@activity.organization.name}

Published on - +

-

<%= @activity.title %>

+

{@activity.title}

-

<%= maybe_slice_string(@activity.description, 300) %>

+

{maybe_slice_string(@activity.description, 300)}

<%= if @activity.image do %> @@ -47,21 +47,21 @@ defmodule AtomicWeb.Components.Activity do <.icon name="hero-calendar-solid" class="mr-1.5 h-5 w-5 flex-shrink-0 text-zinc-400" /> - <%= pretty_display_date(@activity.start) %> + {pretty_display_date(@activity.start)} starting in <.icon name="hero-user-group-solid" class="size-5" /> - <%= @activity.enrolled %>/<%= @activity.maximum_entries %> + {@activity.enrolled}/{@activity.maximum_entries} enrollments <.icon name="hero-map-pin-solid" class="size-5" /> - <%= @activity.location.name %> + {@activity.location.name} location diff --git a/lib/atomic_web/components/announcement.ex b/lib/atomic_web/components/announcement.ex index cba272350..22cfaa9f9 100644 --- a/lib/atomic_web/components/announcement.ex +++ b/lib/atomic_web/components/announcement.ex @@ -19,19 +19,19 @@ defmodule AtomicWeb.Components.Announcement do <.link navigate={~p"/organizations/#{@announcement.organization.id}"} class="hover:underline focus:outline-none">

- <%= @announcement.organization.name %> + {@announcement.organization.name}

Published on - +

-

<%= @announcement.title %>

+

{@announcement.title}

- <%= maybe_slice_string(@announcement.description, 300) %> + {maybe_slice_string(@announcement.description, 300)}
<%= if @announcement.image do %> diff --git a/lib/atomic_web/components/avatar.ex b/lib/atomic_web/components/avatar.ex index c6bef703b..ef367216f 100644 --- a/lib/atomic_web/components/avatar.ex +++ b/lib/atomic_web/components/avatar.ex @@ -47,9 +47,9 @@ defmodule AtomicWeb.Components.Avatar do <% else %> <%= if @auto_generate_initials do %> - <%= extract_initials(@name) %> + {extract_initials(@name)} <% else %> - <%= @name %> + {@name} <% end %> <% end %> diff --git a/lib/atomic_web/components/badge.ex b/lib/atomic_web/components/badge.ex index 28632a790..ec9bcaad0 100644 --- a/lib/atomic_web/components/badge.ex +++ b/lib/atomic_web/components/badge.ex @@ -51,7 +51,7 @@ defmodule AtomicWeb.Components.Badge do <%= if @icon && @icon_position == :left do %> <.icon name={@icon} class={"#{generate_icon_classes(assigns)}"} /> <% end %> - <%= render_slot(@inner_block) || @label %> + {render_slot(@inner_block) || @label} <%= if @icon && @icon_position == :right do %> <.icon name={@icon} class={"#{generate_icon_classes(assigns)}"} /> <% end %> diff --git a/lib/atomic_web/components/button.ex b/lib/atomic_web/components/button.ex index 27ff28633..997a28a0b 100644 --- a/lib/atomic_web/components/button.ex +++ b/lib/atomic_web/components/button.ex @@ -78,7 +78,7 @@ defmodule AtomicWeb.Components.Button do defp render_button(assigns) do ~H""" """ end @@ -86,7 +86,7 @@ defmodule AtomicWeb.Components.Button do defp link_button(assigns) do ~H""" <.link class={@class} {@rest}> - <%= render_content(assigns) %> + {render_content(assigns)} """ end @@ -96,23 +96,23 @@ defmodule AtomicWeb.Components.Button do <%= if (@icon || @spinner) && @icon_position == :left do %>
<%= if @icon do %> - <%= icon_content(assigns) %> + {icon_content(assigns)} <% end %> <%= if @spinner do %> - <%= spinner_content(assigns) %> + {spinner_content(assigns)} <% end %>
<% end %> <%= if Map.has_key?(assigns, :inner_block) do %> - <%= render_slot(@inner_block) %> + {render_slot(@inner_block)} <% end %> <%= if (@icon || @spinner) && @icon_position == :right do %>
<%= if @icon do %> - <%= icon_content(assigns) %> + {icon_content(assigns)} <% end %> <%= if @spinner do %> - <%= spinner_content(assigns) %> + {spinner_content(assigns)} <% end %>
<% end %> diff --git a/lib/atomic_web/components/dropdown.ex b/lib/atomic_web/components/dropdown.ex index c0760847e..449ecbf25 100644 --- a/lib/atomic_web/components/dropdown.ex +++ b/lib/atomic_web/components/dropdown.ex @@ -24,9 +24,9 @@ defmodule AtomicWeb.Components.Dropdown do ~H"""
- <%= render_slot(@wrapper) %> + {render_slot(@wrapper)}
- diff --git a/lib/atomic_web/components/pagination.ex b/lib/atomic_web/components/pagination.ex index 49a66498e..afe712887 100644 --- a/lib/atomic_web/components/pagination.ex +++ b/lib/atomic_web/components/pagination.ex @@ -35,9 +35,9 @@ defmodule AtomicWeb.Components.Pagination do <% end %> <%= for page <- max(1, @meta.current_page - 2)..max(min(@meta.total_pages, @meta.current_page + 2), 1) do %> <%= if @meta.current_page == page do %> - <.link patch={build_query(page, @meta, @params)} class="text-secondary inline-flex items-center px-4 pt-4 text-sm font-medium"><%= page %> + <.link patch={build_query(page, @meta, @params)} class="text-secondary inline-flex items-center px-4 pt-4 text-sm font-medium">{page} <% else %> - <.link patch={build_query(page, @meta, @params)} class="inline-flex items-center px-4 pt-4 text-sm font-medium text-zinc-500 hover:text-zinc-700"><%= page %> + <.link patch={build_query(page, @meta, @params)} class="inline-flex items-center px-4 pt-4 text-sm font-medium text-zinc-500 hover:text-zinc-700">{page} <% end %> <% end %> <%= if min(@meta.total_pages, @meta.current_page + 2) != @meta.total_pages do %> @@ -46,7 +46,7 @@ defmodule AtomicWeb.Components.Pagination do ... <% end %> - <.link patch={build_query(@meta.total_pages, @meta, @params)} class="inline-flex items-center px-4 pt-4 text-sm font-medium text-zinc-500 hover:text-zinc-700"><%= @meta.total_pages %> + <.link patch={build_query(@meta.total_pages, @meta, @params)} class="inline-flex items-center px-4 pt-4 text-sm font-medium text-zinc-500 hover:text-zinc-700">{@meta.total_pages} <% end %>
diff --git a/lib/atomic_web/components/sidebar.ex b/lib/atomic_web/components/sidebar.ex index 03c67ab5c..c250490b4 100644 --- a/lib/atomic_web/components/sidebar.ex +++ b/lib/atomic_web/components/sidebar.ex @@ -61,7 +61,7 @@ defmodule AtomicWeb.Components.Sidebar do
<.sidebar_list current_user={@current_user} current_organization={@current_organization} current_page={@current_page} /> <%= if Enum.count(@organizations) > 0 do %> -
<%= gettext("Your organizations") %>
+
{gettext("Your organizations")}
<.live_component id="mobile-organizations" module={AtomicWeb.Components.Organizations} current_user={@current_user} current_organization={@current_organization} organizations={@organizations} /> <% end %>
@@ -86,7 +86,7 @@ defmodule AtomicWeb.Components.Sidebar do <.sidebar_list current_user={@current_user} current_organization={@current_organization} current_page={@current_page} /> <%= if Enum.count(@organizations) > 0 do %> -
<%= gettext("Your organizations") %>
+
{gettext("Your organizations")}
<.live_component id="desktop-organizations" module={AtomicWeb.Components.Organizations} current_user={@current_user} current_organization={@current_organization} organizations={@organizations} /> <% end %> @@ -111,7 +111,7 @@ defmodule AtomicWeb.Components.Sidebar do "text-zinc-400 group-hover:text-orange-500" end} size-6 shrink-0" } /> - <%= page.title %> + {page.title} <% end %> @@ -126,7 +126,7 @@ defmodule AtomicWeb.Components.Sidebar do <:wrapper> diff --git a/lib/atomic_web/components/socials.ex b/lib/atomic_web/components/socials.ex index 87175a0ae..ff5804e00 100644 --- a/lib/atomic_web/components/socials.ex +++ b/lib/atomic_web/components/socials.ex @@ -15,7 +15,7 @@ defmodule AtomicWeb.Components.Socials do
icon} class="h-5 w-5" alt={Atom.to_string(social)} /> <.link class="capitalize text-blue-500" target="_blank" href={url_base <> social_value}> - <%= Atom.to_string(social) %> + {Atom.to_string(social)}
<% end %> diff --git a/lib/atomic_web/components/table.ex b/lib/atomic_web/components/table.ex index e3e23b60b..00683e7b0 100644 --- a/lib/atomic_web/components/table.ex +++ b/lib/atomic_web/components/table.ex @@ -30,7 +30,7 @@ defmodule AtomicWeb.Components.Table do <%= for col <- @col do %> - <%= render_slot(col, item) %> + {render_slot(col, item)} <% end %> @@ -53,7 +53,7 @@ defmodule AtomicWeb.Components.Table do
<.link patch={build_sorting_query(@field, @meta)} class="mr-2 w-full">
- <%= @label %> + {@label} <.sorting_arrow direction={@direction} />
@@ -63,18 +63,18 @@ defmodule AtomicWeb.Components.Table do <%= if sortable?(@field, @meta.schema) do %> <.link patch={build_sorting_query(@field, @meta)}>
- <%= @label %> + {@label} <.sorting_arrow direction={@direction} />
<% else %> <%= if filterable?(@field, @meta.schema) && should_filter(@field, @filter) do %>
- <%= @label %> + {@label} <.filter_input field={@field} meta={@meta} filter={extract_filter_type(@field, @filter)} />
<% else %> - <%= @label %> + {@label} <% end %> <% end %> <% end %> @@ -104,17 +104,7 @@ defmodule AtomicWeb.Components.Table do defp input(assigns) do ~H"""
- +
""" end diff --git a/lib/atomic_web/components/tabs.ex b/lib/atomic_web/components/tabs.ex index 1e565b1ff..04900afcb 100644 --- a/lib/atomic_web/components/tabs.ex +++ b/lib/atomic_web/components/tabs.ex @@ -9,16 +9,8 @@ defmodule AtomicWeb.Components.Tabs do def tabs(assigns) do ~H""" -
- <%= render_slot(@inner_block) %> +
+ {render_slot(@inner_block)}
""" end @@ -36,12 +28,12 @@ defmodule AtomicWeb.Components.Tabs do ~H""" """ diff --git a/lib/atomic_web/components/unauthenticated.ex b/lib/atomic_web/components/unauthenticated.ex index 27d6f958e..e95801f52 100644 --- a/lib/atomic_web/components/unauthenticated.ex +++ b/lib/atomic_web/components/unauthenticated.ex @@ -11,11 +11,11 @@ defmodule AtomicWeb.Components.Unauthenticated do ~H"""
<.icon name="hero-user-circle" class="mx-auto h-12 w-12 text-zinc-400" /> -

<%= gettext("You are not authenticated") %>

-

<%= gettext("Please log in to view this content.") %>

+

{gettext("You are not authenticated")}

+

{gettext("Please log in to view this content.")}

<.button patch={@url} icon="hero-arrow-right-end-on-rectangle-solid" icon_position={:right}> - <%= gettext("Log In") %> + {gettext("Log In")}
diff --git a/lib/atomic_web/live/activity_live/form_component.html.heex b/lib/atomic_web/live/activity_live/form_component.html.heex index b948949d5..a763cadb2 100644 --- a/lib/atomic_web/live/activity_live/form_component.html.heex +++ b/lib/atomic_web/live/activity_live/form_component.html.heex @@ -1,6 +1,6 @@
<.form id="activity-form" for={@form} phx-change="validate" phx-submit="save" phx-target={@myself}> -
+
<.field type="text" field={@form[:title]} placeholder="Choose a title" required /> @@ -14,45 +14,45 @@
-
+
<.field type="datetime-local" field={@form[:start]} label="Starting date" required />
-
+
<.field type="datetime-local" field={@form[:finish]} label="Ending date" required />
-
+
<.field type="number" field={@form[:minimum_entries]} label="Minimum entries" placeholder="Choose minimum entries" required />
-
+
<.field type="number" field={@form[:maximum_entries]} label="Maximum entries" placeholder="Choose maximum entries" required />
-
+
<.inputs_for :let={fl} field={@form[:location]}>
<.field type="text" field={fl[:name]} label="Location" placeholder="Choose location name" required />
-
+
<.field type="url" field={fl[:url]} label="URL" placeholder="Choose an URL" />
-
+
<.field type="textarea" field={@form[:description]} label="Description" placeholder="Choose description" rows={15} required />
-
+
<.button type="submit" phx-disable-with="Saving...">Save
diff --git a/lib/atomic_web/live/activity_live/index.html.heex b/lib/atomic_web/live/activity_live/index.html.heex index ffb627c8e..343709603 100644 --- a/lib/atomic_web/live/activity_live/index.html.heex +++ b/lib/atomic_web/live/activity_live/index.html.heex @@ -1,32 +1,32 @@ <.page title="Activities"> <:actions> <.button navigate={~p"/organizations/#{@organization}/activities/new"}> - <%= gettext("New") %> + {gettext("New")} <.tabs class="max-w-5-xl mx-auto px-4 sm:px-6 lg:px-8"> <.link patch="?tab=all" replace={false}> <.tab active={@current_tab == "all"}> - <%= gettext("All") %> + {gettext("All")} <.link patch="?tab=following" replace={false}> <.tab active={@current_tab == "following"}> - <%= gettext("Following") %> + {gettext("Following")} <.link patch="?tab=upcoming" replace={false}> <.tab active={@current_tab == "upcoming"}> - <%= gettext("Upcoming") %> + {gettext("Upcoming")} <.link patch="?tab=enrolled" replace={false}> <.tab active={@current_tab == "enrolled"}> - <%= gettext("Enrolled") %> + {gettext("Enrolled")} @@ -44,25 +44,25 @@

- <%= activity.title %> + {activity.title}

- <.icon name="hero-users-solid" class="flex-shrink-0 mr-1.5 w-5 h-5 text-zinc-400" /> - <%= Enum.count(activity.enrollments) %> / <%= activity.maximum_entries %> + <.icon name="hero-users-solid" class="mr-1.5 h-5 w-5 flex-shrink-0 text-zinc-400" /> + {Enum.count(activity.enrollments)} / {activity.maximum_entries}

- <.icon name="hero-calendar-solid" class="flex-shrink-0 mr-1.5 w-5 h-5 text-zinc-400" /> + <.icon name="hero-calendar-solid" class="mr-1.5 h-5 w-5 flex-shrink-0 text-zinc-400" /> <%= if activity.start do %> - <%= display_date(activity.start) %> + {display_date(activity.start)} <% end %>

<%= if activity.location do %>

- <.icon name="hero-map-pin-solid" class="flex-shrink-0 mr-1.5 w-5 h-5 text-zinc-400" /> - <%= activity.location && activity.location.name %> + <.icon name="hero-map-pin-solid" class="mr-1.5 h-5 w-5 flex-shrink-0 text-zinc-400" /> + {activity.location && activity.location.name}

<% end %>
@@ -70,11 +70,11 @@
<%= if Activities.verify_maximum_enrollments?(activity.id) do %>
- <.icon name="hero-bell-solid" class="flex-shrink-0 mr-1.5 w-5 h-5 text-zinc-400" /> Open + <.icon name="hero-bell-solid" class="mr-1.5 h-5 w-5 flex-shrink-0 text-zinc-400" /> Open
<% else %>
- <.icon name="hero-bell-solid" class="flex-shrink-0 mr-1.5 w-5 h-5 text-zinc-400" /> Closed + <.icon name="hero-bell-solid" class="mr-1.5 h-5 w-5 flex-shrink-0 text-zinc-400" /> Closed
<% end %>
diff --git a/lib/atomic_web/live/activity_live/show.html.heex b/lib/atomic_web/live/activity_live/show.html.heex index 940507490..1292bc7fd 100644 --- a/lib/atomic_web/live/activity_live/show.html.heex +++ b/lib/atomic_web/live/activity_live/show.html.heex @@ -4,7 +4,7 @@

- <%= @activity.title %> + {@activity.title}

@@ -15,10 +15,10 @@
- <%= gettext("Preview activity") %> + {gettext("Preview activity")}
- <%= gettext("Check here every detail of this activity") %> + {gettext("Check here every detail of this activity")}
@@ -30,13 +30,13 @@ end }>
- <%= gettext("Enrollments") %> + {gettext("Enrollments")}
<.icon name="hero-users-solid" class="size-5 text-zinc-400" />
- <%= @enrolled %> / <%= @activity.maximum_entries %> + {@enrolled} / {@activity.maximum_entries}
@@ -45,7 +45,7 @@
- <%= gettext("Date and location") %> + {gettext("Date and location")}
@@ -53,27 +53,27 @@
<.icon name="hero-calendar-solid" class="size-5 text-zinc-400" /> -

- <%= display_date(@activity.start) %> +

+ {display_date(@activity.start)}

<.icon name="hero-clock-solid" class="size-5 text-zinc-400" /> -

- <%= display_time(@activity.start) %> - <%= display_time(@activity.finish) %> +

+ {display_time(@activity.start)} - {display_time(@activity.finish)}

<%= if @activity.location do %> <.icon name="hero-map-pin-solid" class="size-5 text-zinc-400" /> <.link navigate={@activity.location.url} data-confirm={gettext("Are you sure?")} class="pl-1.5 text-blue-500"> - <%= @activity.location.name %> + {@activity.location.name} <% else %> <%= if @activity.location do %>
- <%= @activity.location.name %> + {@activity.location.name}
<% end %> <% end %> @@ -83,46 +83,46 @@
- <%= gettext("Description") %> + {gettext("Description")}
- <%= @activity.description %> + {@activity.description}
<%= if @enrolled? do %>
- <%= gettext("Your already enrolled in the activity, below is your QRCode") %> + {gettext("Your already enrolled in the activity, below is your QRCode")}
- <%= draw_qr_code(@activity, @current_user, @socket) |> raw %> + {draw_qr_code(@activity, @current_user, @socket) |> raw}
-
+
- <%= gettext("If you can't go please") %> + {gettext("If you can't go please")}
<% else %> <%= if not @max_enrolled? do %>
- <%= gettext("You are not enrolled in this activity") %> + {gettext("You are not enrolled in this activity")}
<%= if @is_authenticated? do %> <% else %> - <% end %>
@@ -138,13 +138,13 @@
<%= if @has_permissions? do %> <.link patch={~p"/organizations/#{@activity.organization_id}/activities/#{@activity}/edit"} class="button"> -

- <%= @announcement.title %> + {@announcement.title}

- <%= maybe_slice_string(@announcement.description, 300) %> + {maybe_slice_string(@announcement.description, 300)}

<%= if @announcement.image do %> diff --git a/lib/atomic_web/live/announcement_live/edit.html.heex b/lib/atomic_web/live/announcement_live/edit.html.heex index 6b36d4a31..ae3e43b23 100644 --- a/lib/atomic_web/live/announcement_live/edit.html.heex +++ b/lib/atomic_web/live/announcement_live/edit.html.heex @@ -1,10 +1,10 @@ <.page title={gettext("Edit Announcement")}> <:actions> <.button size={:md} icon="hero-trash" color={:white} type="delete" phx-click="delete"> - <%= gettext("Delete") %> + {gettext("Delete")} -
+
<.live_component module={AtomicWeb.AnnouncementLive.FormComponent} id={@announcement.id} organization={@current_organization} title={@page_title} action={@live_action} announcement={@announcement} return_to={~p"/organizations/#{@current_organization}/announcements"} />
diff --git a/lib/atomic_web/live/announcement_live/form_component.html.heex b/lib/atomic_web/live/announcement_live/form_component.html.heex index bdd53a771..466be60a2 100644 --- a/lib/atomic_web/live/announcement_live/form_component.html.heex +++ b/lib/atomic_web/live/announcement_live/form_component.html.heex @@ -5,13 +5,13 @@
<.field field={f[:title]} type="text" placeholder="Title" required class="w-full" /> - <.field field={f[:description]} type="textarea" placeholder="Description" required class="w-full overflow-auto resize-none h-44 xl:h-64" /> + <.field field={f[:description]} type="textarea" placeholder="Description" required class="h-44 w-full resize-none overflow-auto xl:h-64" />
<.live_component module={ImageUploader} id="uploader" uploads={@uploads} target={@myself} class="object-cover" />
- <.button size={:md} color={:white} icon="hero-cube" type="submit"><%= gettext("Save Changes") %> + <.button size={:md} color={:white} icon="hero-cube" type="submit">{gettext("Save Changes")}
diff --git a/lib/atomic_web/live/announcement_live/index.html.heex b/lib/atomic_web/live/announcement_live/index.html.heex index 67596eaae..9e0fb9fb8 100644 --- a/lib/atomic_web/live/announcement_live/index.html.heex +++ b/lib/atomic_web/live/announcement_live/index.html.heex @@ -2,7 +2,7 @@ <:actions> <%= if not @empty? and @has_permissions? do %> <.button navigate={~p"/organizations/#{@current_organization}/announcements/new"} icon="hero-plus"> - <%= gettext("New Announcement") %> + {gettext("New Announcement")} <% end %> diff --git a/lib/atomic_web/live/announcement_live/new.html.heex b/lib/atomic_web/live/announcement_live/new.html.heex index a944ab481..46150ccb0 100644 --- a/lib/atomic_web/live/announcement_live/new.html.heex +++ b/lib/atomic_web/live/announcement_live/new.html.heex @@ -1,5 +1,5 @@ <.page title={gettext("New Announcement")}> -
+
<.live_component module={AtomicWeb.AnnouncementLive.FormComponent} id={:new} organization={@current_organization} title={@page_title} action={@live_action} announcement={@announcement} return_to={~p"/organizations/#{@current_organization}/announcements"} />
diff --git a/lib/atomic_web/live/announcement_live/show.html.heex b/lib/atomic_web/live/announcement_live/show.html.heex index b5736ff57..c07b97088 100644 --- a/lib/atomic_web/live/announcement_live/show.html.heex +++ b/lib/atomic_web/live/announcement_live/show.html.heex @@ -1,40 +1,40 @@ <.page title="Announcements" bottom_border={true}> <:actions> <%= if @has_permissions? do %> - <.button navigate={~p"/organizations/#{@announcement.organization}/announcements/#{@announcement}/edit"} icon="hero-pencil-solid"><%= gettext("Edit Announcement") %> + <.button navigate={~p"/organizations/#{@announcement.organization}/announcements/#{@announcement}/edit"} icon="hero-pencil-solid">{gettext("Edit Announcement")} <% end %>
-
+
<.avatar name={@announcement.organization.name} color={:light_zinc} size={:md} type={:organization} src={Uploaders.Logo.url({@announcement.organization.logo, @announcement.organization}, :original)} />
<.link navigate={~p"/organizations/#{@announcement.organization.id}"} class="hover:underline focus:outline-none"> -

<%= @announcement.organization.name %>

+

{@announcement.organization.name}

-

+

Published on - +

-
-

- <%= @announcement.title %> +

+

+ {@announcement.title}

-

+

<%= Enum.map(String.split(@announcement.description, "\n"), fn phrase -> %> - <%= phrase %> + {phrase} <% end) %>

<%= if @announcement.image do %> -
- Announcement Image +
+ Announcement Image
<% end %>
diff --git a/lib/atomic_web/live/calendar_live/components/calendar_utils.ex b/lib/atomic_web/live/calendar_live/components/calendar_utils.ex index 3c56e7c9e..c101db26c 100644 --- a/lib/atomic_web/live/calendar_live/components/calendar_utils.ex +++ b/lib/atomic_web/live/calendar_live/components/calendar_utils.ex @@ -2,7 +2,9 @@ defmodule AtomicWeb.CalendarLive.Components.CalendarUtils do @moduledoc """ Calendar utils functions to be used on all views. """ - use Phoenix.HTML + import Phoenix.HTML + import Phoenix.HTML.Form + use PhoenixHTMLHelpers use Timex def build_beggining_date(_timezone, "month", current_date) do diff --git a/lib/atomic_web/live/calendar_live/components/month.ex b/lib/atomic_web/live/calendar_live/components/month.ex index ec0d5d95f..6cdfdb1b7 100644 --- a/lib/atomic_web/live/calendar_live/components/month.ex +++ b/lib/atomic_web/live/calendar_live/components/month.ex @@ -51,12 +51,12 @@ defmodule AtomicWeb.CalendarLive.Components.CalendarMonth do <.link patch={~p"/activities/#{activity}"} class="group flex justify-between p-4 pr-6 focus-within:bg-zinc-50 hover:bg-zinc-50">

- <%= activity.title %> + {activity.title}

@@ -139,20 +139,20 @@ defmodule AtomicWeb.CalendarLive.Components.CalendarMonth do "flex size-6 items-center justify-center rounded-full bg-primary-600 font-semibold text-white" end}" }> - <%= @text %> + {@text}
  1. Enum.take(2)}> <.link patch={~p"/activities/#{activity}"} class="group flex">

    - <%= activity.title %> + {activity.title}

    - +
  2. 2} class="text-zinc-500 hover:text-primary-600">
@@ -177,10 +177,10 @@ defmodule AtomicWeb.CalendarLive.Components.CalendarMonth do @current_date != @date && @date.month != @current_date.month && "text-zinc-500" ]} > - <%= @text %> + {@text} <%= if (activities = get_date_activities(@activities, @date)) != [] do %> - <%= Enum.count(activities) %> events + {Enum.count(activities)} events <%= for activity <- Enum.take(activities, 3) do %> <%= if activity do %> diff --git a/lib/atomic_web/live/calendar_live/components/week.ex b/lib/atomic_web/live/calendar_live/components/week.ex index 3d50fbd4c..f649c863d 100644 --- a/lib/atomic_web/live/calendar_live/components/week.ex +++ b/lib/atomic_web/live/calendar_live/components/week.ex @@ -35,14 +35,14 @@ defmodule AtomicWeb.CalendarLive.Components.CalendarWeek do
<%= for {day_of_week, day_of_week_mobile} <- @days_of_week do %> <.link phx-click="set-current-date" phx-value-date={day_of_week} class="flex flex-col items-center py-2"> - <%= day_of_week_mobile %> + {day_of_week_mobile} - <%= day_of_week |> date_to_day() %> + {day_of_week |> date_to_day()} <% end %> @@ -53,13 +53,9 @@ defmodule AtomicWeb.CalendarLive.Components.CalendarWeek do <% day_of_week = @beginning_of_week |> Timex.add(Duration.from_days(idx)) %>
- <%= Enum.at(@week, idx) %> - - <%= day_of_week |> date_to_day() %> + {Enum.at(@week, idx)} + + {day_of_week |> date_to_day()}
@@ -74,7 +70,7 @@ defmodule AtomicWeb.CalendarLive.Components.CalendarWeek do
<%= for hour <- hours() do %>
-
<%= hour %>
+
{hour}
<% end %> @@ -118,15 +114,12 @@ defmodule AtomicWeb.CalendarLive.Components.CalendarWeek do width: #{width}%; left: #{left}%"}> <.link patch={~p"/activities/#{activity}"}> -
+

- <%= activity.title %> + {activity.title}

- +

diff --git a/lib/atomic_web/live/calendar_live/show.html.heex b/lib/atomic_web/live/calendar_live/show.html.heex index 402861149..363245697 100644 --- a/lib/atomic_web/live/calendar_live/show.html.heex +++ b/lib/atomic_web/live/calendar_live/show.html.heex @@ -1,20 +1,20 @@ <.page title="Calendar"> -
+
-
+
<%= if @mode == "month" do %> - + <% else %> <%= if date_to_month(@beginning_of_week) == date_to_month(@end_of_week) do %> - + <% else %> <%= if date_to_year(@beginning_of_week) == date_to_year(@end_of_week) do %> - + <% else %> - + <% end %> <% end %> <% end %> @@ -26,9 +26,9 @@ <.icon name="hero-chevron-left-solid" class="size-3 sm:size-5" /> - + - @@ -78,6 +78,6 @@
<.icon name="hero-information-circle" class="size-5" /> -

<%= gettext("See here the activities of the organizations you follow.") %>

+

{gettext("See here the activities of the organizations you follow.")}

diff --git a/lib/atomic_web/live/collaborator_live/form_component.ex b/lib/atomic_web/live/collaborator_live/form_component.ex index f30b9f8b7..020f1873e 100644 --- a/lib/atomic_web/live/collaborator_live/form_component.ex +++ b/lib/atomic_web/live/collaborator_live/form_component.ex @@ -14,7 +14,7 @@ defmodule AtomicWeb.CollaboratorLive.FormComponent do <%= if !@collaborator.accepted do %>

- <%= gettext("%{user_name} has requested to be a collaborator of %{department_name}.", user_name: extract_first_name(@collaborator.user.name), department_name: @department.name) %> + {gettext("%{user_name} has requested to be a collaborator of %{department_name}.", user_name: extract_first_name(@collaborator.user.name), department_name: @department.name)}

<% end %> @@ -22,46 +22,46 @@ defmodule AtomicWeb.CollaboratorLive.FormComponent do <.link navigate={~p"/profile/#{@collaborator.user}"} class="mt-4 flex outline-none"> <.avatar color={:light_zinc} name={@collaborator.user.name} />
-

<%= @collaborator.user.name %>

-

@<%= @collaborator.user.slug %>

+

{@collaborator.user.name}

+

@{@collaborator.user.slug}

<%= if @collaborator.accepted do %> <.badge variant={:outline} color={:success} size={:md} class="my-5 select-none rounded-xl py-1 font-normal sm:ml-auto sm:py-0"> -

<%= gettext("Collaborator since %{accepted_at}", accepted_at: @collaborator.accepted_at) %>

+

{gettext("Collaborator since %{accepted_at}", accepted_at: @collaborator.accepted_at)}

<% else %> <.badge variant={:outline} color={:warning} size={:md} class="bg-yellow-300/5 my-5 select-none rounded-xl border-yellow-400 py-1 font-normal text-yellow-400 sm:ml-auto sm:py-0"> -

<%= gettext("Not accepted") %>

+

{gettext("Not accepted")}

<% end %>
<%= if !@collaborator.accepted do %>
<.icon class="size-5 my-auto" name="hero-calendar" /> -

<%= gettext("Requested %{requested_at}", requested_at: relative_datetime(@collaborator.inserted_at)) %>

+

{gettext("Requested %{requested_at}", requested_at: relative_datetime(@collaborator.inserted_at))}

<% end %>
<%= if @collaborator.accepted do %> - <.button phx-click="delete" phx-target={@myself} size={:lg} icon="hero-x-circle" color={:white} full_width><%= gettext("Delete") %> + <.button phx-click="delete" phx-target={@myself} size={:lg} icon="hero-x-circle" color={:white} full_width>{gettext("Delete")} <% else %> - <.button phx-click="deny" phx-target={@myself} size={:lg} icon="hero-x-circle" color={:white} full_width><%= gettext("Deny") %> - <.button phx-click="allow" phx-target={@myself} size={:lg} icon="hero-check-circle" color={:white} full_width><%= gettext("Accept") %> + <.button phx-click="deny" phx-target={@myself} size={:lg} icon="hero-x-circle" color={:white} full_width>{gettext("Deny")} + <.button phx-click="allow" phx-target={@myself} size={:lg} icon="hero-check-circle" color={:white} full_width>{gettext("Accept")} <% end %>
<.modal :if={@action_modal} id="action-confirm-modal" show on_cancel={JS.push("clear-action", target: @myself)}>

- <%= display_action_goal_confirm_title(@action_modal) %> + {display_action_goal_confirm_title(@action_modal)}

- <%= display_action_goal_confirm_description(@action_modal, @department) %> + {display_action_goal_confirm_description(@action_modal, @department)}

- <.button phx-click="clear-action" class="mr-2" phx-target={@myself} size={:lg} icon="hero-x-circle" color={:white} full_width><%= gettext("Cancel") %> + <.button phx-click="clear-action" class="mr-2" phx-target={@myself} size={:lg} icon="hero-x-circle" color={:white} full_width>{gettext("Cancel")} <.button phx-click="confirm" class="ml-2" @@ -77,7 +77,7 @@ defmodule AtomicWeb.CollaboratorLive.FormComponent do } full_width > - <%= gettext("Confirm") %> + {gettext("Confirm")}
diff --git a/lib/atomic_web/live/department_live/components/department_card.ex b/lib/atomic_web/live/department_live/components/department_card.ex index c00fd09aa..8d0b96334 100644 --- a/lib/atomic_web/live/department_live/components/department_card.ex +++ b/lib/atomic_web/live/department_live/components/department_card.ex @@ -19,9 +19,9 @@ defmodule AtomicWeb.DepartmentLive.Components.DepartmentCard do
-

<%= @department.name %>

+

{@department.name}

<.badge :if={@department.archived} variant={:outline} color={:warning} size={:md} class="bg-yellow-300/5 select-none rounded-xl border-yellow-400 py-1 font-normal text-yellow-400 sm:ml-auto sm:py-0"> -

<%= gettext("Archived") %>

+

{gettext("Archived")}

<.avatar_group diff --git a/lib/atomic_web/live/department_live/edit.html.heex b/lib/atomic_web/live/department_live/edit.html.heex index 40092c0b8..cf6fa0cb0 100644 --- a/lib/atomic_web/live/department_live/edit.html.heex +++ b/lib/atomic_web/live/department_live/edit.html.heex @@ -10,23 +10,23 @@
<%= if !@department.archived do %> <.button color={:white} icon="hero-archive-box" phx-click="set-action" phx-value-action={:archive}> - <%= gettext("Archive") %> + {gettext("Archive")} <.button color={:white} icon="hero-trash" disabled title={gettext("You can only delete a department after it has been archived.")}> - <%= gettext("Delete") %> + {gettext("Delete")} <% else %> <.button color={:white} icon="hero-archive-box-x-mark" phx-click="set-action" phx-value-action={:unarchive}> - <%= gettext("Unarchive") %> + {gettext("Unarchive")} <.button color={:white} icon="hero-trash" phx-click="set-action" phx-value-action={:delete}> - <%= gettext("Delete") %> + {gettext("Delete")} <% end %>
<% end %> -
+
<.live_component module={AtomicWeb.DepartmentLive.FormComponent} id="department-edit" @@ -47,13 +47,13 @@ <.modal :if={@action} id="action-modal" show on_cancel={JS.push("clear-action")}>

- <%= display_action_goal_confirm_title(@action) %> + {display_action_goal_confirm_title(@action)}

- <%= display_action_goal_confirm_description(@action, @department) %> + {display_action_goal_confirm_description(@action, @department)}

- <.button phx-click="clear-action" class="mr-2" size={:lg} icon="hero-x-circle" color={:white} full_width><%= gettext("Cancel") %> + <.button phx-click="clear-action" class="mr-2" size={:lg} icon="hero-x-circle" color={:white} full_width>{gettext("Cancel")} <.button phx-click="confirm-action" class="mr-2" @@ -68,7 +68,7 @@ } full_width > - <%= gettext("Confirm") %> + {gettext("Confirm")}
diff --git a/lib/atomic_web/live/department_live/form_component.ex b/lib/atomic_web/live/department_live/form_component.ex index 31624d2f0..a18c0aebb 100644 --- a/lib/atomic_web/live/department_live/form_component.ex +++ b/lib/atomic_web/live/department_live/form_component.ex @@ -11,17 +11,17 @@ defmodule AtomicWeb.DepartmentLive.FormComponent do ~H"""
<.form :let={f} for={@changeset} id="department-form" phx-target={@myself} phx-change="validate" phx-submit="save"> -

<%= gettext("General") %>

+

{gettext("General")}

<.field type="text" help_text={gettext("The name of the department")} field={f[:name]} placeholder="Name" required /> <.field type="textarea" help_text={gettext("A brief description of the department")} field={f[:description]} placeholder="Description" /> <.field type="checkbox" help_text={gettext("Allow any user to apply to be a collaborator in this department")} field={f[:collaborator_applications]} />
-

<%= gettext("Personalization") %>

+

{gettext("Personalization")}

- <%= label(f, :banner, class: "department-form_description") %> -

<%= gettext("The banner of the department (2055×256px for best display)") %>

+ {label(f, :banner, class: "department-form_description")} +

{gettext("The banner of the department (2055×256px for best display)")}

<.live_component module={ImageUploader} id="uploader" uploads={@uploads} target={@myself} /> @@ -29,7 +29,7 @@ defmodule AtomicWeb.DepartmentLive.FormComponent do
- <.button size={:md} color={:white} icon="hero-cube" type="submit"><%= gettext("Save Changes") %> + <.button size={:md} color={:white} icon="hero-cube" type="submit">{gettext("Save Changes")}
diff --git a/lib/atomic_web/live/department_live/index.html.heex b/lib/atomic_web/live/department_live/index.html.heex index f6002c3cf..583d442f7 100644 --- a/lib/atomic_web/live/department_live/index.html.heex +++ b/lib/atomic_web/live/department_live/index.html.heex @@ -2,7 +2,7 @@ <:actions> <%= if not @empty? and @has_permissions? do %> <.button patch={~p"/organizations/#{@current_organization}/departments/new"} icon="hero-plus"> - <%= gettext("New") %> + {gettext("New")} <% end %> @@ -12,7 +12,7 @@ <.empty_state url={~p"/organizations/#{@current_organization}/departments/new"} placeholder="department" />
<% else %> -
+
<%= for {department, collaborators} <- @departments do %> <.link navigate={~p"/organizations/#{@current_organization}/departments/#{department}"}> <.department_card department={department} collaborators={collaborators} /> diff --git a/lib/atomic_web/live/department_live/show.html.heex b/lib/atomic_web/live/department_live/show.html.heex index 9579ae83c..617bdcc35 100644 --- a/lib/atomic_web/live/department_live/show.html.heex +++ b/lib/atomic_web/live/department_live/show.html.heex @@ -15,11 +15,11 @@

- <%= @department.name %> + {@department.name}

<.link navigate={~p"/organizations/#{@organization}"}>

- @<%= @organization.name %> + @{@organization.name}

@@ -88,13 +88,13 @@ color={:white} icon="hero-user-plus-solid" > - <%= gettext("Collaborate") %> + {gettext("Collaborate")} <% end %> <% else %> <%= if ! @current_collaborator.accepted do %> <.button color={:white} icon="hero-user-plus-solid" aria-label={gettext("You have requested to collaborate with this department. Please wait for the department owner to accept your request.")} disabled> - <%= gettext("Collaborate") %> + {gettext("Collaborate")} <% end %> <% end %> @@ -116,21 +116,21 @@ <%= if @current_view == "show" do %>
- <%= @department.description %> + {@department.description}
-

<%= gettext("Recent Activity") %>

+

{gettext("Recent Activity")}

<.link class="mt-4 flex flex-col items-center justify-center" navigate={~p"/organizations/#{@organization}"}> <.avatar class="mb-4 p-1" type={:organization} color={:white} size={:lg} name={@organization.name} src={Uploaders.Logo.url({@organization.logo, @organization}, :original)} /> -

<%= gettext("This department doesn't have any recent activity.") %>

-

<%= gettext("In the meantime, check out %{organization_name}.", organization_name: @organization.name) %>

+

{gettext("This department doesn't have any recent activity.")}

+

{gettext("In the meantime, check out %{organization_name}.", organization_name: @organization.name)}

@@ -169,9 +169,9 @@

Collaborators

<.table items={@collaborators} meta={@meta} filter={[]}> - <:col :let={collaborator} label="Name" field={:string}><%= collaborator.user.name %> - <:col :let={collaborator} label="Email" field={:string}><%= collaborator.user.email %> - <:col :let={collaborator} label="Phone number" field={:string}><%= collaborator.user.phone_number %> + <:col :let={collaborator} label="Name" field={:string}>{collaborator.user.name} + <:col :let={collaborator} label="Email" field={:string}>{collaborator.user.email} + <:col :let={collaborator} label="Phone number" field={:string}>{collaborator.user.phone_number} <:col :let={collaborator} label="Accepted" field={:string}> @@ -195,8 +195,8 @@
<.avatar name={collaborator.user.name} />
-

<%= collaborator.user.name %>

-

@<%= collaborator.user.slug %>

+

{collaborator.user.name}

+

@{collaborator.user.slug}

diff --git a/lib/atomic_web/live/home_live/components/follow_suggestions/follow_suggestions.ex b/lib/atomic_web/live/home_live/components/follow_suggestions/follow_suggestions.ex index 352f4004a..1172f7b5a 100644 --- a/lib/atomic_web/live/home_live/components/follow_suggestions/follow_suggestions.ex +++ b/lib/atomic_web/live/home_live/components/follow_suggestions/follow_suggestions.ex @@ -16,7 +16,7 @@ defmodule AtomicWeb.HomeLive.Components.FollowSuggestions do ~H"""

- <%= title(@current_user) %> + {title(@current_user)}

    @@ -27,7 +27,7 @@ defmodule AtomicWeb.HomeLive.Components.FollowSuggestions do
<.button patch={~p"/organizations"} color={:white} size={:md} full_width> - <%= gettext("View all") %> + {gettext("View all")}
diff --git a/lib/atomic_web/live/home_live/components/follow_suggestions/suggestion.ex b/lib/atomic_web/live/home_live/components/follow_suggestions/suggestion.ex index 3acc261e7..9d47a4e91 100644 --- a/lib/atomic_web/live/home_live/components/follow_suggestions/suggestion.ex +++ b/lib/atomic_web/live/home_live/components/follow_suggestions/suggestion.ex @@ -28,11 +28,11 @@ defmodule AtomicWeb.HomeLive.Components.FollowSuggestions.Suggestion do

- <%= @organization.name %> + {@organization.name}

- <%= ("@" <> @organization.name) |> String.downcase() |> String.replace(" ", "") %> + {("@" <> @organization.name) |> String.downcase() |> String.replace(" ", "")}

diff --git a/lib/atomic_web/live/home_live/components/schedule.ex b/lib/atomic_web/live/home_live/components/schedule.ex index 20a41d399..76ff84f8c 100644 --- a/lib/atomic_web/live/home_live/components/schedule.ex +++ b/lib/atomic_web/live/home_live/components/schedule.ex @@ -12,7 +12,7 @@ defmodule AtomicWeb.HomeLive.Components.Schedule do
<%= if length(@schedule.daily) == 0 && length(@schedule.weekly) == 0 do %>
- <%= show_empty(assigns) %> + {show_empty(assigns)}
<% end %>
@@ -26,17 +26,17 @@ defmodule AtomicWeb.HomeLive.Components.Schedule do
  • - <%= entry.title %> + {entry.title}

    <.icon name="hero-clock-solid" class="size-4" />

    - <%= display_time(entry.start) %> - <%= display_time(entry.finish) %> + {display_time(entry.start)} - {display_time(entry.finish)}

    - <%= maybe_slice_string(entry.description, 100) %> + {maybe_slice_string(entry.description, 100)}

  • @@ -44,13 +44,13 @@ defmodule AtomicWeb.HomeLive.Components.Schedule do
    <.icon name="hero-user-group-solid" class="size-4 font-bold text-green-500" /> <.link navigate={~p"/organizations/#{entry.organization_id}"} class="text-xs text-zinc-400 hover:underline"> - <%= entry.organization.name %> + {entry.organization.name}
    <% else %>
    <.link navigate={~p"/organizations/#{entry.organization_id}"} class="text-xs text-zinc-400 hover:underline"> - <%= entry.organization.name %> + {entry.organization.name}
    <% end %> @@ -58,7 +58,7 @@ defmodule AtomicWeb.HomeLive.Components.Schedule do
    -
    +

    This week

    @@ -69,17 +69,17 @@ defmodule AtomicWeb.HomeLive.Components.Schedule do
  • - <%= entry.title %> + {entry.title}

    <.icon name="hero-calendar-solid" class="size-4" />

    - <%= pretty_display_date(entry.start) %> + {pretty_display_date(entry.start)}

    - <%= maybe_slice_string(entry.description, 150) %> + {maybe_slice_string(entry.description, 150)}

  • @@ -87,13 +87,13 @@ defmodule AtomicWeb.HomeLive.Components.Schedule do
    <.icon name="hero-user-group-solid" class="size-4 font-bold text-green-500" /> <.link navigate={~p"/organizations/#{entry.organization_id}"} class="text-xs text-zinc-400 hover:underline"> - <%= entry.organization.name %> + {entry.organization.name}
    <% else %>
    <.link navigate={~p"/organizations/#{entry.organization.id}"} class="text-xs text-zinc-400 hover:underline"> - <%= entry.organization.name %> + {entry.organization.name}
    <% end %> @@ -111,13 +111,13 @@ defmodule AtomicWeb.HomeLive.Components.Schedule do defp show_empty(assigns) when assigns.tab == "user" do ~H"""

    - <%= gettext("Nothing to do in the next week.") %> + {gettext("Nothing to do in the next week.")}

    - <%= gettext("Try enrolling in some activities.") %> + {gettext("Try enrolling in some activities.")}

    <.button patch={~p"/activities"} color={:white} size={:md} icon="hero-academic-cap"> - <%= gettext("Browse activities") %> + {gettext("Browse activities")} """ end @@ -125,7 +125,7 @@ defmodule AtomicWeb.HomeLive.Components.Schedule do defp show_empty(assigns) when assigns.tab == "all" do ~H"""

    - <%= gettext("No activities scheduled to the next week.") %> + {gettext("No activities scheduled to the next week.")}

    """ end diff --git a/lib/atomic_web/live/home_live/index.ex b/lib/atomic_web/live/home_live/index.ex index 9af04ca75..bbee5d42f 100644 --- a/lib/atomic_web/live/home_live/index.ex +++ b/lib/atomic_web/live/home_live/index.ex @@ -118,7 +118,10 @@ defmodule AtomicWeb.HomeLive.Index do defp fetch_user_schedule(user) do {daily, weekly} = - Activities.list_user_activities(user.id, preloads: [:organization], order_by: [desc: :start]) + Activities.list_user_activities(user.id, + preloads: [:organization], + order_by: [desc: :start] + ) |> Enum.reduce({[], []}, &process_activity/2) %{daily: Enum.take(daily, 3), weekly: Enum.take(weekly, 3)} diff --git a/lib/atomic_web/live/home_live/index.html.heex b/lib/atomic_web/live/home_live/index.html.heex index b82115b06..8425f9b94 100644 --- a/lib/atomic_web/live/home_live/index.html.heex +++ b/lib/atomic_web/live/home_live/index.html.heex @@ -1,38 +1,38 @@
    -
    -
    +
    +
    -