Compare commits
No commits in common. "1fd7009e251a17e9d12edb1c1ef0a75e3c4d3241" and "75092f3e0e5d1af9b089526d4fedf227da70275c" have entirely different histories.
1fd7009e25
...
75092f3e0e
5 changed files with 1 additions and 67 deletions
|
@ -1,25 +0,0 @@
|
|||
use maud::{html, Markup};
|
||||
|
||||
use crate::templates::layout;
|
||||
|
||||
pub fn changelog_page() -> Markup {
|
||||
layout(html! {
|
||||
h1 { "Beacon Changelog" }
|
||||
|
||||
section {
|
||||
h2 { "1.1.0, 07.02.2025" }
|
||||
ul {
|
||||
li { "Fish now directly display their non-relative dates for their next or current window" }
|
||||
li { "Additionally, fish that are up now display the starting time for the subsequent window" }
|
||||
li { "The site now saves your account ID in your browser storage, and automatically redirects you on page visit" }
|
||||
}
|
||||
}
|
||||
|
||||
section {
|
||||
h2 { "1.0.0, 06.02.2025" }
|
||||
ul {
|
||||
li { "Initial release" }
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
12
src/main.rs
12
src/main.rs
|
@ -12,11 +12,9 @@ use maud::{html, Markup};
|
|||
use nanoid::nanoid;
|
||||
use serde::Deserialize;
|
||||
use sqlx::{postgres::PgPoolOptions, Pool, Postgres};
|
||||
use templates::layout;
|
||||
use tower_http::{services::ServeDir, trace::TraceLayer};
|
||||
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
||||
|
||||
pub mod changelog;
|
||||
pub mod clock;
|
||||
pub mod data;
|
||||
pub mod db;
|
||||
|
@ -148,16 +146,6 @@ async fn main() {
|
|||
.route("/to", get(to_handler))
|
||||
.route("/{id}", get(main_handler))
|
||||
.route("/{acc_id}/catch/{fish_id}", post(insert_cf_handler))
|
||||
.route("/changelog", get(|| async { changelog::changelog_page() }))
|
||||
.route(
|
||||
"/logout",
|
||||
get(|| async {
|
||||
layout(html! {
|
||||
h1 { "Logging you out, please wait to be redirected..." }
|
||||
script src="/static/scripts/logout.js" type="text/javascript" {}
|
||||
})
|
||||
}),
|
||||
)
|
||||
.layer(TraceLayer::new_for_http())
|
||||
.nest_service("/static", ServeDir::new("static"))
|
||||
.with_state(Arc::new(AppState {
|
||||
|
|
|
@ -156,15 +156,9 @@ pub fn main_page(
|
|||
};
|
||||
|
||||
let template = html! {
|
||||
span style="display: none;" id="account-id" { (acc_id) }
|
||||
.header {
|
||||
div {}
|
||||
.side {
|
||||
.menu {
|
||||
span { "Beacon " (env!("CARGO_PKG_VERSION")) }
|
||||
a href="/changelog" { "Changelog" }
|
||||
a href="/logout" { "Log out" }
|
||||
}
|
||||
details {
|
||||
summary { "Filters" }
|
||||
form {
|
||||
|
@ -208,8 +202,6 @@ pub fn main_page(
|
|||
div id="list" hx-get="" hx-trigger="every 10s" hx-swap="innerHTML" hx-target="this" hx-on="changeDates" {
|
||||
(list)
|
||||
}
|
||||
|
||||
script src="/static/scripts/save.js" type="text/javascript" {}
|
||||
};
|
||||
|
||||
if only_list {
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
// Removes the local storage entry, and redirects to the index page.
|
||||
const ls = window.localStorage;
|
||||
if (ls.getItem("beacon:account-id")) {
|
||||
console.log("a");
|
||||
ls.removeItem("beacon:account-id");
|
||||
window.location.pathname = "/";
|
||||
} else {
|
||||
window.location.pathname = "/";
|
||||
}
|
|
@ -3,8 +3,7 @@ body {
|
|||
margin: 40px;
|
||||
}
|
||||
|
||||
section.up,
|
||||
section.always-up {
|
||||
section {
|
||||
margin-bottom: 5px;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr;
|
||||
|
@ -18,12 +17,6 @@ section.always-up {
|
|||
align-items: center;
|
||||
}
|
||||
|
||||
.side {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: end;
|
||||
}
|
||||
|
||||
select {
|
||||
width: 100%;
|
||||
}
|
||||
|
@ -152,8 +145,3 @@ h2.clock {
|
|||
summary:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.menu {
|
||||
display: flex;
|
||||
gap: 5px;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue