You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
967 B
20 lines
967 B
mixin renderLinkEditor (editorId, link)
|
|
form(
|
|
method="POST",
|
|
data-editor-id= editorId,
|
|
data-editor-clear= !link,
|
|
action= link ? `/link/${link._id}` : '/link',
|
|
onsubmit=`return dtp.app.submitLinkForm(event, '${link ? 'update link' : 'create link'}');`,
|
|
).uk-form
|
|
.uk-margin
|
|
label(for="label").uk-form-label Label
|
|
input(id="label", name="label", type="text", placeholder="Enter link label/title", value= link ? link.label : undefined).uk-input
|
|
.uk-margin
|
|
label(for="href").uk-form-label URL
|
|
input(id="href", name="href", type="text", placeholder="Enter link URL", value= link ? link.href : undefined).uk-input
|
|
div(uk-grid).uk-grid-small
|
|
.uk-width-auto
|
|
button(type="button", uk-toggle={ target: editorId }).uk-button.dtp-button-default Cancel
|
|
.uk-width-auto
|
|
button(type="submit").uk-button.dtp-button-primary
|
|
+renderButtonIcon('fa-plus', link ? 'Update link' : 'Add link')
|