Marketing Site

/views/vsite/Download.html (2.4 KB)

 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{% import (
"{{{ .Package }}}/app"
"{{{ .Package }}}/app/controller/cutil"
"{{{ .Package }}}/app/site/download"
"{{{ .Package }}}/app/util"
"{{{ .Package }}}/views/components"
"{{{ .Package }}}/views/layout"
) %}

{% code type Download struct {
layout.Basic
Links download.Links
} %}

{% func (p *Download) Body(as *app.State, ps *cutil.PageState) %}
<div class="card">
<h3>{%= components.SVGRefIcon("download", ps) %} Download {%s util.AppName %} {%s as.BuildInfo.Version %}</h3>
</div>
{%= downloadShowLinks("server", "database", "Server Version", "A command line interface that can launch a web server or run commands", p.Links, as.BuildInfo.Version, ps) %}
{%= downloadShowLinks("desktop", "desktop", "Desktop Version", "Standalone application using your platform's native web viewer", p.Links, as.BuildInfo.Version, ps) %}
{%= downloadShowLinks("mobile", "mobile", "Mobile Version", "Libraries and apps for Mobile Platforms", p.Links, as.BuildInfo.Version, ps) %}
{% endfunc %}

{% func downloadShowLinks(mode string, icon string, title string, desc string, links download.Links, v string, ps *cutil.PageState) %}
{%- code modeLinks := links.GetByModes(mode) -%}
{%- if len(modeLinks) > 0 -%}
<div class="card">
<h3>{%= components.SVGRefIcon(icon, ps) %}{%s title %}</h3>
<em>{%s desc %}</em>
<div class="overflow full-width">
<table class="mt">
<tbody>
{%- code var currentOS string -%}
{%- for _, link := range modeLinks -%}
{%- if currentOS != link.OS -%}
{%- if currentOS != "" -%}
</td>
</tr>
{%- endif -%}
{%- code currentOS = link.OS -%}
<tr>
<td style="width: 25%;">{%= components.SVGRef(link.OSIcon(), 20, 20, "icon", ps) %}{%s link.OSString() %}</td>
<td>
{%- endif -%}
{%- if link.OS == download.OSLinux && (link.Arch == download.ArchPPC64 || link.Arch == download.ArchMIPS64Hard || link.Arch == download.ArchMIPSHard) -%}
<div class="mt"></div>
{%- endif -%}
<a href="{{{ .Info.Sourcecode }}}/releases/download/v{%s v %}/{%s link.URL %}"><button>{%s link.ArchString() %}</button></a>
{%- endfor -%}
</td>
</tr>
</tbody>
</table>
</div>
</div>
{%- endif -%}
{% endfunc %}