slight layout updates to /publish

This commit is contained in:
Vincent Breitmoser 2019-04-25 23:21:06 +02:00
parent c0db159a3c
commit b88b4696b8
No known key found for this signature in database
GPG Key ID: 7BD18320DEADFA11
3 changed files with 44 additions and 8 deletions

View File

@ -157,6 +157,14 @@ a.brand {
max-width: 800px; max-width: 800px;
} }
.card > .spacer2 {
text-align: left;
width: 80vw;
max-width: 700px;
margin-left: auto;
margin-right: auto;
}
.attribution { .attribution {
position: fixed; position: fixed;
z-index: -1; z-index: -1;

View File

@ -1,5 +1,11 @@
{{#> layout }} {{#> layout }}
<p>After uploading your key we will send a verification link to each email address we find inside. Clicking that link will make your key searchable by that email address.</p> <div class="spacer2">
<center><h2>Upload</h2></center>
<p>After uploading your key we will send a verification link to each email
address we find inside.
Clicking that link will make your key searchable by that email address.
</p>
<div class="row"> <div class="row">
<form action="/vks/v1/publish" method="POST" enctype="multipart/form-data"> <form action="/vks/v1/publish" method="POST" enctype="multipart/form-data">
@ -13,14 +19,28 @@
</form> </form>
</div> </div>
{{#if show_help}}
<div class="row"> <div class="row">
<p>If you're using GnuPG you can use the following snippet to export your public key. This will create a file called mykey.pgp that you can upload here.</p> <p>
<pre><code class="snippet">gpg --export your_address@example.org &gt; mykey.pgp</code></pre> You can delete an uploaded key <a href="/manage">here</a>.
</p>
</div> </div>
<div class="row"> <div class="row">
<p>You can delete an uploaded key <a href="/manage">here</a>.</p> <p>If you're using GnuPG you can use the following snippet to export your
public key.<br />
This will create a file called mykey.pgp that you can upload here.
</p>
<center><pre><code class="snippet">gpg --export your_address@example.org &gt; mykey.pgp</code></pre></center>
</div> </div>
{{else}}
<div class="row">
<p>
You can delete an uploaded key <a href="/manage">here</a>.
Need help <a href="/publish?guide=true">exporting your key to a file</a>?
</p>
</div>
{{/if}}
<script> <script>
var body = document.getElementsByTagName("body")[0]; var body = document.getElementsByTagName("body")[0];
@ -38,4 +58,5 @@
} }
}, false); }, false);
</script> </script>
</div>
{{/layout}} {{/layout}}

View File

@ -17,6 +17,13 @@ use std::io::Read;
const UPLOAD_LIMIT: u64 = 1024 * 1024; // 1 MiB. const UPLOAD_LIMIT: u64 = 1024 * 1024; // 1 MiB.
mod template { mod template {
#[derive(Serialize)]
pub struct Publish {
pub commit: String,
pub version: String,
pub show_help: bool,
}
#[derive(Serialize)] #[derive(Serialize)]
pub struct VerificationSent { pub struct VerificationSent {
pub emails: Vec<String>, pub emails: Vec<String>,
@ -25,12 +32,12 @@ mod template {
} }
} }
#[get("/publish")] #[get("/publish?<guide>")]
pub fn publish() -> MyResponse { pub fn publish(guide: bool) -> MyResponse {
let context = super::templates::General { let context = template::Publish {
error: None,
version: env!("VERGEN_SEMVER").to_string(), version: env!("VERGEN_SEMVER").to_string(),
commit: env!("VERGEN_SHA_SHORT").to_string(), commit: env!("VERGEN_SHA_SHORT").to_string(),
show_help: guide,
}; };
MyResponse::ok("publish", context) MyResponse::ok("publish", context)