From 1b71ec337951ee1acde91eaaf1e0610f4ff89edb Mon Sep 17 00:00:00 2001 From: yaqubroli Date: Fri, 23 Dec 2022 14:28:06 -0800 Subject: [PATCH] Finished code. It's a spaghetti ball now. --- .gitignore | 2 ++ html/404.html | 18 ++++++++++++++++++ html/paste.html | 16 +++++++++++++--- html/url.html | 16 +++++++++++++--- src/templating.rs | 1 + html/static/style.css | 15 +++++++++++++++ target/debug/url_shortener | 0 7 files changed, 57 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 09b9ce2..38c9419 100644 --- a/.gitignore +++ a/.gitignore @@ -1,3 +1,5 @@ target/ .vscode/ +.vscode +target config.tomldiff --git a/html/404.html b/html/404.html new file mode 100644 index 0000000..9de2294 100644 --- /dev/null +++ a/html/404.html @@ -1,0 +1,18 @@ + + + + +7800.io: URL Shortener + + +

URL Shortener

+
+
+

Your entry was not found.

+
+ {domain}/{shortened} +
+
+
+ +diff --git a/html/paste.html b/html/paste.html index df023f9..2b7943a 100644 --- a/html/paste.html +++ a/html/paste.html @@ -1,12 +1,18 @@ - Paste - - + +7800.io: Pastebin -

Paste

-

Your paste is accessible at {{domain}}/{{shortened}}

+

URL Shortener

+
+
+

Text pasted successfully

+
+ {domain}/{shortened} +
+
+
diff --git a/html/url.html b/html/url.html index 8e26b47..d96933e 100644 --- a/html/url.html +++ a/html/url.html @@ -1,12 +1,18 @@ - URL shortened - - + +7800.io: URL Shortener -

URL shortened successfully

-

Your url is accessible at {domain}/{shortened}

+

URL Shortener

+
+
+

URL shortened successfully

+
+ {domain}/{shortened} +
+
+
diff --git a/src/templating.rs b/src/templating.rs index 96610bd..1eb9988 100644 --- a/src/templating.rs +++ a/src/templating.rs @@ -73,6 +73,7 @@ } pub async fn get_necessary_value(key: String, key_value: u8, app_data: web::Data, schema: &mut TemplateSchema) -> String { + println!("Evaluating {}:{}", key, key_value); // create a vector of (ContentType, i64) tuples match key.as_str() { "content" => diff --git a/html/static/style.css b/html/static/style.css index 5665cf2..d40f32b 100644 --- a/html/static/style.css +++ a/html/static/style.css @@ -70,7 +70,6 @@ border-radius: 1em; } -/* make .text, which is an input text field, use the same font as the rest of the website. make it a black box with a thick white outline */ .text { display: block; font-family: monospace; @@ -79,6 +78,7 @@ border: 2px dashed white; padding: 0.5em 1em; margin: 1em 0; + width: 100%; } /* make .button a black button with thick white outline that uses the same font as the rest of the website */ @@ -98,4 +98,17 @@ textarea { width: 20em; height: 10em; +} + +.url { + font-family: monospace !important; + color: white !important; + display: block; + /* make normal case */ + text-transform: none !important; + margin-bottom: 1em; +} + +.domain { + color: lightgray !important; }diff --git a/target/debug/url_shortener b/target/debug/url_shortener index 93b43235902d088f703d90c27b6673e0f2da9704..c1c9c587c16583c26f4bb0fcb8d5b4e4df78b5f8 100755 Binary files a/target/debug/url_shortener and a/target/debug/url_shortener differ -- rgit 0.1.5