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

Reviewed-on: #289
This commit is contained in:
inhji 2023-09-08 23:08:05 +02:00
commit 3377daadda
6 changed files with 30 additions and 40 deletions

View file

@ -26,6 +26,8 @@
font-feature-settings: "case", "cpsp", "frac", "salt", "ccmp", "cv01", "cv02", "cv03", "cv04", "cv05", "cv06", "cv07", "cv09", "cv10", "cv11"; font-feature-settings: "case", "cpsp", "frac", "salt", "ccmp", "cv01", "cv02", "cv03", "cv04", "cv05", "cv06", "cv07", "cv09", "cv10", "cv11";
} }
header h1 { @apply text-xl; }
.stack > * + * { .stack > * + * {
margin-block-start: var(--flow-space, 1em); margin-block-start: var(--flow-space, 1em);
} }

View file

@ -11,9 +11,11 @@ defmodule ChiyaWeb.PageHTML do
def note_list_default(assigns) def note_list_default(assigns)
attr :notes, :list, required: true attr :notes, :list, required: true
attr :show_content, :boolean, default: true
def note_list_microblog(assigns) def note_list_microblog(assigns)
attr :notes, :list, required: true attr :notes, :list, required: true
attr :show_content, :boolean, default: true
def note_list_gallery(assigns) def note_list_gallery(assigns)
def tag_list([]), do: "No Tags" def tag_list([]), do: "No Tags"

View file

@ -1,12 +1,9 @@
<%= if @channel do %> <%= if @channel do %>
<section class="mx-auto max-w-2xl"> <header>
<.header> <h1><%= Enum.count(@notes) %> Bookmarks</h1>
Bookmarks </header>
<:subtitle><%= Enum.count(@notes) %> in total</:subtitle>
</.header>
</section>
<section class="mt-6 grid grid-cols-1 md:grid-cols-3 gap-3 max-w-4xl mx-auto"> <section class="mt-6 grid grid-cols-1 md:grid-cols-3 gap-3">
<section class="col-span-1 md:col-span-2"> <section class="col-span-1 md:col-span-2">
<%= if @channel.layout == :default do %> <%= if @channel.layout == :default do %>
<.note_list_default notes={@notes}/> <.note_list_default notes={@notes}/>
@ -40,14 +37,4 @@
</ul> </ul>
</section> </section>
</section> </section>
<% else %>
<section class="mx-auto max-w-2xl">
<.header>
Bookmarks
</.header>
<section class="prose prose-gruvbox mt-6">
Bookmarks not set up.
</section>
</section>
<% end %> <% end %>

View file

@ -1,11 +1,3 @@
<%= if @channel do %> <%= if @channel do %>
<%= if @channel.layout == :default do %> <.note_list notes={@channel.notes} channel={@channel} />
<.note_list_default notes={@channel.notes}/>
<% end %>
<%= if @channel.layout == :gallery do %>
<.note_list_gallery notes={@channel.notes}/>
<% end %>
<%= if @channel.layout == :microblog do %>
<.note_list_microblog notes={@channel.notes}/>
<% end %>
<% end %> <% end %>

View file

@ -0,0 +1,9 @@
<%= if @channel.layout == :default do %>
<.note_list_default notes={@notes_updated}/>
<% end %>
<%= if @channel.layout == :gallery do %>
<.note_list_gallery notes={@notes_updated}/>
<% end %>
<%= if @channel.layout == :microblog do %>
<.note_list_microblog notes={@notes_updated}/>
<% end %>

View file

@ -1,11 +1,9 @@
<%= if @channel do %> <%= if @channel do %>
<section class="mx-auto max-w-2xl"> <header>
<.header> <h1><%= @channel.name %></h1>
<%= @channel.name %> </header>
</.header>
</section>
<section class="mt-6 flex flex-col gap-3 max-w-2xl mx-auto"> <section class="mt-6 flex flex-col">
<section class="prose prose-gruvbox md:prose-lg lg:prose-xl max-w-none"> <section class="prose prose-gruvbox md:prose-lg lg:prose-xl max-w-none">
<%= Markdown.render(@channel.content) |> raw %> <%= Markdown.render(@channel.content) |> raw %>
</section> </section>
@ -15,13 +13,13 @@
<h2 class="text-xl text-theme-base">Recently Updated</h2> <h2 class="text-xl text-theme-base">Recently Updated</h2>
<%= if @channel.layout == :default do %> <%= if @channel.layout == :default do %>
<.note_list_default note={@notes_updated}/> <.note_list_default notes={@notes_updated}/>
<% end %> <% end %>
<%= if @channel.layout == :gallery do %> <%= if @channel.layout == :gallery do %>
<.note_list_gallery note={@notes_updated}/> <.note_list_gallery notes={@notes_updated}/>
<% end %> <% end %>
<%= if @channel.layout == :microblog do %> <%= if @channel.layout == :microblog do %>
<.note_list_microblog note={@notes_updated}/> <.note_list_microblog notes={@notes_updated}/>
<% end %> <% end %>
</div> </div>
@ -29,24 +27,24 @@
<h2 class="text-xl text-theme-base">Recently Published</h2> <h2 class="text-xl text-theme-base">Recently Published</h2>
<%= if @channel.layout == :default do %> <%= if @channel.layout == :default do %>
<.note_list_default note={@notes_published}/> <.note_list_default notes={@notes_published}/>
<% end %> <% end %>
<%= if @channel.layout == :gallery do %> <%= if @channel.layout == :gallery do %>
<.note_list_gallery note={@notes_published}/> <.note_list_gallery notes={@notes_published}/>
<% end %> <% end %>
<%= if @channel.layout == :microblog do %> <%= if @channel.layout == :microblog do %>
<.note_list_microblog note={@notes_published}/> <.note_list_microblog notes={@notes_published}/>
<% end %> <% end %>
</div> </div>
</aside> </aside>
</section> </section>
<% else %> <% else %>
<section class="mx-auto max-w-2xl"> <section>
<.header> <.header>
Wiki Wiki
</.header> </.header>
<section class="prose prose-gruvbox mt-6"> <section class="prose">
Wiki is not set up. Wiki is not set up.
</section> </section>
</section> </section>