-
-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Nicer filtering/sorting look & feel on the explore page
- Loading branch information
Showing
2 changed files
with
55 additions
and
32 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
64 changes: 34 additions & 30 deletions
64
lib/asciinema_web/controllers/recording_html/index.html.heex
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,57 +1,61 @@ | ||
<div class="container"> | ||
<div class="row"> | ||
<div :if={!@sidebar_hidden} class="col-md-2"> | ||
<h2>Explore</h2> | ||
<div class="col-md-12"> | ||
<div class="heading"> | ||
<h2>Published recordings</h2> | ||
|
||
<ul class="nav flex-column"> | ||
<.nav_link title="Featured" href={~p"/explore/featured"} active?={@category == :featured} /> | ||
<.nav_link title="All Public" href={~p"/explore/public"} active?={@category == :public} /> | ||
</ul> | ||
</div> | ||
|
||
<div class={"col-md-#{if @sidebar_hidden, do: 12, else: 10}"}> | ||
<div class="row"> | ||
<div class="col-md-6"> | ||
<h2><%= @page_title %></h2> | ||
</div> | ||
<div class="toggles"> | ||
<div class="filtering"> | ||
<div class="btn-group btn-group-sm"> | ||
<.active_link | ||
href={~p"/explore/featured"} | ||
title="featured" | ||
active?={@category == :featured} | ||
class="btn btn-light" | ||
/> | ||
<.active_link | ||
href={~p"/explore/public"} | ||
title="all public" | ||
active?={@category == :public} | ||
class="btn btn-light sort-popularity" | ||
/> | ||
</div> | ||
</div> | ||
|
||
<div class="col-md-6 text-right"> | ||
<div class="sorting"> | ||
<span>Sort by </span> | ||
|
||
<div class="btn-group btn-group-sm"> | ||
<.active_link | ||
href="?order=date" | ||
title="date" | ||
title="by upload date" | ||
active?={@order == :date} | ||
class="btn btn-light" | ||
/> | ||
<.active_link | ||
href="?order=popularity" | ||
title="popularity" | ||
title="by popularity" | ||
active?={@order == :popularity} | ||
class="btn btn-light sort-popularity" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="row asciicast-list"> | ||
<div class="col"> | ||
<div :for={asciicasts <- Enum.chunk_every(@page, 2, 2)} class="row"> | ||
<div :for={asciicast <- asciicasts} class="col-md-6"> | ||
<.card asciicast={asciicast} /> | ||
</div> | ||
</div> | ||
<div class="row asciicast-list"> | ||
<div class="col"> | ||
<div :for={asciicasts <- Enum.chunk_every(@page, 2, 2)} class="row"> | ||
<div :for={asciicast <- asciicasts} class="col-md-6"> | ||
<.card asciicast={asciicast} /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div :if={@page.total_pages > 1} class="row"> | ||
<div class="col"> | ||
<%= pagination_links(@page, order: @order) %> | ||
</div> | ||
</div> | ||
<div :if={@page.total_pages > 1} class="row"> | ||
<div class="col"> | ||
<%= pagination_links(@page, order: @order) %> | ||
</div> | ||
</div> | ||
</div> |