Init
8
web/embed.go
Normal file
@@ -0,0 +1,8 @@
|
||||
package web
|
||||
|
||||
import "embed"
|
||||
|
||||
// Content holds the HTML templates and static assets for the web UI.
|
||||
//
|
||||
//go:embed templates/* static
|
||||
var Content embed.FS
|
||||
1
web/static/lib/htmx.2.0.7.min.js
vendored
Normal file
BIN
web/static/lib/tuicss/fonts/Perfect DOS VGA 437 Win.ttf
Normal file
BIN
web/static/lib/tuicss/fonts/Perfect DOS VGA 437.ttf
Normal file
72
web/static/lib/tuicss/fonts/dos437.txt
Normal file
@@ -0,0 +1,72 @@
|
||||
/
|
||||
/(_____________ ____
|
||||
\ /______)\ | |
|
||||
:\ | / \:| |:::::::::: : .. . : .. . . :. .
|
||||
\_____| / | \| |______
|
||||
___ / ________ \... . . .
|
||||
\______________ \ | | /.. . . . . .
|
||||
\ |__| /
|
||||
--x--x-----x----\______ |-/_____/-x--x-xx--x-- - -x -- - - -- - - -
|
||||
. . . . . . . . . . . .\____|. . . . . .
|
||||
-------------------------------------------------------------------------------
|
||||
>> perfect dos vga 437 - general information >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
"Perfect DOS VGA 437" and "Perfect DOS VGA 437 Win" are truetype fonts
|
||||
designed to emulate the MS-DOS/Text mode standard font, used on VGA monitors,
|
||||
with the 437 Codepage (standard US/International). This is a "bitmap" font,
|
||||
meaning it emulates a bitmap font and can only be used at a given size (8 or
|
||||
multiples of it like 16, 24, 32, etc). It's optimized for Flash too, so it
|
||||
won't produce antialias if used at round positions.
|
||||
|
||||
There are two fonts available. "Perfect DOS VGA 437" uses the original DOS
|
||||
codepage 437. It should be used, for example, if you're opening DOS ASCII
|
||||
files on notepad or another windows-based editor. Since it's faithful to the
|
||||
original DOS codes, it won't accent correctly in windows ("é" would produce
|
||||
something different, not an "e" with an acute).
|
||||
|
||||
There's also "Perfect DOS VGA 437 Win" which is the exactly same font adapted
|
||||
to a windows codepage. This should use accented characters correctly but won't
|
||||
work if you're opening a DOS-based text file.
|
||||
|
||||
UPDATE: this is a new version, updated in august/2008. It has fixed leading
|
||||
metrics for Mac systems.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
>> perfect dos vga 437 - creation process >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
This font was created to be used on a Flash-based ANSi viewer I'm working. To
|
||||
create it, I created a small Quick Basic program to write all characters on
|
||||
screen,
|
||||
|
||||
CLS
|
||||
FOR l = 0 TO 255
|
||||
charWrite 1 + (l MOD 20), 1 + (l \ 20) * 6 + (l MOD 2), LTRIM$(RTRIM$(STR$(l))) + CHR$(l)
|
||||
NEXT
|
||||
SUB charWrite (lin, col, char$)
|
||||
DEF SEG = &HB800
|
||||
FOR i = 1 TO LEN(char$)
|
||||
POKE ((lin - 1) * 160) + ((col - 2 + i) * 2), ASC(MID$(char$, i, 1))
|
||||
IF (i = LEN(char$)) THEN POKE ((lin - 1) * 160) + ((col - 2 + i) * 2) + 1, 113
|
||||
NEXT
|
||||
END SUB
|
||||
|
||||
Then captured the text screen using SCREEN THIEF (a very, very old screen
|
||||
capture TSR program which converts text screens to images accurately). I then
|
||||
recreated the font polygon by polygon on Fontlab, while looking at the image
|
||||
on Photoshop. No conversion took place.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
>> author >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
zeh fernando remembers the old days. SMASH DAH FUCKING ENTAH.
|
||||
|
||||
http://www.fatorcaos.com.br
|
||||
|
||||
rorshack ^ maiden brazil
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
^zehPULLSdahTRICK^kudosOUTtoWHOkeepsITreal^smashDAHfuckingENTAH!!!^lowres4ever^
|
||||
-------------------------------------------------------------------------------
|
||||
BIN
web/static/lib/tuicss/images/bg-blue-black.png
Normal file
|
After Width: | Height: | Size: 166 B |
BIN
web/static/lib/tuicss/images/bg-blue-white.png
Normal file
|
After Width: | Height: | Size: 168 B |
BIN
web/static/lib/tuicss/images/bg-cyan-black.png
Normal file
|
After Width: | Height: | Size: 168 B |
BIN
web/static/lib/tuicss/images/bg-cyan-white.png
Normal file
|
After Width: | Height: | Size: 165 B |
BIN
web/static/lib/tuicss/images/bg-green-black.png
Normal file
|
After Width: | Height: | Size: 168 B |
BIN
web/static/lib/tuicss/images/bg-green-white.png
Normal file
|
After Width: | Height: | Size: 165 B |
BIN
web/static/lib/tuicss/images/bg-orange-black.png
Normal file
|
After Width: | Height: | Size: 168 B |
BIN
web/static/lib/tuicss/images/bg-orange-white.png
Normal file
|
After Width: | Height: | Size: 165 B |
BIN
web/static/lib/tuicss/images/bg-purple-black.png
Normal file
|
After Width: | Height: | Size: 168 B |
BIN
web/static/lib/tuicss/images/bg-purple-white.png
Normal file
|
After Width: | Height: | Size: 165 B |
BIN
web/static/lib/tuicss/images/bg-red-black.png
Normal file
|
After Width: | Height: | Size: 166 B |
BIN
web/static/lib/tuicss/images/bg-red-white.png
Normal file
|
After Width: | Height: | Size: 165 B |
BIN
web/static/lib/tuicss/images/bg-yellow-black.png
Normal file
|
After Width: | Height: | Size: 168 B |
BIN
web/static/lib/tuicss/images/bg-yellow-white.png
Normal file
|
After Width: | Height: | Size: 165 B |
BIN
web/static/lib/tuicss/images/scroll-blue.png
Normal file
|
After Width: | Height: | Size: 166 B |
BIN
web/static/lib/tuicss/images/scroll-cyan.png
Normal file
|
After Width: | Height: | Size: 168 B |
BIN
web/static/lib/tuicss/images/scroll-green.png
Normal file
|
After Width: | Height: | Size: 167 B |
BIN
web/static/lib/tuicss/images/scroll-orange.png
Normal file
|
After Width: | Height: | Size: 167 B |
BIN
web/static/lib/tuicss/images/scroll-purple.png
Normal file
|
After Width: | Height: | Size: 168 B |
BIN
web/static/lib/tuicss/images/scroll-red.png
Normal file
|
After Width: | Height: | Size: 167 B |
BIN
web/static/lib/tuicss/images/scroll-white.png
Normal file
|
After Width: | Height: | Size: 168 B |
BIN
web/static/lib/tuicss/images/scroll-yellow.png
Normal file
|
After Width: | Height: | Size: 167 B |
2704
web/static/lib/tuicss/tuicss.css
Normal file
256
web/static/lib/tuicss/tuicss.js
Normal file
@@ -0,0 +1,256 @@
|
||||
/**
|
||||
* Replacement for jQuery's $(document).ready() function.
|
||||
* This is handy in making sure stuff fires after the DOM is ready to be touched.
|
||||
* Stolen from:https://stackoverflow.com/a/53601942/344028
|
||||
*
|
||||
* @param fn Callback.
|
||||
*/
|
||||
function domReady(fn) {
|
||||
// If we're early to the party
|
||||
document.addEventListener('DOMContentLoaded', fn);
|
||||
|
||||
// If late; I mean on time.
|
||||
if (document.readyState === 'interactive' || document.readyState === 'complete') {
|
||||
fn();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TuiTabs controller
|
||||
*/
|
||||
function tabsController() {
|
||||
// Get all the tab elements (typically li tags).
|
||||
const tabs = document.getElementsByClassName('tui-tab');
|
||||
|
||||
if (!tabs.length) {
|
||||
// No tabs found, return early and save a couple CPU cycles.
|
||||
return;
|
||||
}
|
||||
|
||||
for (const tab of tabs) {
|
||||
// Add click listeners to them.
|
||||
tab.addEventListener('click', function (e) {
|
||||
|
||||
// Check if the clicked tab is disabled
|
||||
if(e.target.classList.contains("disabled")) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove the 'active' class from any and all tabs.
|
||||
for (const otherTab of tabs) {
|
||||
otherTab.classList.remove('active');
|
||||
}
|
||||
|
||||
// Get the content element.
|
||||
const tabContents = document.getElementsByClassName('tui-tab-content');
|
||||
|
||||
if (tabContents) {
|
||||
for (const tabContent of tabContents) {
|
||||
// Hide all tab contents.
|
||||
tabContent.style.display = 'none';
|
||||
}
|
||||
} else {
|
||||
throw 'No tab content elements found.'
|
||||
}
|
||||
|
||||
// Get the id of the tab contents we want to show.
|
||||
const tabContentId = e.target.getAttribute('data-tab-content');
|
||||
|
||||
if (tabContentId) {
|
||||
const tabContent = document.getElementById(tabContentId);
|
||||
if (tabContent) {
|
||||
// Show the tab contents.
|
||||
tabContent.style.display = 'block';
|
||||
} else {
|
||||
throw 'No tab content element with id "' + tabContentId + '" found.';
|
||||
}
|
||||
}
|
||||
// We are not going to throw an error here, since we could make the tab do something else that a tab
|
||||
// normally wouldn't do.
|
||||
|
||||
// Set the clicked tab to have the 'active' class so we can use it in the next part.
|
||||
e.target.classList.add('active');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// Grab the first tab with the active class.
|
||||
const activeTab = document.querySelector('.tui-tab.active');
|
||||
if (activeTab) {
|
||||
// Now click it 'click' it.
|
||||
activeTab.click();
|
||||
} else {
|
||||
// Nothing found, just click the first tab foud.
|
||||
tabs[0].click()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Date/time field controller
|
||||
*/
|
||||
function datetimeController() {
|
||||
// Get date/time elements.
|
||||
const clocks = document.getElementsByClassName('tui-datetime');
|
||||
|
||||
if (!clocks.length) {
|
||||
// No date time elements found, return early and save a couple CPU cycles.
|
||||
return;
|
||||
}
|
||||
|
||||
// Kick off our clock interval stuff.
|
||||
datetimeInterval();
|
||||
|
||||
// Synchronize time and set interval to control the clocks
|
||||
setTimeout(() => {
|
||||
setInterval(datetimeInterval, 1000);
|
||||
}, 1000 - new Date().getMilliseconds());
|
||||
|
||||
function datetimeInterval() {
|
||||
for (const clock of clocks) {
|
||||
if (clock === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get the format we want to display in the element.
|
||||
let format = clock.getAttribute('data-format');
|
||||
|
||||
// parse out the date and time into constants.
|
||||
const today = new Date();
|
||||
const month = (today.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = today.getDate().toString().padStart(2, '0');
|
||||
const dayOfWeek = (today.getDay() + 1).toString().padStart(2, '0');
|
||||
const year = today.getFullYear().toString();
|
||||
const hour = today.getHours().toString().padStart(2, '0');
|
||||
const hour12 = (parseInt(hour) + 24) % '12' || '12';
|
||||
const minute = today.getMinutes().toString().padStart(2, '0');
|
||||
const second = today.getSeconds().toString().padStart(2, '0');
|
||||
const ampm = parseInt(hour) >= 12 ? 'PM' : 'AM';
|
||||
|
||||
// Replace based on the format.
|
||||
format = format.replace('M', month);
|
||||
format = format.replace('d', day);
|
||||
format = format.replace('e', dayOfWeek);
|
||||
format = format.replace('y', year);
|
||||
format = format.replace('H', hour);
|
||||
format = format.replace('h', hour12);
|
||||
format = format.replace('m', minute);
|
||||
format = format.replace('s', second);
|
||||
format = format.replace('a', ampm);
|
||||
|
||||
// Show it in the element.
|
||||
clock.innerHTML = format;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sidenav Controller
|
||||
* There should only side navigation element at the moment.
|
||||
*/
|
||||
function sidenavController() {
|
||||
// Get the side navigation button (there should be only one, but if not, we are getting the first one).
|
||||
const sideNavButton = document.querySelector('.tui-sidenav-button');
|
||||
|
||||
if (!sideNavButton) {
|
||||
// No side navigation button found, return early and save a couple CPU cycles.
|
||||
return;
|
||||
}
|
||||
|
||||
// Add the click event listener to the buttons.
|
||||
sideNavButton.addEventListener('click', () => {
|
||||
// Get the side navigation element (there should be only one, but if not, we are getting the first one).
|
||||
const sideNav = document.querySelector('.tui-sidenav');
|
||||
|
||||
if (sideNav) {
|
||||
if (sideNav.classList.contains('active')) {
|
||||
sideNav.classList.remove('active');
|
||||
} else {
|
||||
sideNav.classList.add('active');
|
||||
}
|
||||
} else {
|
||||
throw 'No sidenav element found.'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Modal controller
|
||||
*/
|
||||
function modalController() {
|
||||
// Get the overlap (overlay) element (there should be only one, but if not, we are getting the first one).
|
||||
const tuiOverlap = document.querySelector('.tui-overlap');
|
||||
|
||||
if (!tuiOverlap) {
|
||||
// No overlap found element, return early and save a couple CPU cycles.
|
||||
return;
|
||||
}
|
||||
|
||||
// Find modal buttons.
|
||||
const modalButtons = document.getElementsByClassName('tui-modal-button');
|
||||
for (const modalButton of modalButtons) {
|
||||
// Add the click event listener to the buttons.
|
||||
modalButton.addEventListener('click', (e) => {
|
||||
// Show the overlap.
|
||||
tuiOverlap.classList.add('active');
|
||||
|
||||
// Get the display element for the modal.
|
||||
const modalId = e.target.getAttribute('data-modal');
|
||||
|
||||
if (modalId) {
|
||||
const modal = document.getElementById(modalId);
|
||||
|
||||
if (modal) {
|
||||
// Show it.
|
||||
modal.classList.add('active');
|
||||
} else {
|
||||
throw 'No modal element with id of "' + modalId + '" found.';
|
||||
}
|
||||
} else {
|
||||
throw 'Modal close button data-modal attribute is empty or not set.'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Find the close modal buttons.
|
||||
const modalCloseButtons = document.getElementsByClassName('tui-modal-close-button');
|
||||
|
||||
if (modalButtons.length > 0 && !modalCloseButtons.length) {
|
||||
// A modal without a close button, is a bad modal.
|
||||
throw 'No modal close buttons found.'
|
||||
}
|
||||
|
||||
for (const modalCloseButton of modalCloseButtons) {
|
||||
// Add the click event listener to the buttons.
|
||||
modalCloseButton.addEventListener('click', (e) => {
|
||||
// Hide the the overlap.
|
||||
tuiOverlap.classList.remove('active');
|
||||
|
||||
// Get the display element id for the modal.
|
||||
const modalId = e.target.getAttribute('data-modal');
|
||||
|
||||
if (modalId) {
|
||||
// Get the modal element.
|
||||
const modal = document.getElementById(modalId);
|
||||
|
||||
if (modal) {
|
||||
// Hide it.
|
||||
modal.classList.remove('active');
|
||||
} else {
|
||||
throw 'No modal element with id of "' + modalId + '" found.';
|
||||
}
|
||||
} else {
|
||||
throw 'Modal close button data-modal attribute is empty or not set.'
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Init: This is at the bottom to make sure it is fired correctly.
|
||||
*/
|
||||
domReady(function () {
|
||||
tabsController();
|
||||
datetimeController();
|
||||
sidenavController();
|
||||
modalController();
|
||||
});
|
||||
1
web/static/lib/tuicss/tuicss.min.css
vendored
Normal file
1
web/static/lib/tuicss/tuicss.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
function domReady(t){document.addEventListener("DOMContentLoaded",t),"interactive"!==document.readyState&&"complete"!==document.readyState||t()}function tabsController(){const t=document.getElementsByClassName("tui-tab");if(!t.length)return;for(const e of t)e.addEventListener("click",function(e){if(e.target.classList.contains("disabled"))return;for(const e of t)e.classList.remove("active");const o=document.getElementsByClassName("tui-tab-content");if(!o)throw"No tab content elements found.";for(const t of o)t.style.display="none";const n=e.target.getAttribute("data-tab-content");if(n){const t=document.getElementById(n);if(!t)throw'No tab content element with id "'+n+'" found.';t.style.display="block"}e.target.classList.add("active")});const e=document.querySelector(".tui-tab.active");e?e.click():t[0].click()}function datetimeController(){const t=document.getElementsByClassName("tui-datetime");function e(){for(const e of t){if(null===e)continue;let t=e.getAttribute("data-format");const o=new Date,n=(o.getMonth()+1).toString().padStart(2,"0"),a=o.getDate().toString().padStart(2,"0"),c=(o.getDay()+1).toString().padStart(2,"0"),s=o.getFullYear().toString(),i=o.getHours().toString().padStart(2,"0"),l=(parseInt(i)+24)%"12"||"12",r=o.getMinutes().toString().padStart(2,"0"),d=o.getSeconds().toString().padStart(2,"0"),u=parseInt(i)>=12?"PM":"AM";t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("M",n)).replace("d",a)).replace("e",c)).replace("y",s)).replace("H",i)).replace("h",l)).replace("m",r)).replace("s",d)).replace("a",u),e.innerHTML=t}}t.length&&(e(),setTimeout(()=>{setInterval(e,1e3)},1e3-(new Date).getMilliseconds()))}function sidenavController(){const t=document.querySelector(".tui-sidenav-button");t&&t.addEventListener("click",()=>{const t=document.querySelector(".tui-sidenav");if(!t)throw"No sidenav element found.";t.classList.contains("active")?t.classList.remove("active"):t.classList.add("active")})}function modalController(){const t=document.querySelector(".tui-overlap");if(!t)return;const e=document.getElementsByClassName("tui-modal-button");for(const o of e)o.addEventListener("click",e=>{t.classList.add("active");const o=e.target.getAttribute("data-modal");if(!o)throw"Modal close button data-modal attribute is empty or not set.";{const t=document.getElementById(o);if(!t)throw'No modal element with id of "'+o+'" found.';t.classList.add("active")}});const o=document.getElementsByClassName("tui-modal-close-button");if(e.length>0&&!o.length)throw"No modal close buttons found.";for(const e of o)e.addEventListener("click",e=>{t.classList.remove("active");const o=e.target.getAttribute("data-modal");if(!o)throw"Modal close button data-modal attribute is empty or not set.";{const t=document.getElementById(o);if(!t)throw'No modal element with id of "'+o+'" found.';t.classList.remove("active")}})}domReady(function(){tabsController(),datetimeController(),sidenavController(),modalController()});
|
||||
28
web/templates/admin.html
Normal file
@@ -0,0 +1,28 @@
|
||||
{{template "layout" .}}
|
||||
|
||||
{{define "title"}}Admin Panel · Estus Shots{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<fieldset class="tui-fieldset" style="padding: 2rem;">
|
||||
<legend>Admin Panel</legend>
|
||||
<p class="tui-text-white">
|
||||
This is an example admin page with a different menu bar that includes admin-specific options.
|
||||
</p>
|
||||
|
||||
<section style="margin-top: 1.5rem;">
|
||||
<h2 class="tui-text-yellow">System Status</h2>
|
||||
<div class="tui-panel">
|
||||
<p><strong>Server:</strong> Running</p>
|
||||
<p><strong>Users:</strong> 42 active</p>
|
||||
<p><strong>Uptime:</strong> 7 days, 3 hours</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section style="margin-top: 1.5rem;">
|
||||
<h2 class="tui-text-yellow">Quick Actions</h2>
|
||||
<button class="tui-button">View Logs</button>
|
||||
<button class="tui-button">Manage Users</button>
|
||||
<button class="tui-button">Settings</button>
|
||||
</section>
|
||||
</fieldset>
|
||||
{{end}}
|
||||
45
web/templates/index.html
Executable file
@@ -0,0 +1,45 @@
|
||||
{{template "layout" .}}
|
||||
|
||||
{{define "title"}}Estus Shots · Go + HTMX demo{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<fieldset class="tui-fieldset" style="padding: 2rem;">
|
||||
<legend>Estus Shots control panel</legend>
|
||||
<p class="tui-text-white">
|
||||
Estus Shots demonstrates a Go backend compiled into a single binary. The UI
|
||||
uses <strong>TUI.CSS</strong> for a retro feel and <strong>HTMX</strong> for
|
||||
partial page updates without JavaScript glue code.
|
||||
</p>
|
||||
|
||||
<section style="margin-top: 1.5rem;">
|
||||
<h2 class="tui-text-green">Interactive counter</h2>
|
||||
<p class="tui-text-silver">
|
||||
Click the button to trigger an <code>hx-post</code> request. The response
|
||||
replaces only the counter panel.
|
||||
</p>
|
||||
<div
|
||||
id="counter"
|
||||
hx-get="/counter"
|
||||
hx-trigger="load"
|
||||
hx-swap="outerHTML"
|
||||
>
|
||||
<div class="tui-panel tui-panel-inline">Loading…</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section style="margin-top: 1.5rem;">
|
||||
<h2 class="tui-text-green">Server time</h2>
|
||||
<p class="tui-text-silver">
|
||||
A periodic <code>hx-get</code> refresh keeps this panel in sync with the
|
||||
server clock.
|
||||
</p>
|
||||
<div
|
||||
id="server-time"
|
||||
hx-get="/time"
|
||||
hx-trigger="load, every 5s"
|
||||
>
|
||||
<div class="tui-panel tui-panel-inline">Loading…</div>
|
||||
</div>
|
||||
</section>
|
||||
</fieldset>
|
||||
{{end}}
|
||||
19
web/templates/layout.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{{define "layout"}}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>{{block "title" .}}Estus Shots{{end}}</title>
|
||||
<link rel="stylesheet" href="/static/lib/tuicss/tuicss.min.css" />
|
||||
<script src="/static/lib/htmx.2.0.7.min.js" defer></script>
|
||||
<script src="/static/lib/tuicss/tuicss.min.js" defer></script>
|
||||
</head>
|
||||
<body class="tui-bg-black">
|
||||
{{block "menubar" .}}{{end}}
|
||||
<main class="tui-container tui-window" style="margin-top: 2rem;">
|
||||
{{block "content" .}}{{end}}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
25
web/templates/menubar.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{{define "menubar"}}
|
||||
<nav class="tui-nav">
|
||||
<ul>
|
||||
{{range .MenuGroups}}
|
||||
<li class="tui-dropdown">
|
||||
<span class="red-168-text">{{slice .Label 0 1}}</span>{{slice .Label 1}}
|
||||
<div class="tui-dropdown-content">
|
||||
<ul>
|
||||
{{range .Items}}
|
||||
{{if .IsDivider}}
|
||||
<li class="tui-divider"></li>
|
||||
{{else}}
|
||||
<li><a href="{{.URL}}"><span class="red-168-text">{{slice .Label 0 1}}</span>{{slice .Label 1}}</a></li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
{{if .ShowClock}}
|
||||
<span class="tui-datetime" data-format="h:m:s a"></span>
|
||||
{{end}}
|
||||
</nav>
|
||||
{{end}}
|
||||