<!--views/dashboard/admin.tpl-->
% rebase('base.tpl')

<link href="/static/styles/partials/header.css" rel="stylesheet"></link>

<section class='Head'>
    <header class='region'>
        <div class='site-logo'>{{ data['pageTitle'] }}</div>

        <form action='/backend/search' method='post'>
            <select name="select">
                <option>ការផ្សាយ</option>
                <option>ជំពូក</option>
                <option>សៀវភៅ</option>
                <option>អ្នក​ប្រើប្រាស់</option>
            </select>
            <input type='text' name="q" placeholder="Search" required />
            <input type="submit" value='បញ្ជូន'​ />
        </form>

        <div class='logout'><a href='/'>ទំព័រ​មុខ</a> | <a href='/login/logout'>ចេញ​ក្រៅ</a></div>
    </header>
</section>

 

/*asset/css/partials/header.css*/
.Head{
    background: var(--foreground);
    padding: 7px;
    border-bottom: 7px solid white;
}

.Head header{
    display: grid;
    grid-template-columns: 25% auto 25%;
    align-items: center;
}

.Head .site-logo{
    font: 22px/1.5 Limonf3;
}

.Head form{
    display: grid;
    grid-template-columns: 20% auto 15%;
}

.Head form input, .Head form select{
    font: 14px/1.5 Vidaloka, OdorMeanChey;
    padding: 0 5px;
}

.Head .logout{
    text-align: right;
    font-size: 18px;
}

.Head .logout a{
    color: white;
}

 

#controllers/frontend/login/logout.py
import config
from bottle import response, redirect

def call():
    response.delete_cookie('userID', path='/', secret=config.kdict['SECRET_KEY'])
    redirect('/')

 

GitHub: https://github.com/Sokhavuth/khmerweb-multimedia

Vercel: https://khmerweb-multimedia.vercel.app/