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

Reviewed-on: #340
This commit is contained in:
inhji 2023-09-23 22:49:48 +02:00
commit c05259118f
5 changed files with 28 additions and 12 deletions

View File

@ -25,8 +25,8 @@
font-feature-settings: "case", "cpsp", "frac", "salt", "ccmp", "cv01", "cv02", "cv03", "cv04", "cv05", "cv06", "cv07", "cv09", "cv10", "cv11";
}
body {
@apply bg-gradient-to-br from-background from-50% to-rose-100 text-foreground;
body#site-body {
@apply bg-gradient-to-br from-background from-50% to-rose-100 dark:to-rose-950 text-foreground;
}
.stack > * + * {
@ -49,7 +49,7 @@
/* === SITE HEADER === */
#site-header {
@apply block px-3 py-6 bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 text-white print:hidden;
@apply sticky top-0 block px-3 py-6 bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 text-white print:hidden;
& nav ul {
@apply flex;
@ -58,6 +58,10 @@
& a {
@apply p-3 rounded transition border border-transparent hover:border-white;
}
& #site-title {
@apply font-bold uppercase;
}
}
/* === PRIMARY SIDEBAR === */
@ -67,7 +71,7 @@
@apply prose-a:no-underline;
& nav {
@apply flex justify-around md:flex-row lg:flex-col mb-6 lg:mb-0;
@apply flex justify-between md:flex-row lg:flex-col mb-6 lg:mb-0;
}
& h3 {
@ -83,7 +87,7 @@
#site-content {
@apply grid grid-cols-1 lg:grid-cols-5 gap-0 lg:gap-12;
@apply sm:mt-12 px-3 sm:px-0;
@apply mt-6 sm:mt-12 px-6 sm:px-0;
#content-wrapper {
@apply col-span-4;
@ -97,7 +101,7 @@
/* === SITE FOOTER === */
#site-footer {
@apply mt-8 prose max-w-none;
@apply p-8 mt-8 max-w-none bg-foreground/20 border-t border-foreground/10;
}
/* === CONCERNING MULTIPLE LAYOUT BLOCKS === */

View File

@ -63,6 +63,7 @@ defmodule Chiya.Notes do
|> where([n], fragment("? ~ ?", n.name, ^tag.regex))
|> or_where([n], fragment("? ~ ?", n.url, ^tag.regex))
|> or_where([n], fragment("? ~ ?", n.content, ^tag.regex))
|> preload(^@preloads)
|> Repo.all()
end

View File

@ -35,12 +35,12 @@
<%= @settings.custom_css %>
</style>
</head>
<body class="h-feed hfeed">
<body id="site-body" class="h-feed hfeed">
<header id="site-header">
<nav class="container">
<ul>
<li>
<a href="/">Home</a>
<a href="/" id="site-title">Inhji.de</a>
</li>
<li class="flex-1"></li>
<%= if @current_user do %>
@ -106,7 +106,7 @@
</main>
<footer id="site-footer" class="container">
<p class="container text-center">
<p class="text-center">
Struggling to make a decent website since 2011
</p>
</footer>

View File

@ -15,7 +15,18 @@ defmodule ChiyaWeb.TagController do
def apply_prepare(conn, %{"id" => id}) do
tag = Tags.get_tag!(id)
notes = Chiya.Notes.list_apply_notes(tag)
notes =
tag
|> Chiya.Notes.list_apply_notes()
|> Enum.filter(fn note ->
exists =
note.tags
|> Enum.map(fn t -> t.name end)
|> Enum.member?(tag.name)
!exists
end)
render(conn, :apply_prepare, tag: tag, notes: notes)
end

View File

@ -4,7 +4,7 @@
</.header>
<section class="card-list mt-8">
<h3 class="leading-normal text-xl">With Regex</h3>
<h3 class="leading-normal text-xl dark:text-gray-100">With Regex</h3>
<%= for tag <- Enum.filter(@tags, fn t -> !!t.regex end) do %>
<article class="card">
@ -25,7 +25,7 @@
</section>
<section class="card-list mt-8">
<h3 class="leading-normal text-xl">Without Regex</h3>
<h3 class="leading-normal text-xl dark:text-gray-100">Without Regex</h3>
<%= for tag <- Enum.filter(@tags, fn t -> !t.regex end) do %>
<article class="card">