-
Notifications
You must be signed in to change notification settings - Fork 5
/
template_cols.go
39 lines (35 loc) · 1.13 KB
/
template_cols.go
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
package main
func colsTemplate() string {
t := `
{{$name := index . "name"}}
{{$lower := index . "lower"}}
{{$withS := index . "with_s"}}
{{ "{{" }} define "_{{$lower}}_col1" {{ "}}" }}
{{ "{{" }} $row := index . "row" {{ "}}" }}
{{ "{{" }} $guid := index $row "guid" {{ "}}" }}
<a href="/{{$withS}}/{{ "{{" }}$guid{{ "}}" }}" class="underline">
{{ "{{" }} index $row "name" {{ "}}" }}
</a>
{{ "{{" }} end {{ "}}" }}
{{ "{{" }} define "_{{$lower}}_col2" {{ "}}" }}
{{ "{{" }} $row := index . "row" {{ "}}" }}
{{ "{{" }} index $row "street1" {{ "}}" }}
<br/>
{{ "{{" }} index $row "street2" {{ "}}" }}
{{ "{{" }} end {{ "}}" }}
{{ "{{" }} define "_{{$lower}}_col3" {{ "}}" }}
{{ "{{" }} $row := index . "row" {{ "}}" }}
{{ "{{" }} index $row "city" {{ "}}" }},
{{ "{{" }} index $row "state" {{ "}}" }}
{{ "{{" }} index $row "zip" {{ "}}" }}
{{ "{{" }} index $row "country" {{ "}}" }}
{{ "{{" }} end {{ "}}" }}
{{ "{{" }} define "_{{$lower}}_col4" {{ "}}" }}
{{ "{{" }} $row := index . "row" {{ "}}" }}
{{ "{{" }} index $row "created_at_human" {{ "}}" }}
<br/>
{{ "{{" }} index $row "created_at_ago" {{ "}}" }}
{{ "{{" }} end {{ "}}" }}
`
return t
}