Skip to content

Commit

Permalink
Use boilerplate 0.2.0 (#531)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Sep 18, 2022
1 parent cd3b38a commit b0221b3
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 14 deletions.
55 changes: 52 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ axum-server = "0.4.0"
bdk = { version = "0.22.0", features = ["rpc", "keys-bip39", "sqlite"] }
bitcoin = "0.28.1"
bitcoincore-rpc = "0.15.0"
boilerplate = { version = "0.0.2", features = ["axum"] }
boilerplate = { version = "0.2.0", features = ["axum"] }
chrono = "0.4.19"
clap = { version = "3.1.0", features = ["derive"] }
ctrlc = "3.2.1"
derive_more = "0.99.17"
dirs = "4.0.0"
env_logger = "0.9.0"
futures = "0.3.21"
html-escaper = "0.2.0"
http = "0.2.6"
log = "0.4.14"
mime_guess = "2.0.4"
Expand Down
8 changes: 6 additions & 2 deletions src/subcommand/server/templates.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
use {super::*, boilerplate::Display};
use {
super::*,
boilerplate::Boilerplate,
html_escaper::{Escape, Trusted},
};

pub(crate) mod block;
pub(crate) mod clock;
Expand All @@ -8,7 +12,7 @@ pub(crate) mod output;
pub(crate) mod range;
pub(crate) mod transaction;

#[derive(Display)]
#[derive(Boilerplate)]
pub(crate) struct PageHtml {
content: Box<dyn Content>,
}
Expand Down
2 changes: 1 addition & 1 deletion src/subcommand/server/templates/block.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::*;

#[derive(Display)]
#[derive(Boilerplate)]
pub(crate) struct BlockHtml {
hash: BlockHash,
txids: Vec<Txid>,
Expand Down
2 changes: 1 addition & 1 deletion src/subcommand/server/templates/clock.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::*;

#[derive(Display)]
#[derive(Boilerplate)]
pub(crate) struct ClockSvg {
height: Height,
hour: f64,
Expand Down
2 changes: 1 addition & 1 deletion src/subcommand/server/templates/home.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::*;

#[derive(Display)]
#[derive(Boilerplate)]
pub(crate) struct HomeHtml {
last: u64,
blocks: Vec<(Rarity, BlockHash)>,
Expand Down
2 changes: 1 addition & 1 deletion src/subcommand/server/templates/ordinal.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::*;

#[derive(Display)]
#[derive(Boilerplate)]
pub(crate) struct OrdinalHtml {
pub(crate) ordinal: Ordinal,
pub(crate) blocktime: Blocktime,
Expand Down
2 changes: 1 addition & 1 deletion src/subcommand/server/templates/output.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::*;

#[derive(Display)]
#[derive(Boilerplate)]
pub(crate) struct OutputHtml {
pub(crate) outpoint: OutPoint,
pub(crate) list: List,
Expand Down
2 changes: 1 addition & 1 deletion src/subcommand/server/templates/range.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::*;

#[derive(Display)]
#[derive(Boilerplate)]
pub(crate) struct RangeHtml {
pub(crate) start: Ordinal,
pub(crate) end: Ordinal,
Expand Down
2 changes: 1 addition & 1 deletion src/subcommand/server/templates/transaction.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::*;

#[derive(Display)]
#[derive(Boilerplate)]
pub(crate) struct TransactionHtml {
txid: Txid,
outputs: Vec<OutPoint>,
Expand Down
2 changes: 1 addition & 1 deletion templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
<link href=/static/modern-normalize.css rel=stylesheet>
</head>
<body>
$$ self.content
$$ Trusted(&self.content)
</body>
</html>

0 comments on commit b0221b3

Please sign in to comment.