Compare commits
No commits in common. "1ea2f3dfaa074fd5e4ff5a57de91d7ce9280c264" and "15e9e7623b177a10a2a14b8f203fb5d352f1eddb" have entirely different histories.
1ea2f3dfaa
...
15e9e7623b
|
@ -1,50 +0,0 @@
|
||||||
//-
|
|
||||||
This template accepts following parameters:
|
|
||||||
title - Page title
|
|
||||||
endpoint - Where the data should be returned
|
|
||||||
description - Description for user
|
|
||||||
pref_method - Method to return data with
|
|
||||||
data - Types and names of data
|
|
||||||
|
|
||||||
data is an JSON of objects with following structure:
|
|
||||||
id: {
|
|
||||||
name?: string,
|
|
||||||
type?: string(text|textarea|codearea|boolean|number|email),
|
|
||||||
def?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
btn_name - Change the name of send button
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extends ../layout/main.pug
|
|
||||||
block root
|
|
||||||
-
|
|
||||||
if (title == undefined)
|
|
||||||
var title = 'Data editor'
|
|
||||||
|
|
||||||
block content
|
|
||||||
h1= title
|
|
||||||
if (description)
|
|
||||||
p !{description}
|
|
||||||
hr
|
|
||||||
form(action=endpoint ? endpoint : '' method=pref_method ? pref_method : 'POST')
|
|
||||||
table
|
|
||||||
if (data)
|
|
||||||
each row, key in data
|
|
||||||
tr
|
|
||||||
td= row.name
|
|
||||||
td :
|
|
||||||
td
|
|
||||||
case row.type
|
|
||||||
when 'text'
|
|
||||||
input(type='text' name=key)
|
|
||||||
when 'textarea'
|
|
||||||
textarea(name=key)
|
|
||||||
when 'codearea'
|
|
||||||
textarea(name=key style='font-family:monospace')
|
|
||||||
when 'email'
|
|
||||||
input(type='email' name=key)
|
|
||||||
default
|
|
||||||
input(type='text' name=key)
|
|
||||||
input(type='submit' value=btn_name ? btn_name : 'Send!')
|
|
|
@ -33,7 +33,7 @@ block content
|
||||||
| #{entry.text}
|
| #{entry.text}
|
||||||
a(href='/guestbook') Write something in my guestbook!
|
a(href='/guestbook') Write something in my guestbook!
|
||||||
td(width='50%' style='border-left:1px solid #c2c4c2;border-right:1px solid #c2c4c2;padding:0 1%')
|
td(width='50%' style='border-left:1px solid #c2c4c2;border-right:1px solid #c2c4c2;padding:0 1%')
|
||||||
h3 Articles
|
h3 Blog
|
||||||
ul
|
ul
|
||||||
each article in articles
|
each article in articles
|
||||||
li(style='font-size:16pt')
|
li(style='font-size:16pt')
|
||||||
|
|
Loading…
Reference in New Issue