add TOS
This commit is contained in:
parent
57c08871be
commit
ff7324d089
|
@ -61,6 +61,13 @@ pub struct LicensePage {
|
||||||
pub env: Env
|
pub env: Env
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Template)]
|
||||||
|
#[template( path = "tos.html" )]
|
||||||
|
#[allow(dead_code)]
|
||||||
|
pub struct TOSPage {
|
||||||
|
pub env: Env
|
||||||
|
}
|
||||||
|
|
||||||
pub async fn uploaded(query: HashMap<String, String>, state: SharedState) -> Result<Html<String>, Rejection> {
|
pub async fn uploaded(query: HashMap<String, String>, state: SharedState) -> Result<Html<String>, Rejection> {
|
||||||
|
|
||||||
if ! query.contains_key("file") {
|
if ! query.contains_key("file") {
|
||||||
|
@ -138,10 +145,25 @@ pub fn license_f(state: SharedState) -> impl Filter<Extract = impl Reply, Error
|
||||||
.and_then(license)
|
.and_then(license)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn tos(state: SharedState) -> Result<Html<String>, Rejection> {
|
||||||
|
let rendered = TOSPage {
|
||||||
|
env: state.env
|
||||||
|
};
|
||||||
|
Ok(warp::reply::html(rendered.render().map_err(|err| warp::reject::custom(HttpReject::AskamaError(err)))?))
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn tos_f(state: SharedState) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone {
|
||||||
|
warp::path!("tos")
|
||||||
|
.and(warp::path::end())
|
||||||
|
.map(move || state.clone())
|
||||||
|
.and_then(tos)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn get_routes(state: SharedState) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone {
|
pub fn get_routes(state: SharedState) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone {
|
||||||
index_f(state.clone())
|
index_f(state.clone())
|
||||||
.or(uploaded_f(state.clone()))
|
.or(uploaded_f(state.clone()))
|
||||||
.or(passworded_f(state.clone()))
|
.or(passworded_f(state.clone()))
|
||||||
.or(authors_f(state.clone()))
|
.or(authors_f(state.clone()))
|
||||||
.or(license_f(state))
|
.or(license_f(state.clone()))
|
||||||
|
.or(tos_f(state))
|
||||||
}
|
}
|
|
@ -67,6 +67,18 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<p>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="tos_consent">
|
||||||
|
I agree to the
|
||||||
|
<a href="/tos">
|
||||||
|
Terms and Conditions
|
||||||
|
</a>
|
||||||
|
<span style='font-size:70%;color:red;transform:translateY(-30%);display:inline-block'>
|
||||||
|
(required)
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<input type="file" name="file" id="bfile-formupload-file" style="display: none" />
|
<input type="file" name="file" id="bfile-formupload-file" style="display: none" />
|
||||||
<label for="bfile-formupload-file">
|
<label for="bfile-formupload-file">
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
|
||||||
|
<div style="max-width:95vw;width:fit-content;margin:0 auto">
|
||||||
|
<h1 style="text-align:center">Terms and conditions</h1>
|
||||||
|
<ol style="list-style:decimal;padding-left:18px">
|
||||||
|
<li>
|
||||||
|
By uploading any file to this website, as a user, you state that the files
|
||||||
|
you upload are completely legal and take full responsibility for their
|
||||||
|
distribution via blek! File.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
Uploading a file with password gives no guarantee that the password will be
|
||||||
|
stored securely, or that the file will be encrypted or protected at all.
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endblock %}
|
Loading…
Reference in New Issue