Skip to content

Commit

Permalink
Move search form to header
Browse files Browse the repository at this point in the history
  • Loading branch information
ego008 committed Jun 24, 2024
1 parent 47d5fc2 commit f67da17
Show file tree
Hide file tree
Showing 3 changed files with 227 additions and 228 deletions.
7 changes: 4 additions & 3 deletions static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ h1.br-nav, h2.br-nav, h3.br-nav, h4.br-nav {color:#777;font-size: 1em;font-weigh
.main-right-body {padding: 0;}

.body-nav {background-color: var(--main-bg-color);}
.sf {display: inline-block;}
.sf input {width: 130px; font-size: .7em;}

.index {padding: .5em;background-color: var(--main-bg-color);}
.index article {border-bottom: 1px solid var(--line-color);}
Expand Down Expand Up @@ -311,8 +313,6 @@ body>footer a:hover {color: #eee}
display: inline-block;}
#recent_comments li a {color: #333;text-decoration:none;}
#recent_comments li a:hover {color:#000;text-decoration: underline;}
.sidebar section.search-form {color: #333;background-color:var(--bar-bg-color);text-align: center;padding: .5em}
.sidebar section.search-form input {background-color: #FCFCFC;line-height: .8em;padding: .2em .5em;}
#top-category-list {line-height: 1.8em;padding: .5em 1em .5em 1em;font-size: .9em;max-height: 163px;overflow: auto;}
#top-category-list a {color: #333;text-decoration:none;padding: 2px 4px;}
#top-category-list a:hover {color: #fff;background-color: #464747}
Expand Down Expand Up @@ -347,6 +347,7 @@ body>footer a:hover {color: #eee}

a.top {
font-size: 0;
opacity: 0;
font-family: Helvetica,Arial,Verdana,sans-serif;
position: fixed;
bottom: 100px;
Expand All @@ -367,7 +368,7 @@ a.top {
color: #666;
background: rgba(255, 255, 255, .5);
}
a.top.visible {font-size: 24px;}
a.top.visible {opacity:1;font-size: 24px;}
a.top:hover{background: rgba(200, 200, 200, .8);}

#id-msg {color: rgb(202, 60, 60);}
Expand Down
11 changes: 5 additions & 6 deletions views/ybs/base.qtpl
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ Page prints a page implementing Page interface.
// Banner bg
{% func (p *BasePage) Banner() %}
<a href="/" class="pure-menu-heading pure-menu-link">{%s p.SiteCf.Name %}</a>
<div class="sf">
<form action="/q" method="get" class="pure-form">
<input type="text" name="q" class="pure-input-rounded" placeholder="站内搜索" autocomplete="off" />
</form>
</div>
<ul class="pure-menu-list">
{% if p.CurrentUser.ID > 0 %}
<li class="pure-menu-item pure-menu-has-children pure-menu-allow-hover">
Expand Down Expand Up @@ -177,12 +182,6 @@ This is a base MainBody
{% func (p *BasePage) Aside() %}
<aside class="sidebar">

<section class="search-form">
<form action="/q" method="get" class="pure-form">
<input type="text" name="q" class="pure-input-rounded" placeholder="站内搜索" autocomplete="off" />
</form>
</section>

{% if len(p.RecentComment)>0 %}
<section>
<h1>💬 最近评论</h1>
Expand Down
Loading

0 comments on commit f67da17

Please sign in to comment.