publiccode.si/site/layouts/partials/functions/share_buttons.html

30 lines
1.7 KiB
HTML
Raw Normal View History

<form action="https://fsfe.org/share" method="GET" class="share-buttons {{.type}}" target="_blank" onkeypress="return event.keyCode != 13;">
2017-09-07 22:10:25 +02:00
<input name="popup" id="no-share-popup-{{.type}}" type="radio" />
<input name="ref" value="pmpc-{{.type}}" type="hidden" />
<input name="url" value="{{ .url }}{{ .lang }}" type="hidden" />
2017-09-07 22:10:25 +02:00
<input id="sharetitle-{{.type}}" name="title" value="{{ .defaultSocialText }}" type="hidden" />
<input class="n" name="website" placeholder="Please do not put anything here" />
{{ range .data }}
2020-06-17 11:50:02 +02:00
{{- $sharetext := "" -}}
{{- if isset . "customText" -}}
{{- $sharetext = .customText -}}
{{- else -}}
{{- $sharetext = $.defaultSocialText -}}
{{- end -}}
{{ if eq .userinput true -}}
2017-09-07 22:10:25 +02:00
<label class="button share-{{ .id }}" title="{{ .titleBefore}} {{ .name }} {{ .titleAfter }}" for="{{ .id }}-share-{{$.type}}">{{if eq $.type "side" }}&nbsp;{{else}}{{.name}}{{end}}</label>
<input name="popup" id="{{ .id }}-share-{{$.type}}" type="radio" />
<span class="popup {{ .id }}">
<label for="no-share-popup-{{$.type}}"></label>
<input name="{{ .id }}pod" value="" placeholder="{{ .name }} URL ({{ .id }}.tld)" type="text" />
2020-06-17 11:50:02 +02:00
<button type="submit" name="service" value="{{ .id }}" onclick="return changeTitle_{{$.type | safeJS }}('{{ $sharetext }}')">OK</button>
2017-09-07 22:10:25 +02:00
</span>
2020-06-17 11:50:02 +02:00
{{- end -}}
{{- if ne .userinput true -}}
<button type="submit" name="service" value="{{ .id }}" class="button share-{{ .id }}" title="{{ .titleBefore}} {{ .name }} {{ .titleAfter }}" onclick="return changeTitle_{{$.type | safeJS}}('{{ $sharetext }}')">{{if eq $.type "side" }}&nbsp;{{else}}{{.name}}{{end}}</button>
2020-06-17 11:50:02 +02:00
{{- end }}
2017-09-07 22:10:25 +02:00
{{ end }}
</form>