minor tweaks

This commit is contained in:
Joe Ardent 2023-12-30 12:18:08 -08:00
parent 521bbe9fa4
commit c30cf86986
8 changed files with 32 additions and 29 deletions

1
assets/htmx.min.js vendored Normal file

File diff suppressed because one or more lines are too long

2
julid

@ -1 +1 @@
Subproject commit 34f85a95a0c289a87de9b97610677ffae136dc68 Subproject commit f2ade6d85eddfbcaa54f106564deb6252bfc81df

View file

@ -54,15 +54,12 @@ pub async fn app(db_pool: sqlx::SqlitePool) -> IntoMakeService<axum::Router> {
.layer(axum_login::AuthManagerLayerBuilder::new(store, sessions).build()) .layer(axum_login::AuthManagerLayerBuilder::new(store, sessions).build())
}; };
let css_dir = std::env::current_dir() let assets_dir = std::env::current_dir().unwrap().join("assets");
.unwrap() let assets_svc = ServeDir::new(assets_dir.as_path());
.join("templates")
.join("css");
let css_svc = ServeDir::new(css_dir.as_path());
axum::Router::new() axum::Router::new()
.route("/", get(handle_slash).post(handle_slash)) .route("/", get(handle_slash).post(handle_slash))
.nest_service("/css", css_svc) .nest_service("/assets", assets_svc)
.route("/signup", get(get_create_user).post(post_create_user)) .route("/signup", get(get_create_user).post(post_create_user))
.route("/signup_success/:id", get(get_signup_success)) .route("/signup_success/:id", get(get_signup_success))
.route("/login", get(get_login).post(post_login)) .route("/login", get(get_login).post(post_login))

View file

@ -92,7 +92,9 @@ impl Watch {
//-************************************************************************ //-************************************************************************
/// Something a user wants to watch /// Something a user wants to watch
//-************************************************************************ //-************************************************************************
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(
Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, sqlx::FromRow,
)]
pub struct WatchQuest { pub struct WatchQuest {
pub user: Julid, pub user: Julid,
pub watch: Julid, pub watch: Julid,

View file

@ -5,7 +5,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}{{ title }} - What 2 Watch{% endblock %}</title> <title>{% block title %}{{ title }} - What 2 Watch{% endblock %}</title>
<link rel="stylesheet" href="/css/ww.css"> <link rel="stylesheet" href="/assets/ww.css">
{% block head %}{% endblock %} {% block head %}{% endblock %}
@ -22,6 +22,8 @@
<div id="footer"> <div id="footer">
{% block footer %}{% endblock %} {% block footer %}{% endblock %}
</div> </div>
<script src="/assets/htmx.min.js"></script>
</body> </body>
</html> </html>

View file

@ -7,19 +7,19 @@
<h1>Welcome to What 2 Watch</h1> <h1>Welcome to What 2 Watch</h1>
{% match user %} {% match user %}
{% when Some with (usr) %} {% when Some with (usr) %}
<p> <p>
Hello, {{ usr.username }}! It's nice to see you. <a href="watches">Let's get watchin'!</a> Hello, {{ usr.username }}! It's nice to see you. <a href="watches">Let's get watchin'!</a>
</p> </p>
</br> </br>
<p> <p>
<form action="/logout" enctype="application/x-www-form-urlencoded" method="post"> <form action="/logout" enctype="application/x-www-form-urlencoded" method="post">
<input type="submit" value="sign out?"> <input type="submit" value="sign out?">
</form> </form>
</p> </p>
{% else %} {% when None %}
<p> <p>
Heya, why don't you <a href="/login">log in</a> or <a href="/signup">sign up</a>? Heya, why don't you <a href="/login">log in</a> or <a href="/signup">sign up</a>?
</p> </p>
{% endmatch %} {% endmatch %}

View file

@ -12,7 +12,8 @@
<div class="watchlist"> <div class="watchlist">
<ul> <ul>
{% for watch in watches %} {% for watch in watches %}
<li><span class="watchtitle">{{watch.title}}</span> -- {% call m::get_or_default(watch.year(), "when??") -%}: {{watch.kind}} </li> <li><span class="watchtitle">{{watch.title}}</span> -- {% call m::get_or_default(watch.year(), "when??") -%}:
{{watch.kind}} </li>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
@ -25,23 +26,23 @@
</div> </div>
<h2>Fussy Search</h2> <h2>Fussy Search</h2>
<div class="fullsearch"> <div class="fullsearch">
<label for="title">Title</label> <label for="title">Title</label>
<input type="text" name="title" id="title"></br> <input type="text" name="title" id="title"></br>
<label for="year">Release Year</label> <label for="year">Release Year</label>
<input type="text" name="year" id="year"></br> <input type="text" name="year" id="year"></br>
<label for="kind">Type</label> <label for="kind">Type</label>
<select id="kind" name="kind"> <select id="kind" name="kind">
<option value="">Unknown</option> <option value="">Unknown</option>
<option value="0">Movie</option> <option value="0">Movie</option>
<option value="1">Series</option> <option value="1">Series</option>
<option value="2">Limited Series</option> <option value="2">Limited Series</option>
<option value="3">Short</option> <option value="3">Short</option>
<option value="4">Other</option> <option value="4">Other</option>
</select> </select>
<input type="submit" value="Let's go!"> <input type="submit" value="Let's go!">
</form> </form>