-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- fix: removed duplicated id issues from `EntryEditorComponent` (removed hidden fields and merged entry fields to param programatically before save) - created `Curricula.list_activity_curriculum_items/2` and implemented it in activity details tab, preventing holding unnecessary intermediate join structs in memory
- Loading branch information
Showing
8 changed files
with
124 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 14 additions & 1 deletion
15
lib/lanttern_web/live/strand_live/activity_tabs/details_component.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,30 @@ | ||
defmodule LantternWeb.StrandLive.ActivityTabs.DetailsComponent do | ||
use LantternWeb, :live_component | ||
|
||
alias Lanttern.Curricula | ||
|
||
@impl true | ||
def render(assigns) do | ||
~H""" | ||
<div class="container py-10 mx-auto lg:max-w-5xl"> | ||
<.markdown text={@activity.description} /> | ||
<h3 class="mt-16 font-display font-black text-3xl">Curriculum</h3> | ||
<div :for={curriculum_item <- @activity.curriculum_items} class="mt-6"> | ||
<div :for={curriculum_item <- @curriculum_items} class="mt-6"> | ||
<.badge theme="dark"><%= curriculum_item.curriculum_component.name %></.badge> | ||
<p class="mt-4"><%= curriculum_item.name %></p> | ||
</div> | ||
</div> | ||
""" | ||
end | ||
|
||
@impl true | ||
def update(%{activity: activity} = assigns, socket) do | ||
{:ok, | ||
socket | ||
|> assign(assigns) | ||
|> assign( | ||
:curriculum_items, | ||
Curricula.list_activity_curriculum_items(activity.id, preloads: :curriculum_component) | ||
)} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters