homepage.js/view/admin/panel.pug

86 lines
4.0 KiB
Plaintext
Raw Normal View History

extends ../layout/main.pug
block root
- var title = 'Admin panel'
block head
link(rel='stylesheet' href='/static/ui/control_panel.css')
block content
h2 Admin panel
hr
if !access_level
p(style='color:#a02020;font-weight:bold;font-size:1em')
| Warning: Your access level is unkown, so everything is displayed and some funtions may not work.
hr
- access_level = 4
2023-02-27 14:26:24 +01:00
table(class='control_panel')
tr
td(class='cp_panel_panel')
h5 Guestbook panel
hr
p
2023-02-27 13:13:36 +01:00
if (access_level >= 3)
a(href='/admin/panel/guestbook.editor') Edit data
br
a(href='/admin/panel/guestbook.csv') Download data (.CSV)
br
a(href='/admin/panel/guestbook.csv') Download data (SQL)
2023-02-27 14:26:24 +01:00
if (access_level >= 4)
div(style='padding-left:4px')
form(action='/admin/panel/gb_api')
h5 Import from file
p
b WARNING:
| All the records will be removed and replaced with your values!
label(for='filetype') File type:
select(name='filetype')
option(value='csv') .CSV
option(value='sql') .TSV
br
input(type='file' name='file')
br
input(type='submit' name='import' value='Send')
hr
2023-02-27 13:13:36 +01:00
div(style='max-height:160px;overflow-y:scroll')
2023-02-28 06:34:08 +01:00
table(width='100%')
2023-02-27 14:26:24 +01:00
if (!gb_records || gb_records.length == 0)
p Nothing to show.
2023-02-27 13:13:36 +01:00
each record of gb_records
2023-02-28 06:34:08 +01:00
tr(class='cp_gb_entry' + (record.hidden ? ' cp_gb_entry_hidden' : ''))
2023-02-27 13:13:36 +01:00
form(action='/admin/panel/gb_api' method='POST')
input(type='hidden' name='id' value=record.id)
2023-02-28 06:34:08 +01:00
td(class='cp_gb_entry_name')
2023-02-27 13:13:36 +01:00
a(href='/guestbook#gb_entry_' + record.id)= record.id
2023-02-28 06:34:08 +01:00
| :
b= record.name + ' says:'
2023-02-27 13:13:36 +01:00
td
2023-02-28 06:34:08 +01:00
if (record.text.length > 30)
| #{record.text.substr(0, 340)}...
2023-02-27 13:13:36 +01:00
else
| #{record.text}
2023-02-28 06:34:08 +01:00
if (access_level >= 3)
td(class='cp_gb_entry_hide')
2023-02-27 13:13:36 +01:00
if (!record.hidden)
input(type='submit' name='hide' value='Hide')
else
input(type='submit' name='hide' value='Unhide')
2023-02-27 14:26:24 +01:00
td(class='cp_panel_panel')
h5 Articles
hr
p
a(href='/admin/article/new') Create new article
if (access_level >= 4)
br
a(href='/admin/articles.csv') Download data (.CSV)
br
a(href='/admin/articles.sql') Download data (SQL)
div(style='padding-left:4px')
form(action='/admin/panel/article_api' method='POST')
h5 Import from file
p
2023-03-01 06:50:52 +01:00
b WARNING:
2023-02-27 14:26:24 +01:00
| All the records will be removed and replaced with your values!
hr
if (!articles)
p Nothing to show.