add help page

master
rascul 2 years ago
parent 1e9bf9abff
commit 41d6b1b8de

@ -39,6 +39,7 @@ async fn main() -> std::io::Result<()> {
App::new() App::new()
.app_data(handlebars_ref.clone()) .app_data(handlebars_ref.clone())
.wrap(middleware::Logger::default()) .wrap(middleware::Logger::default())
.service(routes::help::get)
.service(routes::index::get) .service(routes::index::get)
.service(routes::submit::get) .service(routes::submit::get)
.service(routes::submit::post) .service(routes::submit::post)

@ -0,0 +1,11 @@
use actix_web::{get, web, HttpResponse};
use handlebars::Handlebars;
use serde_json::json;
#[get("/help")]
pub async fn get(hb: web::Data<Handlebars<'_>>) -> HttpResponse {
let data = json!({});
let body = hb.render("help", &data).unwrap();
HttpResponse::Ok().body(body)
}

@ -1,2 +1,3 @@
pub mod help;
pub mod index; pub mod index;
pub mod submit; pub mod submit;

@ -0,0 +1,85 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ReWoT</title>
<link rel="stylesheet" href="/static/rewot.css" type="text/css">
<link rel="stylesheet" href="/static/ansi2html.css" type="text/css">
<link rel="stylesheet" href="/static/fontello/css/fontello.css" type="text/css">
</head>
<body>
<div class="top">
<h1><a href="/">ReWoT</a></h1>
<ul>
<li><a href="/latest">latest</a></li>
<li><a href="/submit">submit</a></li>
<li><a href="/help">help</a></li>
</ul>
</div>
<div class="bottom">
<table>
<tr>
<td></td>
<td>
<a href="#" onclick="return speed_up();">
<i class="icon-plus" title="Speed up"></i>
</a>
</td>
<td></td>
</tr>
<tr>
<td>
<a href="#" onclick="return reverse();">
<i class="icon-fast-backward" title="Rewind"></i>
</a>
</td>
<td>
<a href="#" onclick="return play_pause();">
<i id="play_pause" class="icon-play" title="Play"></i>
</a>
</td>
<td>
<a href="#" onclick="return forward();">
<i class="icon-fast-forward" title="Fast forward"></i>
</a>
</td>
</tr>
<tr>
<td></td>
<td>
<a href="#" onclick="return slow_down();">
<i class="icon-minus" title="Slow down"></i>
</a>
</td>
<td>
<small>x</small><span id="speed" title="Speed">1</span>
</td>
</tr>
<tr>
<td>
<span style="font-size: x-large;" title="Line number">#</span><span id="lineno" title="Line number"></span>
</td>
<td colspan=2>
<progress id="progress" max="0" value="0"></progress>
</td>
</tr>
</table>
</div>
<main id="main">
<h2>Help</h2>
<p>ReWoT is a mud log replaying kind of thing.
<p>Clients supported are Mudlet, TinTin++, and ZMud (may also work with CMud, I'm not sure).
</main>
<script src="/static/rewot.js"></script>
</body>
</html>

@ -73,6 +73,11 @@
<h2>Submit a log</h2> <h2>Submit a log</h2>
<form action="/submit" method="post" class="submit_form"> <form action="/submit" method="post" class="submit_form">
Client <select name="client">
<option value="mudlet">Mudlet</option>
<option value="tintin">TinTin++</option>
<option value="zmud">ZMud</option>
</select><br>
Title <input type="text" name="submit_title" size="30"><br> Title <input type="text" name="submit_title" size="30"><br>
Player <input type="text" name="submit_player" size="30"><br> Player <input type="text" name="submit_player" size="30"><br>
Public <input type="checkbox" value="public" name="submit_public"><br> Public <input type="checkbox" value="public" name="submit_public"><br>

Loading…
Cancel
Save