summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-08-29 09:04:45 +0200
committerGitHub <noreply@github.com>2022-08-29 15:04:45 +0800
commit41c76ad71404bc0b4da83df063e6e10cd4a41e9f (patch)
tree0b281964d48b2f8b8e16368d9095fb1540b3e092 /templates
parent8a66b01e55d1988a814fed9f839f5e34c2e69d60 (diff)
downloadgitea-41c76ad71404bc0b4da83df063e6e10cd4a41e9f.tar.gz
gitea-41c76ad71404bc0b4da83df063e6e10cd4a41e9f.zip
Add support for Vagrant packages (#20930)
* Add support for Vagrant boxes. * Add authentication. * Add tests. * Add integration tests. * Add docs. * Add icons. * Update routers/api/packages/api.go Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'templates')
-rw-r--r--templates/admin/packages/list.tmpl1
-rw-r--r--templates/package/content/vagrant.tmpl18
-rw-r--r--templates/package/metadata/vagrant.tmpl5
-rw-r--r--templates/package/shared/list.tmpl1
-rw-r--r--templates/package/view.tmpl2
-rw-r--r--templates/swagger/v1_json.tmpl3
6 files changed, 29 insertions, 1 deletions
diff --git a/templates/admin/packages/list.tmpl b/templates/admin/packages/list.tmpl
index 61721532a4..06d6163476 100644
--- a/templates/admin/packages/list.tmpl
+++ b/templates/admin/packages/list.tmpl
@@ -24,6 +24,7 @@
<option value="pub" {{if eq .PackageType "pub"}}selected="selected"{{end}}>Pub</option>
<option value="pypi" {{if eq .PackageType "pypi"}}selected="selected"{{end}}>PyPi</option>
<option value="rubygems" {{if eq .PackageType "rubygems"}}selected="selected"{{end}}>RubyGems</option>
+ <option value="vagrant" {{if eq .PackageType "vagrant"}}selected="selected"{{end}}>Vagrant</option>
</select>
<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
</div>
diff --git a/templates/package/content/vagrant.tmpl b/templates/package/content/vagrant.tmpl
new file mode 100644
index 0000000000..7bd686e6ab
--- /dev/null
+++ b/templates/package/content/vagrant.tmpl
@@ -0,0 +1,18 @@
+{{if eq .PackageDescriptor.Package.Type "vagrant"}}
+ <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+ <div class="ui attached segment">
+ <div class="ui form">
+ <div class="field">
+ <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.vagrant.install"}}</label>
+ <div class="markup"><pre class="code-block"><code>vagrant box add --box-version {{.PackageDescriptor.Version.Version}} "{{AppUrl}}api/packages/{{.PackageDescriptor.Owner.Name}}/vagrant/{{.PackageDescriptor.Package.Name}}"</code></pre></div>
+ </div>
+ <div class="field">
+ <label>{{.locale.Tr "packages.vagrant.documentation" | Safe}}</label>
+ </div>
+ </div>
+ </div>
+ {{if .PackageDescriptor.Metadata.Description}}
+ <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4>
+ <div class="ui attached segment">{{.PackageDescriptor.Metadata.Description}}</div>
+ {{end}}
+{{end}}
diff --git a/templates/package/metadata/vagrant.tmpl b/templates/package/metadata/vagrant.tmpl
new file mode 100644
index 0000000000..344e417b77
--- /dev/null
+++ b/templates/package/metadata/vagrant.tmpl
@@ -0,0 +1,5 @@
+{{if eq .PackageDescriptor.Package.Type "vagrant"}}
+ {{if .PackageDescriptor.Metadata.Author}}<div class="item" title="{{.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}}
+ {{if .PackageDescriptor.Metadata.ProjectURL}}<div class="item">{{svg "octicon-link-external" 16 "mr-3"}} <a href="{{.PackageDescriptor.Metadata.ProjectURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}}
+ {{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.conan.details.repository"}}</a></div>{{end}}
+{{end}}
diff --git a/templates/package/shared/list.tmpl b/templates/package/shared/list.tmpl
index 020acba9d7..b48f772f39 100644
--- a/templates/package/shared/list.tmpl
+++ b/templates/package/shared/list.tmpl
@@ -17,6 +17,7 @@
<option value="pub" {{if eq .PackageType "pub"}}selected="selected"{{end}}>Pub</option>
<option value="pypi" {{if eq .PackageType "pypi"}}selected="selected"{{end}}>PyPi</option>
<option value="rubygems" {{if eq .PackageType "rubygems"}}selected="selected"{{end}}>RubyGems</option>
+ <option value="vagrant" {{if eq .PackageType "vagrant"}}selected="selected"{{end}}>Vagrant</option>
</select>
<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
</div>
diff --git a/templates/package/view.tmpl b/templates/package/view.tmpl
index 254d1ff840..a5b2a2ef68 100644
--- a/templates/package/view.tmpl
+++ b/templates/package/view.tmpl
@@ -30,6 +30,7 @@
{{template "package/content/pub" .}}
{{template "package/content/pypi" .}}
{{template "package/content/rubygems" .}}
+ {{template "package/content/vagrant" .}}
</div>
<div class="four wide column">
<div class="ui segment metas">
@@ -52,6 +53,7 @@
{{template "package/metadata/pub" .}}
{{template "package/metadata/pypi" .}}
{{template "package/metadata/rubygems" .}}
+ {{template "package/metadata/vagrant" .}}
<div class="item">{{svg "octicon-database" 16 "mr-3"}} {{FileSize .PackageDescriptor.CalculateBlobSize}}</div>
</div>
{{if not (eq .PackageDescriptor.Package.Type "container")}}
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index 8a8ca9a924..5dcb4787e0 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -1962,7 +1962,8 @@
"nuget",
"pub",
"pypi",
- "rubygems"
+ "rubygems",
+ "vagrant"
],
"type": "string",
"description": "package type filter",