summaryrefslogtreecommitdiff
path: root/templates/profile.hbs
blob: a1c6ed19a87d75f09d1f3d9df86ca84822b3ba88 (plain)
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
{{#*inline "extra_head"}}
<style>
table {
  grid-template-columns:  repeat({{document.num_columns}}, auto);
}
.details {
  grid-column: 1 / -1;
}
</style>
<script>
function toggleDetails(e) {
   var d = e.querySelector(".details");
   var toggled = d.classList.contains("details-visible");
   if (toggled) {
     d.classList.remove("details-visible");
   } else {
     d.classList.add("details-visible");
   }
}
</script>
{{/inline}}
{{#*inline "page"}}
{{#if user~}}
    <p>Profile for {{ user }}</p>
{{/if~}}
{{#with document ~}}
<table>
    <thead>
        {{#with headings ~}}
        {{#each columns ~}}
            <th>{{ this }}</th>
        {{/each ~}}
        {{/with ~}}
    </thead>
    <tbody>
        {{#each rows ~}}
            <tr onclick="toggleDetails(this)">
            {{#each columns ~}}
                <td>{{ this }}</td>
            {{/each ~}}
            <td class="details">
                <div>
                Hello
                </div>
            </td>
            </tr>
        {{/each ~}}
    </tbody>
</table>
{{/with~}}
{{/inline~}}
{{~> (parent)~}}