Header sizes consistent
This commit is contained in:
parent
f1d38b8cf1
commit
0eaddcbdac
14
src/main.rs
14
src/main.rs
@ -319,7 +319,7 @@ fn handle_connection(
|
|||||||
let mut mld_path = path.clone();
|
let mut mld_path = path.clone();
|
||||||
let mut data_path = path.clone();
|
let mut data_path = path.clone();
|
||||||
|
|
||||||
let (pki_path, audio_path, start_level, relative_path) = if relative_path.is_empty() {
|
let (pki_path, audio_path, relative_path) = if relative_path.is_empty() {
|
||||||
if access == Access::Full {
|
if access == Access::Full {
|
||||||
pk_path.push("index.pk");
|
pk_path.push("index.pk");
|
||||||
data_path.push("index.dat");
|
data_path.push("index.dat");
|
||||||
@ -328,7 +328,7 @@ fn handle_connection(
|
|||||||
data_path.push("partial.dat");
|
data_path.push("partial.dat");
|
||||||
}
|
}
|
||||||
|
|
||||||
(None, None, 0, String::new())
|
(None, None, String::new())
|
||||||
} else {
|
} else {
|
||||||
let mut pki_path = path.clone();
|
let mut pki_path = path.clone();
|
||||||
let mut audio_path = path.clone();
|
let mut audio_path = path.clone();
|
||||||
@ -359,7 +359,7 @@ fn handle_connection(
|
|||||||
audio_path.push(format!("{path}.mp3"));
|
audio_path.push(format!("{path}.mp3"));
|
||||||
data_path.push(format!("{path}.dat"));
|
data_path.push(format!("{path}.dat"));
|
||||||
|
|
||||||
(Some(pki_path), Some(audio_path), 1, path.to_string())
|
(Some(pki_path), Some(audio_path), path.to_string())
|
||||||
};
|
};
|
||||||
|
|
||||||
let file_paths = DocumentPaths {
|
let file_paths = DocumentPaths {
|
||||||
@ -421,7 +421,6 @@ fn handle_connection(
|
|||||||
&relative_path,
|
&relative_path,
|
||||||
&path,
|
&path,
|
||||||
file_paths,
|
file_paths,
|
||||||
start_level,
|
|
||||||
cookie,
|
cookie,
|
||||||
access != Access::Full,
|
access != Access::Full,
|
||||||
)
|
)
|
||||||
@ -483,7 +482,6 @@ fn handle_relative_connection(
|
|||||||
relative_path: &str,
|
relative_path: &str,
|
||||||
path: &Path,
|
path: &Path,
|
||||||
file_paths: DocumentPaths,
|
file_paths: DocumentPaths,
|
||||||
start_level: usize,
|
|
||||||
cookie: Option<&str>,
|
cookie: Option<&str>,
|
||||||
censored: bool,
|
censored: bool,
|
||||||
) {
|
) {
|
||||||
@ -808,7 +806,7 @@ fn handle_relative_connection(
|
|||||||
&mut stream,
|
&mut stream,
|
||||||
Settings::default()
|
Settings::default()
|
||||||
.with_handler(entry_handler(path, relative_path, censored))
|
.with_handler(entry_handler(path, relative_path, censored))
|
||||||
.with_start_level(start_level)
|
.with_start_level(1)
|
||||||
.with_use_textboxes(true),
|
.with_use_textboxes(true),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -834,7 +832,7 @@ fn handle_relative_connection(
|
|||||||
unreachable!();
|
unreachable!();
|
||||||
};
|
};
|
||||||
|
|
||||||
let _ = writeln!(stream, "<h1>Description</h1>");
|
let _ = writeln!(stream, "<h2>Description</h2>");
|
||||||
|
|
||||||
if let Some(audio_path) = &file_paths.audio {
|
if let Some(audio_path) = &file_paths.audio {
|
||||||
if Path::is_file(audio_path) {
|
if Path::is_file(audio_path) {
|
||||||
@ -850,7 +848,7 @@ fn handle_relative_connection(
|
|||||||
}
|
}
|
||||||
TabInfo::Comment(comments) => {
|
TabInfo::Comment(comments) => {
|
||||||
let html = html! {
|
let html = html! {
|
||||||
h1 { "Comments" }
|
h2 { "Comments" }
|
||||||
form method="POST" {
|
form method="POST" {
|
||||||
input type="text" name="name" value="anon" placeholder="Name";
|
input type="text" name="name" value="anon" placeholder="Name";
|
||||||
br;
|
br;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user