<!--views/base.ejs-->
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <title><%= data.siteTitle %> | <%= data.pageTitle %></title>
        <link href="/fonts/setup.css" rel="stylesheet">
        <link href="/styles/base.css" rel="stylesheet">
        <link href="/images/siteLogo.png" rel="icon" ></link>
        <script src="/scripts/jquery.js"></script>
    </head>
    <body>
        <% if(data.route.includes('/login')){ %>
            <%- include('admin/login.ejs') %>
        <% }else if(data.route.includes('/admin/')){ %>
            <%- include('admin/index.ejs') %>
        <% }else if(data.route == '/'){ %>
            <%- include('front/index.ejs') %>
        <% } %>
    </body>
</html>

 

<!--views/admin/index.ejs-->
<link href="/styles/admin/index.css" rel="stylesheet">

<section class="Header">
    <div class="wrapper region">
        <div class="logo"><%= data.pageTitle %></div>
        <form method="post" action="/search">
            <select name="type">
                <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="/admin/logout">ចេញ​ក្រៅ</a>
        </div>
    </div>
</section>

<section class="Body">
    <div class="wrapper region">
        <div class="sidebar">
            <a href='/admin/post'><img src='/images/movie.png' /></a>
            <a href='/admin/post'>ការផ្សាយ</a>
            
            <a href='/admin/category'><img src='/images/category.png' /></a>
            <a href='/admin/category'>ជំពូក</a>
            
            <a href='/admin/book'><img src='/images/books.png' /></a>
            <a href='/admin/book'>សៀវភៅ</a>
            
            <a href='/admin/upload'><img src='/images/upload.png' /></a>
            <a href='/admin/upload'>Upload</a>
            
            <a href='/admin/user'><img src='/images/users.png' /></a>
            <a href='/admin/user'>អ្នក​ប្រើប្រាស់</a>
            
            <a href='/admin/setting'><img src='/images/setting.png' /></a>
            <a href='/admin/setting'>Setting</a>
        </div>
        <div class="editor">
           
        </div>
    </div>
</section>

 

/* public/styles/admin/index.css */
.Header{
    background: var(--background-dark);
    border-bottom: 8px solid white;
}

.Header .wrapper{
    padding: 10px 0;
    display: grid;
    grid-template-columns: 25% 50% 25%;
    align-items: center;
}

.Header .wrapper .logo{
    font: 22px/1.5 Anton, Limonf3;
}

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

.Header .wrapper form input,
.Header .wrapper form select{
    font: var(--background-light);
    padding: 0 5px;
}

.Header .wrapper .logout{
    text-align: right;
}

.Body .wrapper{
    display: grid;
    grid-template-columns: 25% auto;
    margin-top: 20px;
}

.Body .wrapper .sidebar{
    max-height: 600px;
    padding: 20px;
    display: grid;
    grid-template-columns: 25% auto;
    grid-gap: 10px;
    align-items: center;
    background: white;
    margin-right: 10px;
}

.Body .wrapper .sidebar a img{
    width: 100%;
}

.Body .wrapper .sidebar a{
    font: 18px/1.5 Koulen, Oswald;
    color: grey;
}

 

GitHub: https://github.com/Sokhavuth/Blog_

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