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

<section class="Category">
    <div class='content'>
        <% if(data.item){ %>
        <form action='/admin/category/edit/<%= data.item.id %>' method='post' >
            <a>ឈ្មោះជំពូកៈ</a><input type='text' value="<%= data.item.title %>" name='title' required />
            <a>រូបសញ្ញាៈ</a><input type='text' value="<%= data.item.thumb %>" name='thumb' required />
            <a>ពេល​បង្កើតៈ</a><input type='datetime-local' value='<%= data.item.date %>' name="datetime" required />
            <a></a><input type='submit' value='បញ្ជូនទិន្នន័យ' />
        </form>
        <% delete data.item %>
        <% }else{ %>
        <form action='/admin/category' method='post' >
            <a>ឈ្មោះជំពូកៈ</a><input type='text' name='title' required />
            <a>រូបសញ្ញាៈ</a><input type='text' name='thumb' required />
            <a>ពេល​បង្កើតៈ</a><input type='datetime-local' value='' name="datetime" required />
            <a></a><input type='submit' value='បញ្ជូនទិន្នន័យ' />
        </form>
        <% } %>
    </div>
</section>

 

/* static/styles/admin/category.css */
.Category .content form{
    width: 60%;
    display: grid;
    grid-template-columns: 20% 80%;
    grid-gap: 5px;
    align-items: center;
}
 
.Category .content form input[type=submit],
.Category .content form input{
    font: var(--body-font);
    padding: 2px 10px;
}
 
.Category .content form a{
    text-align: right;
    color: black;
}

 

Heroku: https://khmerweb-sale.herokuapp.com/login