basic http server
This commit is contained in:
6
ui/templates.go
Normal file
6
ui/templates.go
Normal file
@ -0,0 +1,6 @@
|
||||
package ui
|
||||
|
||||
import "embed"
|
||||
|
||||
//go:embed templates/*
|
||||
var Templates embed.FS
|
17
ui/templates/base.html.twig
Normal file
17
ui/templates/base.html.twig
Normal file
@ -0,0 +1,17 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
{%- block meta %}{% endblock -%}
|
||||
<title>{{ title }}</title>
|
||||
{%- block js %}{% endblock -%}
|
||||
{%- block css %}{% endblock -%}
|
||||
</head>
|
||||
<body>
|
||||
{%- block body %}{% endblock -%}
|
||||
{%- block jsbottom %}{% endblock -%}
|
||||
</body>
|
||||
</html>
|
13
ui/templates/index.html.twig
Normal file
13
ui/templates/index.html.twig
Normal file
@ -0,0 +1,13 @@
|
||||
{% extends "layout.html.twig" %}
|
||||
{%- block middle %}
|
||||
<div class="px-4 py-5 my-5 text-center">
|
||||
<h1 class="display-5 fw-bold">Hello {{data.Target}}</h1>
|
||||
<div class="col-lg-6 mx-auto">
|
||||
<p class="lead mb-4">{{data.Message}}</p>
|
||||
<div class="d-grid gap-2 d-sm-flex justify-content-sm-center">
|
||||
<button type="button" class="btn btn-primary btn-lg px-4 gap-3">You got it</button>
|
||||
<button type="button" class="btn btn-outline-secondary btn-lg px-4">Huh?</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock -%}
|
22
ui/templates/layout.html.twig
Normal file
22
ui/templates/layout.html.twig
Normal file
@ -0,0 +1,22 @@
|
||||
{% extends "base.html.twig" %}
|
||||
{%- block css %}
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
|
||||
{% endblock -%}
|
||||
{%- block js %}
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
|
||||
{% endblock -%}
|
||||
{%- block body %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-2">
|
||||
{%- block left -%}{% endblock -%}
|
||||
</div>
|
||||
<div class="col-8">
|
||||
{%- block middle -%}{% endblock -%}
|
||||
</div>
|
||||
<div class="col-2">
|
||||
{%- block right -%}{% endblock -%}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock -%}
|
Reference in New Issue
Block a user