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())
};
let css_dir = std::env::current_dir()
.unwrap()
.join("templates")
.join("css");
let css_svc = ServeDir::new(css_dir.as_path());
let assets_dir = std::env::current_dir().unwrap().join("assets");
let assets_svc = ServeDir::new(assets_dir.as_path());
axum::Router::new()
.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_success/:id", get(get_signup_success))
.route("/login", get(get_login).post(post_login))

View File

@ -92,7 +92,9 @@ impl 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 user: Julid,
pub watch: Julid,

View File

@ -5,7 +5,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<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 %}
@ -22,6 +22,8 @@
<div id="footer">
{% block footer %}{% endblock %}
</div>
<script src="/assets/htmx.min.js"></script>
</body>
</html>

View File

@ -7,19 +7,19 @@
<h1>Welcome to What 2 Watch</h1>
{% match user %}
{% when Some with (usr) %}
{% when Some with (usr) %}
<p>
Hello, {{ usr.username }}! It's nice to see you. <a href="watches">Let's get watchin'!</a>
</p>
</br>
<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?">
</form>
</form>
</p>
{% else %}
{% when None %}
<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>
{% endmatch %}

View File

@ -12,7 +12,8 @@
<div class="watchlist">
<ul>
{% 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 %}
</ul>
</div>
@ -25,23 +26,23 @@
</div>
<h2>Fussy Search</h2>
<div class="fullsearch">
<label for="title">Title</label>
<input type="text" name="title" id="title"></br>
<label for="title">Title</label>
<input type="text" name="title" id="title"></br>
<label for="year">Release Year</label>
<input type="text" name="year" id="year"></br>
<label for="year">Release Year</label>
<input type="text" name="year" id="year"></br>
<label for="kind">Type</label>
<select id="kind" name="kind">
<option value="">Unknown</option>
<option value="0">Movie</option>
<option value="1">Series</option>
<option value="2">Limited Series</option>
<option value="3">Short</option>
<option value="4">Other</option>
</select>
<label for="kind">Type</label>
<select id="kind" name="kind">
<option value="">Unknown</option>
<option value="0">Movie</option>
<option value="1">Series</option>
<option value="2">Limited Series</option>
<option value="3">Short</option>
<option value="4">Other</option>
</select>
<input type="submit" value="Let's go!">
<input type="submit" value="Let's go!">
</form>