mirror of
https://github.com/kirsle/kirsle.net
synced 2024-12-22 15:09:29 +00:00
Basic download page
This commit is contained in:
parent
c1fb1057d9
commit
27214d96fc
|
@ -8,7 +8,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<ul>
|
<ul>
|
||||||
<li>» <a href="/blog/archive">Blog Archives</a></li>
|
<li>» <a href="/archive">Blog Archives</a></li>
|
||||||
{{ range .Tags }}
|
{{ range .Tags }}
|
||||||
{{ if ge .Count 8 }}
|
{{ if ge .Count 8 }}
|
||||||
<li>» <a href="/tagged/{{ .Name }}">{{ .Name }}</a>
|
<li>» <a href="/tagged/{{ .Name }}">{{ .Name }}</a>
|
||||||
|
|
|
@ -44,7 +44,7 @@ Things that you <strong>SHOULD NOT</strong> use this form for:
|
||||||
For anything else:<p>
|
For anything else:<p>
|
||||||
|
|
||||||
<form name="contact" action="/contact" method="POST">
|
<form name="contact" action="/contact" method="POST">
|
||||||
<input type="hidden" name="token" value="{{ .CSRF }}">
|
<input type="hidden" name="_csrf" value="{{ .CSRF }}">
|
||||||
|
|
||||||
<strong>Your name:</strong><br>
|
<strong>Your name:</strong><br>
|
||||||
<small>(so I know who you are)</small><br>
|
<small>(so I know who you are)</small><br>
|
||||||
|
|
|
@ -1,13 +1,17 @@
|
||||||
|
{{ define "title" }}Download{{ end }}
|
||||||
|
{{ define "content" }}
|
||||||
|
|
||||||
{% block title %}Download Manager{% endblock %}
|
{{ $method := or (.Request.FormValue "method") "index" }}
|
||||||
{% block content %}
|
{{ $project := .Request.FormValue "project" }}
|
||||||
|
{{ $file := .Request.FormValue "file" }}
|
||||||
|
{{ if eq $project "" }}
|
||||||
|
<h1>An error has occurred</h1>
|
||||||
|
{{ else if eq $method "index" }}
|
||||||
|
<h1>Project {{ $project }}</h1>
|
||||||
|
|
||||||
{% if method == "index" %}
|
You are about to download the file <strong>{{ $file }}</strong> from the
|
||||||
<h1>Project {{ project }}</h1>
|
project <strong>{{ $project }}</strong>. <!-- This file has been downloaded
|
||||||
|
0 time(s). -->
|
||||||
You are about to download the file <strong>{{ file }}</strong> from the
|
|
||||||
project <strong>{{ project }}</strong>. This file has been downloaded
|
|
||||||
{{ hits }} time(s).
|
|
||||||
|
|
||||||
<h1>Download</h1>
|
<h1>Download</h1>
|
||||||
|
|
||||||
|
@ -15,30 +19,31 @@
|
||||||
<br><br><br>
|
<br><br><br>
|
||||||
|
|
||||||
<form name="download" action="/download" method="POST">
|
<form name="download" action="/download" method="POST">
|
||||||
<input type="hidden" name="token" value="{{ csrf_token() }}">
|
<input type="hidden" name="_csrf" value="{{ .CSRF }}">
|
||||||
<input type="hidden" name="method" value="get">
|
<input type="hidden" name="method" value="get">
|
||||||
<input type="hidden" name="project" value="{{ project }}">
|
<input type="hidden" name="project" value="{{ $project }}">
|
||||||
<input type="hidden" name="file" value="{{ file }}">
|
<input type="hidden" name="file" value="{{ $file }}">
|
||||||
|
|
||||||
<span style="background-color: #88AADD; padding: 15px; border-top: 2px solid #006699;
|
<span style="background-color: #88AADD; padding: 15px; border-top: 2px solid #006699;
|
||||||
border-left: 2px solid #006699; border-right: 2px solid #AACCFF; border-bottom: 2px solid #AACCFF">
|
border-left: 2px solid #006699; border-right: 2px solid #AACCFF; border-bottom: 2px solid #AACCFF">
|
||||||
<button type="submit">Download Now</button>
|
<button type="submit">Download Now</button>
|
||||||
</span>
|
</span>
|
||||||
</form>
|
</form>
|
||||||
{% elif method == "get" %}
|
{{ else if eq $method "get" }}
|
||||||
<h1>Downloading File...</h1>
|
<h1>Downloading File...</h1>
|
||||||
|
|
||||||
Your download of <strong>{{ file }}</strong> will begin shortly. If it doesn't,
|
Your download of <strong>{{ $file }}</strong> will begin shortly. If it doesn't,
|
||||||
<a href="/projects/{{ project }}/{{ file }}">download it directly</a>.
|
<a href="/projects/{{ $project }}/{{ $file }}">download it directly</a>.
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% endblock %}
|
<script type="text/javascript">
|
||||||
{% block scripts %}
|
(function() {
|
||||||
{% if method == "get" %}
|
setTimeout(function() {
|
||||||
<script>
|
window.location.href = "/projects/{{ $project }}/{{ $file }}";
|
||||||
$(document).ready(function() {
|
}, 2000);
|
||||||
window.location.href = "/projects/{{ project }}/{{ file }}";
|
})();
|
||||||
});
|
</script>
|
||||||
</script>
|
{{ else }}
|
||||||
{% endif %}
|
<h1>An error has occurred.</h1>
|
||||||
{% endblock %}
|
{{ end}}
|
||||||
|
|
||||||
|
{{ end }}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user