Add search bar to channel page.

Closes #1923
This commit is contained in:
syeopite 2021-04-10 03:05:48 -07:00
parent d7901a99f8
commit 7276edddf8
No known key found for this signature in database
GPG Key ID: 6FA616E5A5294A82
2 changed files with 30 additions and 1 deletions

View File

@ -163,6 +163,13 @@ img.thumbnail {
top: -0.7em;
}
.search-button {
border: none;
color: #3E4446;
background: transparent;
font-size: 1.1em;
}
/*
* Navbar
*/
@ -421,6 +428,13 @@ body.dark-theme {
color: inherit;
}
.dark-theme .search-button {
border: none;
color: #B0ADA4;
background: transparent;
font-size: 1.1em;
}
.dark-theme .pure-menu-link:hover, .dark-theme .pure-menu-link:active {
background-color: rgb(34, 36, 38)
}
@ -504,3 +518,7 @@ hr {
order: 1;
margin-top: 20px;
}
#content-navigation {
margin-bottom: 0.5em;
}

View File

@ -38,7 +38,7 @@
<%= rendered "components/subscribe_widget" %>
</div>
<div class="pure-g h-box">
<div class="pure-g h-box" id="content-navigation">
<div class="pure-u-1-3">
<!-- <a href="https://www.youtube.com/channel/<%= channel.ucid %>"><%= translate(locale, "View channel on YouTube") %></a> -->
<!-- <a href="/redirect?referer=<%= env.get?("current_page") %>"><%= translate(locale, "Switch Invidious Instance") %></a> -->
@ -67,6 +67,17 @@
</a>
<% end %>
</li>
<li class="pure-menu-item navbar" style="margin: 0 0 0 0.5em">
<div class="searchbar">
<form class="pure-form" action="/search" method="get">
<fieldset>
<button class="search-button"><i class="icon ion-md-search"></i></button>
<input type="search" name="q" placeholder="<%= translate(locale, "search") %>" value="<%= env.get?("search").try {|x| HTML.escape(x.as(String)) } %>">
<input type="hidden" name="channel" value="<%= channel.ucid %>">
</fieldset>
</form>
</div>
</li>
</ui>
</div>
</div>