<!doctype html><html lang="id"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title><%= title %></title><link rel="stylesheet" href="/public/newsroom.css"></head><body class="admin-page"><%- include('nav') %><main class="admin-main"><h1><%= title %></h1><form class="master-form" method="post" action="/admin/<%= path %>"><input type="hidden" name="_csrf" value="<%= csrfToken %>"><% fields.forEach(f=>{ %><label><%= f.replaceAll('_',' ') %><input name="<%= f %>" <%= ['name','keyword'].includes(f)?'required':'' %>></label><% }) %><button>Tambah</button></form><div class="table-wrap"><table><tr><% fields.forEach(f=>{ %><th><%= f %></th><% }) %><% if(path==='sources'){ %><th>Aksi</th><% } %></tr><% rows.forEach(row=>{ %><tr><% fields.forEach(f=>{ %><td><%= row[f]??'' %></td><% }) %><% if(path==='sources'){ %><td><form method="post" action="/admin/sources/<%= row.id %>/run"><input type="hidden" name="_csrf" value="<%= csrfToken %>"><button <%= row.is_active?'':'disabled' %>>Jalankan</button></form></td><% } %></tr><% }) %></table></div></main></body></html>
