Created the text module
This commit is contained in:
26
modules/text/module.js
Normal file
26
modules/text/module.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
const Joi = require("joi");
|
||||||
|
const {getLinkById} = require("../../server/controller/link");
|
||||||
|
|
||||||
|
module.exports.onClick = async (id, accessId, metaData, controller) => {
|
||||||
|
controller.locals.meta.title = (await getLinkById(id)).title;
|
||||||
|
controller.render(__dirname + "/web/index");
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports.info = {
|
||||||
|
name: "Link mit Text",
|
||||||
|
icon: "clipboard",
|
||||||
|
validationSchema: Joi.object({
|
||||||
|
content: Joi.string().required(),
|
||||||
|
}),
|
||||||
|
meta: [{
|
||||||
|
name: "Link-Einstellungen",
|
||||||
|
type: "default",
|
||||||
|
fields: {
|
||||||
|
content: {
|
||||||
|
type: "text",
|
||||||
|
name: "Dein Text",
|
||||||
|
description: "Der anzuzeigende Text"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}
|
32
modules/text/web/index.ejs
Normal file
32
modules/text/web/index.ejs
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<title><%= meta.title %></title>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
background-color: #f1f1f1;
|
||||||
|
font-family: 'Courier New', serif;
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
span {
|
||||||
|
color: #0d6efd;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<div class="text-center">
|
||||||
|
<h1><%= meta.title %></h1>
|
||||||
|
<p><%= meta.content %></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
Reference in New Issue
Block a user