add a WIP index page
This commit is contained in:
parent
33f0b6a5e9
commit
79e88cb2f4
5 changed files with 73 additions and 35 deletions
64
LICENSE
64
LICENSE
|
@ -2,14 +2,14 @@ Creative Commons Legal Code
|
||||||
|
|
||||||
CC0 1.0 Universal
|
CC0 1.0 Universal
|
||||||
|
|
||||||
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
||||||
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
||||||
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
||||||
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
||||||
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
||||||
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
||||||
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
||||||
HEREUNDER.
|
HEREUNDER.
|
||||||
|
|
||||||
Statement of Purpose
|
Statement of Purpose
|
||||||
|
|
||||||
|
@ -43,22 +43,22 @@ Related Rights"). Copyright and Related Rights include, but are not
|
||||||
limited to, the following:
|
limited to, the following:
|
||||||
|
|
||||||
i. the right to reproduce, adapt, distribute, perform, display,
|
i. the right to reproduce, adapt, distribute, perform, display,
|
||||||
communicate, and translate a Work;
|
communicate, and translate a Work;
|
||||||
ii. moral rights retained by the original author(s) and/or performer(s);
|
ii. moral rights retained by the original author(s) and/or performer(s);
|
||||||
iii. publicity and privacy rights pertaining to a person's image or
|
iii. publicity and privacy rights pertaining to a person's image or
|
||||||
likeness depicted in a Work;
|
likeness depicted in a Work;
|
||||||
iv. rights protecting against unfair competition in regards to a Work,
|
iv. rights protecting against unfair competition in regards to a Work,
|
||||||
subject to the limitations in paragraph 4(a), below;
|
subject to the limitations in paragraph 4(a), below;
|
||||||
v. rights protecting the extraction, dissemination, use and reuse of data
|
v. rights protecting the extraction, dissemination, use and reuse of data
|
||||||
in a Work;
|
in a Work;
|
||||||
vi. database rights (such as those arising under Directive 96/9/EC of the
|
vi. database rights (such as those arising under Directive 96/9/EC of the
|
||||||
European Parliament and of the Council of 11 March 1996 on the legal
|
European Parliament and of the Council of 11 March 1996 on the legal
|
||||||
protection of databases, and under any national implementation
|
protection of databases, and under any national implementation
|
||||||
thereof, including any amended or successor version of such
|
thereof, including any amended or successor version of such
|
||||||
directive); and
|
directive); and
|
||||||
vii. other similar, equivalent or corresponding rights throughout the
|
vii. other similar, equivalent or corresponding rights throughout the
|
||||||
world based on applicable law or treaty, and any national
|
world based on applicable law or treaty, and any national
|
||||||
implementations thereof.
|
implementations thereof.
|
||||||
|
|
||||||
2. Waiver. To the greatest extent permitted by, but not in contravention
|
2. Waiver. To the greatest extent permitted by, but not in contravention
|
||||||
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
||||||
|
@ -102,20 +102,20 @@ express Statement of Purpose.
|
||||||
4. Limitations and Disclaimers.
|
4. Limitations and Disclaimers.
|
||||||
|
|
||||||
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
||||||
surrendered, licensed or otherwise affected by this document.
|
surrendered, licensed or otherwise affected by this document.
|
||||||
b. Affirmer offers the Work as-is and makes no representations or
|
b. Affirmer offers the Work as-is and makes no representations or
|
||||||
warranties of any kind concerning the Work, express, implied,
|
warranties of any kind concerning the Work, express, implied,
|
||||||
statutory or otherwise, including without limitation warranties of
|
statutory or otherwise, including without limitation warranties of
|
||||||
title, merchantability, fitness for a particular purpose, non
|
title, merchantability, fitness for a particular purpose, non
|
||||||
infringement, or the absence of latent or other defects, accuracy, or
|
infringement, or the absence of latent or other defects, accuracy, or
|
||||||
the present or absence of errors, whether or not discoverable, all to
|
the present or absence of errors, whether or not discoverable, all to
|
||||||
the greatest extent permissible under applicable law.
|
the greatest extent permissible under applicable law.
|
||||||
c. Affirmer disclaims responsibility for clearing rights of other persons
|
c. Affirmer disclaims responsibility for clearing rights of other persons
|
||||||
that may apply to the Work or any use thereof, including without
|
that may apply to the Work or any use thereof, including without
|
||||||
limitation any person's Copyright and Related Rights in the Work.
|
limitation any person's Copyright and Related Rights in the Work.
|
||||||
Further, Affirmer disclaims responsibility for obtaining any necessary
|
Further, Affirmer disclaims responsibility for obtaining any necessary
|
||||||
consents, permissions or other rights required for any use of the
|
consents, permissions or other rights required for any use of the
|
||||||
Work.
|
Work.
|
||||||
d. Affirmer understands and acknowledges that Creative Commons is not a
|
d. Affirmer understands and acknowledges that Creative Commons is not a
|
||||||
party to this document and has no duty or obligation with respect to
|
party to this document and has no duty or obligation with respect to
|
||||||
this CC0 or use of the Work.
|
this CC0 or use of the Work.
|
||||||
|
|
|
@ -23,6 +23,11 @@ body {
|
||||||
color: var(--text-color)
|
color: var(--text-color)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: var(--link-color);
|
||||||
|
font-size: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ use std::borrow::Cow;
|
||||||
use askama_rocket::Template;
|
use askama_rocket::Template;
|
||||||
use rocket::http::Status;
|
use rocket::http::Status;
|
||||||
use rust_embed::RustEmbed;
|
use rust_embed::RustEmbed;
|
||||||
|
use shared::names::Site;
|
||||||
|
|
||||||
#[derive(RustEmbed)]
|
#[derive(RustEmbed)]
|
||||||
#[folder = "public/"]
|
#[folder = "public/"]
|
||||||
|
@ -23,6 +24,12 @@ pub struct ErrorTemplate<'a> {
|
||||||
pub error_description: &'a str
|
pub error_description: &'a str
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Template)]
|
||||||
|
#[template(path = "index.html")]
|
||||||
|
pub struct IndexTemplate {
|
||||||
|
pub sites: Vec<Site>
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Responder)]
|
#[derive(Responder)]
|
||||||
pub struct ErrorTemplateResponder<'a> {
|
pub struct ErrorTemplateResponder<'a> {
|
||||||
template: ErrorTemplate<'a>
|
template: ErrorTemplate<'a>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
assets::ErrorTemplate,
|
assets::{ErrorTemplate, IndexTemplate},
|
||||||
links::{next_url, previous_url},
|
links::{next_url, previous_url},
|
||||||
sites::get_global_names,
|
sites::get_global_names,
|
||||||
};
|
};
|
||||||
|
@ -23,8 +23,8 @@ pub struct JsonResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("/")]
|
#[get("/")]
|
||||||
pub fn index() -> &'static str {
|
pub async fn index() -> IndexTemplate {
|
||||||
"Like, this is a webring, meow!"
|
IndexTemplate { sites: get_global_names().await }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("/previous?<source_url>")]
|
#[get("/previous?<source_url>")]
|
||||||
|
|
26
templates/index.html
Normal file
26
templates/index.html
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width">
|
||||||
|
<title>Meowy Webring</title>
|
||||||
|
<link rel="stylesheet" href="/public/style.css" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<main>
|
||||||
|
<h1>Welcome</h1>
|
||||||
|
<h2>Sites</h2>
|
||||||
|
{% for site in sites %}
|
||||||
|
{% match site.name %}
|
||||||
|
{% when Some with (value) %}
|
||||||
|
<p><a href="{{ site.url }}">{{ value }}</a></p>
|
||||||
|
{% when None %}
|
||||||
|
<p><a href="{{ site.url }}">{{ site.url }}</a></p>
|
||||||
|
{% endmatch %}
|
||||||
|
{% endfor %}
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
Loading…
Reference in a new issue