summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/lilnotes/config.ex8
-rw-r--r--lib/lilnotes_web/components/core_components.ex4
-rw-r--r--lib/lilnotes_web/components/layouts/app.html.heex38
-rw-r--r--lib/lilnotes_web/live/post_live/form_component.ex11
-rw-r--r--lib/lilnotes_web/live/post_live/index.ex2
5 files changed, 45 insertions, 18 deletions
diff --git a/lib/lilnotes/config.ex b/lib/lilnotes/config.ex
index 4e358b6..071f752 100644
--- a/lib/lilnotes/config.ex
+++ b/lib/lilnotes/config.ex
@@ -7,8 +7,12 @@ defmodule LilNotes.Config do
7 "ThatComputerBoy" 7 "ThatComputerBoy"
8 end 8 end
9 9
10 def get_tenant_username do 10 def get_url do
11 "robin" 11 "https://geheimesite.nl"
12 end
13
14 def get_bio do
15 "I'm Robin Boers, but my friends call me Robijntje. I'm a 15-year old frontend designer and Elixir developer from the Netherlands. This is my microblog. "
12 end 16 end
13 17
14 def get_tenant_profile_picture_url do 18 def get_tenant_profile_picture_url do
diff --git a/lib/lilnotes_web/components/core_components.ex b/lib/lilnotes_web/components/core_components.ex
index 5f8f49a..8f64ef5 100644
--- a/lib/lilnotes_web/components/core_components.ex
+++ b/lib/lilnotes_web/components/core_components.ex
@@ -243,7 +243,7 @@ defmodule LilNotesWeb.CoreComponents do
243 <% end %> 243 <% end %>
244 </p> 244 </p>
245 245
246 <div class="p-summary e-content text-xl"> 246 <div class="p-summary e-content text-xl opacity-85">
247 <%= render_slot(@inner_block) %> 247 <%= render_slot(@inner_block) %>
248 </div> 248 </div>
249 249
@@ -253,7 +253,7 @@ defmodule LilNotesWeb.CoreComponents do
253 </a> 253 </a>
254 254
255 <span class="tags"> 255 <span class="tags">
256 <span :for={tag <- @tags} class="p-category">#<%= tag %> </span> 256 <span :for={tag <- @tags} class="p-category ml-2">#<%= tag %></span>
257 </span> 257 </span>
258 </p> 258 </p>
259 </article> 259 </article>
diff --git a/lib/lilnotes_web/components/layouts/app.html.heex b/lib/lilnotes_web/components/layouts/app.html.heex
index ebdb9a3..b0ffaca 100644
--- a/lib/lilnotes_web/components/layouts/app.html.heex
+++ b/lib/lilnotes_web/components/layouts/app.html.heex
@@ -1,16 +1,30 @@
1<header class="flex items-center justify-center border-b bg-white border-zinc-100 py-3 text-sm shadow-sm pb-6"> 1<header class="flex items-center justify-center border-b bg-white border-zinc-100 py-3 text-sm shadow-sm pb-6">
2 <a class="flex items-center gap-4" href={~p"/"}> 2 <div>
3 <img 3 <div class="flex items-center gap-4">
4 class="rounded-full aspect-square object-cover w-16 h-auto" 4 <img
5 src={LilNotes.Config.get_tenant_profile_picture_url()} 5 class="rounded-lg aspect-square object-cover w-28 h-auto"
6 /> 6 src={LilNotes.Config.get_tenant_profile_picture_url()}
7 <hgroup> 7 />
8 <h1 class="text-xl font-bold"> 8 <hgroup>
9 <%= LilNotes.Config.get_blog_name() %> 9 <a href={~p"/"}>
10 </h1> 10 <h1 class="text-xl font-bold">
11 <p>@<%= LilNotes.Config.get_tenant_username() %></p> 11 <%= LilNotes.Config.get_blog_name() %>
12 </hgroup> 12 </h1>
13 </a> 13 </a>
14 <p>
15 <a href={LilNotes.Config.get_url()} class="font-semibold text-vivid hover:underline">
16 <%= LilNotes.Config.get_url() %>
17 </a>
18 </p>
19
20 <p class="mt-2 max-w-[60ch]">
21 <%= LilNotes.Config.get_bio() %>
22 </p>
23 </hgroup>
24 </div>
25
26
27 </div>
14</header> 28</header>
15<main class="px-4 py-20 sm:px-6 lg:px-8"> 29<main class="px-4 py-20 sm:px-6 lg:px-8">
16 <div class="mx-auto max-w-2xl"> 30 <div class="mx-auto max-w-2xl">
diff --git a/lib/lilnotes_web/live/post_live/form_component.ex b/lib/lilnotes_web/live/post_live/form_component.ex
index d6b0096..4087c24 100644
--- a/lib/lilnotes_web/live/post_live/form_component.ex
+++ b/lib/lilnotes_web/live/post_live/form_component.ex
@@ -36,7 +36,12 @@ defmodule LilNotesWeb.PostLive.FormComponent do
36 <.input field={@form[:title]} type="text" label="Title" /> 36 <.input field={@form[:title]} type="text" label="Title" />
37 <.input field={@form[:content]} type="textarea" label="Content" /> 37 <.input field={@form[:content]} type="textarea" label="Content" />
38 38
39 <.input field={@form[:tags]} type="text" label="Tags (comma-seperated)" value={@form[:tags].value |> Enum.join(",")} /> 39 <.input
40 field={@form[:tags]}
41 type="text"
42 label="Tags (comma-seperated)"
43 value={format_comma_seperated_list(@form[:tags])}
44 />
40 45
41 <.input field={@form[:slug]} type="text" label="Slug" /> 46 <.input field={@form[:slug]} type="text" label="Slug" />
42 47
@@ -48,6 +53,10 @@ defmodule LilNotesWeb.PostLive.FormComponent do
48 """ 53 """
49 end 54 end
50 55
56 defp format_comma_seperated_list(form_field) do
57 Enum.join(form_field.value || [], ",")
58 end
59
51 @impl true 60 @impl true
52 def update(%{post: post} = assigns, socket) do 61 def update(%{post: post} = assigns, socket) do
53 changeset = Blog.change_post(post) 62 changeset = Blog.change_post(post)
diff --git a/lib/lilnotes_web/live/post_live/index.ex b/lib/lilnotes_web/live/post_live/index.ex
index 9efa77c..7514d5a 100644
--- a/lib/lilnotes_web/live/post_live/index.ex
+++ b/lib/lilnotes_web/live/post_live/index.ex
@@ -28,7 +28,7 @@ defmodule LilNotesWeb.PostLive.Index do
28 28
29 defp apply_action(socket, :index, _params) do 29 defp apply_action(socket, :index, _params) do
30 socket 30 socket
31 |> assign(:page_title, "Listing Posts") 31 |> assign(:page_title, "My posts")
32 |> assign(:post, nil) 32 |> assign(:post, nil)
33 end 33 end
34 34