25 lines
476 B
Plaintext
25 lines
476 B
Plaintext
<%
|
|
function parseURL() {
|
|
const source = page.source || ''
|
|
var url
|
|
for (let id of Object.keys(map)) {
|
|
if (source.startsWith(id) && map[id]) {
|
|
return source.replace(id, map[id])
|
|
}
|
|
}
|
|
}
|
|
function layoutDiv() {
|
|
const url = parseURL()
|
|
if (url == null) {
|
|
return ''
|
|
}
|
|
var el = ''
|
|
el += `<a class="edit" href="${url_for(url)}">`
|
|
el += icon('default:edit')
|
|
el += `<span>${__('btn.edit')}</span>`
|
|
el += `</a>`
|
|
return el
|
|
}
|
|
%>
|
|
<%- layoutDiv() %>
|