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;
}
.card > .spacer2 {
text-align: left;
width: 80vw;
max-width: 700px;
margin-left: auto;
margin-right: auto;
}
.attribution {
position: fixed;
z-index: -1;

View File

@ -1,5 +1,11 @@
{{#> 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">
<form action="/vks/v1/publish" method="POST" enctype="multipart/form-data">
@ -13,14 +19,28 @@
</form>
</div>
{{#if show_help}}
<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>
<pre><code class="snippet">gpg --export your_address@example.org &gt; mykey.pgp</code></pre>
<p>
You can delete an uploaded key <a href="/manage">here</a>.
</p>
</div>
<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>
{{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>
var body = document.getElementsByTagName("body")[0];
@ -38,4 +58,5 @@
}
}, false);
</script>
</div>
{{/layout}}

View File

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