chore: include head html component in all pages

Moves common <head>..</head> tags into componenents/head.html and
includes it from all pages.

Common elements include: css files, favicon, meta tag(s)
This commit is contained in:
danda 2024-05-15 13:13:44 -07:00
parent faf303bbdd
commit 48966fa69d
5 changed files with 24 additions and 30 deletions

View File

@ -0,0 +1,4 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="/css/styles.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/css/pico.min.css" media="screen" />
<link rel="icon" type="image/png" sizes="48x48" href="/image/neptune-favicon.png">

View File

@ -3,9 +3,7 @@
<head> <head>
<title>Neptune Block Explorer: Block Height {{self.block_info.height}}</title> <title>Neptune Block Explorer: Block Height {{self.block_info.height}}</title>
<meta name="viewport" content="width=device-width, initial-scale=1"> {{html_escaper::Trusted(include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/templates/web/html/components/head.html")))}}
<link rel="stylesheet" type="text/css" href="/css/pico.min.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/css/styles.css" media="screen" />
</head> </head>
<body> <body>

View File

@ -2,9 +2,7 @@
<head> <head>
<title>Neptune Block Explorer: Not Found</title> <title>Neptune Block Explorer: Not Found</title>
<meta name="viewport" content="width=device-width, initial-scale=1"> {{html_escaper::Trusted(include_str!( concat!(env!("CARGO_MANIFEST_DIR"), "/templates/web/html/components/head.html")))}}
<link rel="stylesheet" type="text/css" href="/css/pico.min.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/css/styles.css" media="screen" />
</head> </head>
<body> <body>

View File

@ -1,27 +1,23 @@
<html> <html>
<head> <head>
<title>Neptune Block Explorer: (network: {{self.state.network}})</title> <title>Neptune Block Explorer: (network: {{self.state.network}})</title>
<link rel="stylesheet" type="text/css" href="/css/styles.css" media="screen" /> {{ html_escaper::Trusted(include_str!( concat!(env!("CARGO_MANIFEST_DIR"), "/templates/web/html/components/head.html"))) }}
<link rel="stylesheet" type="text/css" href="/css/pico.min.css" media="screen" /> <script>
<link rel="icon" type="image/png" sizes="48x48" href="/image/neptune-favicon.png"> function handle_submit(form) {
let value = form.height_or_digest.value;
<script> var is_digest = value.length == 80;
function handle_submit(form) { var type = is_digest ? "digest" : "height";
let value = form.height_or_digest.value; var uri = form.action + "/" + type + "/" + value;
var is_digest = value.length == 80; window.location.href = uri;
var type = is_digest ? "digest" : "height"; return false;
var uri = form.action + "/" + type + "/" + value; }
window.location.href = uri; function handle_utxo_submit(form) {
return false; let value = form.utxo.value;
} var uri = form.action + "/" + value;
function handle_utxo_submit(form) { window.location.href = uri;
let value = form.utxo.value; return false;
var uri = form.action + "/" + value; }
window.location.href = uri; </script>
return false;
}
</script>
</head> </head>
<body> <body>
<header class="container"> <header class="container">

View File

@ -2,9 +2,7 @@
<head> <head>
<title>Neptune Block Explorer: Utxo {{self.index}}</title> <title>Neptune Block Explorer: Utxo {{self.index}}</title>
<meta name="viewport" content="width=device-width, initial-scale=1"> {{html_escaper::Trusted(include_str!( concat!(env!("CARGO_MANIFEST_DIR"), "/templates/web/html/components/head.html")))}}
<link rel="stylesheet" type="text/css" href="/css/pico.min.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/css/styles.css" media="screen" />
</head> </head>
<body> <body>