Merge pull request 'devel' (#39) from devel into main

Reviewed-on: #39
This commit is contained in:
inhji 2023-04-01 16:11:58 +02:00
commit 3aae861a90
6 changed files with 28 additions and 14 deletions

View file

@ -69,7 +69,11 @@
}
.prose :where(a):not(:where([class~="not-prose"] *)) {
@apply underline decoration-2 decoration-theme-primary;
@apply underline decoration-1 decoration-theme-primary;
}
.prose :where(h2):not(:where([class~="not-prose"] *)) {
@apply font-serif underline decoration-2 decoration-theme-primary;
}
.prose img {

View file

@ -102,14 +102,6 @@ defmodule ChiyaWeb.AdminComponents do
<.icon name="hero-sun-mini" class="h-4 w-4" />
</.link>
</li>
<li>
<.link
href={~p"/user"}
class="text-xs leading-6 text-gray-100 font-semibold hover:text-gray-300"
>
Profile
</.link>
</li>
<li>
<.link
href={~p"/admin"}

View file

@ -1,5 +1,5 @@
<header class="px-4 sm:px-6 lg:px-8">
<div class="flex items-center justify-end border-b border-gray-100 dark:border-gray-800 py-3">
<div class="flex items-center justify-end border-b border-gray-300 dark:border-gray-800 py-3">
<div class="flex items-center gap-4">
<.link
href={~p"/admin/notes"}

View file

@ -21,7 +21,7 @@
}
</script>
</head>
<body class="bg-white dark:bg-gray-900 antialiased">
<body class="bg-gray-200 dark:bg-gray-900 antialiased">
<.admin_bar current_user={@current_user} />
<%= @inner_content %>
<div id="react-root"></div>

View file

@ -1 +1,19 @@
<.header>Admin</.header>
<section class="p-4 rounded flex gap-4 bg-gray-100 shadow border border-gray-300 dark:border-gray-700 dark:bg-gray-800">
<img
class="rounded-full w-24"
src={ChiyaWeb.Uploaders.UserImage.url({@current_user.user_image, @current_user}, :thumb)}
/>
<div class="flex-1 dark:text-gray-200">
<p class="text-sm text-gray-600 dark:text-gray-400">Welcome back,</p>
<h2 class="text-xl font-semibold"><%= @current_user.email %></h2>
</div>
<.link href={~p"/user"}>
<.button>Profile</.button>
</.link>
</section>
<section class="mt-4 flex gap-4">
<a href="/admin/notes/new" class="p-4 rounded bg-gray-100 shadow border border-gray-300 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-200">
<.icon name="hero-document-plus" /> New Note
</a>
</section>

View file

@ -1,12 +1,12 @@
defmodule ChiyaWeb.Exim do
alias Chiya.Notes.Note
defp frontmatter(%Note{name: title, channels: channels}) do
defp create_frontmatter(%Note{name: title, channels: channels}) do
channels_raw = Enum.map_join(channels, "], [", fn c -> "\"#{c.name}\"" end)
"title: \"#{title}\"\ncategories: [#{channels_raw}]"
end
def export_note(%Note{content: content} = note) do
"---\n#{frontmatter(note)}\n---\n#{content}"
"---\n#{create_frontmatter(note)}\n---\n#{content}"
end
end