11< h2 > Download DbGate Premium</ h2 >
22< p >
3- For professional usage, we recommend DbGate Premium. It includes all features and support.
3+ For professional usage, we recommend DbGate Premium. It includes all features and support.
44</ p >
55< p >
6- A < strong > 30-day free trial period</ strong > is available.
6+ A < strong > 30-day free trial period</ strong > is available.
77</ p >
88
9- < a class ="button is-medium is-primary " href ="https://dbgate.io/download " data-goatcounter-click ="button-download-premium " data-goatcounter-title ="Button: Download from dbgate.io ">
9+ < a class ="button is-medium is-primary " href ="https://dbgate.io/download "
10+ data-goatcounter-click ="button-download-premium " data-goatcounter-title ="Button: Download from dbgate.io ">
1011 < i class ="fas fa-external-link-alt mr-2 "> </ i >
1112 Download from dbgate.io
1213</ a >
@@ -15,13 +16,15 @@ <h2>Download DbGate Premium</h2>
1516< h2 > Download DbGate Community</ h2 >
1617< p > DbGate Community is < strong > free</ strong > and open-source</ p >
1718< p >
18- Download the most recent stable version of DbGate. < br />
19- Older releases or BETA versions could be found on < a href ='https://github.com/dbgate/dbgate/releases ' target ="_blank "> github releases</ a > page
20- </ p >
21-
19+ Download the most recent stable version of DbGate. < br />
20+ Older releases or BETA versions could be found on < a href ='https://github.com/dbgate/dbgate/releases '
21+ target ="_blank "> github releases</ a > page
22+ </ p >
23+
2224{{ $items := index .Site.Data.download }}
2325
2426{{ range $items }}
27+ {{ $osname := .text }}
2528< div class ="columns mb-6 ">
2629 < div class ="column is-3 ">
2730 < button class ="button is-medium is-static mr-5 is-fullwidth ">
@@ -32,8 +35,12 @@ <h2>Download DbGate Community</h2>
3235 < div class ="column ">
3336 < div class ="columns is-multiline ">
3437 {{ range .items }}
38+
3539 < div class ="column is-4 ">
36- < a class ="button is-medium is-primary is-fullwidth " href ="{{ .link }} " onClick ="sendDownloadEventToGoatCounter('{{ .event }}') ">
40+ < a class ="button is-medium is-primary is-fullwidth " {{ if .isLink }} href ="{{ .link }} "
41+ onClick ="sendDownloadEventToGoatCounter('{{ .event }}') " {{ else }}
42+ onClick ="openDownloadModal('{{ .link }}', '{{ .event }}', '{{ .icon }}', '{{ $osname }}', '{{ .text }}', '{{ .platform }}') "
43+ {{ end }} >
3744 < i class ="{{ .icon }} mr-2 "> </ i >
3845 {{ .text }}
3946 {{ if .platform }}
@@ -49,3 +56,114 @@ <h2>Download DbGate Community</h2>
4956 </ div >
5057</ div >
5158{{ end }}
59+
60+
61+
62+ < div id ="download-modal " class ="modal ">
63+ < div class ="modal-background "> </ div >
64+
65+ < div class ="modal-content ">
66+ < div class ="box ">
67+ < h2 > Please provide your e-mail address</ h2 >
68+
69+ < div class ="field ">
70+ < label class ="label "> Email</ label >
71+ < div class ="control has-icons-left has-icons-right ">
72+ < input class ="input " type ="email " placeholder ="Your e-mail " oninput ="emailChanged() "
73+ id ="email-input " />
74+ < span class ="icon is-small is-left ">
75+ < i class ="fas fa-envelope "> </ i >
76+ </ span >
77+ <!-- <span class="icon is-small is-right">
78+ <i class="fas fa-exclamation-triangle"></i>
79+ </span> -->
80+ </ div >
81+ <!-- <p class="help is-danger">This email is invalid</p> -->
82+ </ div >
83+
84+
85+ < div class ="field ">
86+ < label class ="label "> Job title - optional</ label >
87+ < div class ="control ">
88+ < div class ="select ">
89+ < select id ="job-title-select ">
90+ < option value =""> (Choose)</ option >
91+ < option value ="developer "> Developer</ option >
92+ < option value ="analyst "> Analyst</ option >
93+ < option value ="data-scientist "> Data Scientist</ option >
94+ < option value ="tester "> Tester</ option >
95+ < option value ="project-manager "> Project/Product Manager</ option >
96+ < option value ="database-administrator "> Database Administrator</ option >
97+ < option value ="other "> Other</ option >
98+ </ select >
99+ </ div >
100+ </ div >
101+ </ div >
102+
103+ < div class ='is-flex is-flex-direction-row is-justify-content-space-between is-align-items-end '>
104+ < a class ="button is-medium is-primary is-static " id ="download-button ">
105+ Download
106+ </ a >
107+
108+ < p >
109+ < a id ="download-no-email "> Continue without e-mail</ a >
110+ </ p >
111+ </ div >
112+ </ div >
113+ </ div >
114+
115+ < button class ="modal-close is-large " aria-label ="close "> </ button >
116+ </ div >
117+
118+ < script lang ="text/javascript ">
119+ function openDownloadModal ( link , event , icon , osname , title , platform ) {
120+ const doDownload = ( ) => {
121+ sendDownloadEventToGoatCounter ( event ) ;
122+ const modal = document . getElementById ( 'download-modal' ) ;
123+ modal . classList . remove ( 'is-active' ) ;
124+ const data = {
125+ email : document . getElementById ( 'email-input' ) . value ,
126+ osname : osname ,
127+ bundle : title ,
128+ platform,
129+ link,
130+ job_title : document . getElementById ( 'job-title-select' ) . value ,
131+ event,
132+ }
133+
134+ fetch (
135+ 'https://api.dbgate.io/download/community' ,
136+ {
137+ method : 'POST' ,
138+ headers : {
139+ 'Content-Type' : 'application/json' ,
140+ } ,
141+ body : JSON . stringify ( data ) ,
142+ }
143+ ) ;
144+
145+ }
146+ const modal = document . getElementById ( 'download-modal' ) ;
147+ modal . classList . add ( 'is-active' ) ;
148+ const button = document . getElementById ( 'download-button' ) ;
149+ button . href = link ;
150+ button . onclick = doDownload ;
151+ button . innerHTML = `<i class="${ icon } mr-2"></i> Download DbGate for ${ osname } - ${ title } ` ;
152+ if ( platform ) {
153+ button . innerHTML += ` (${ platform } )` ;
154+ }
155+ const linkButton = document . getElementById ( 'download-no-email' ) ;
156+ linkButton . href = link ;
157+ linkButton . onclick = doDownload ;
158+ }
159+
160+ function emailChanged ( ) {
161+ const input = document . getElementById ( 'email-input' ) ;
162+ const button = document . getElementById ( 'download-button' ) ;
163+ if ( input . value && input . value . includes ( '@' ) ) {
164+ button . classList . remove ( 'is-static' ) ;
165+ } else {
166+ button . classList . add ( 'is-static' ) ;
167+ }
168+ }
169+ </ script >
0 commit comments