Skip to content
Snippets Groups Projects
datatable.html 1.22 KiB
Newer Older
alexisben's avatar
alexisben committed
{{- $context := .context -}}
{{- $position := .block.position -}}
{{- $title := .block.title -}}
{{- $title := .block.title -}}
{{- with .block.data -}}
Arnaud Levy's avatar
Arnaud Levy committed
  <section class="block block-datatable{{ if $title }} block-with-title{{ end }}" id="block-{{ $position }}">
alexisben's avatar
alexisben committed
    <div class="container">
      <div class="block-content">
        {{- if $title }}
          <div class="top">
alexisben's avatar
alexisben committed
            {{ partial "blocks/title" (dict 
              "title" $title
              "context" $context
              ) }}
alexisben's avatar
alexisben committed
          </div>
        {{ end -}}
        <div class="table-responsive">
alexisben's avatar
alexisben committed
          <table>
alexisben's avatar
alexisben committed
            {{- if .caption }}
              <caption>{{ partial "PrepareHTML" .caption }}</caption>
            {{ end -}}
            <thead>
              <tr>
                {{ range .columns }}
                  <th scope="col">{{ . }}</th>
                {{ end }}
              </tr>
            </thead>

            <tbody>
              {{ range .rows }}
                <tr>
                  {{ range . }}
Arnaud Levy's avatar
Arnaud Levy committed
                    <td>{{ .  | markdownify }}</td>
alexisben's avatar
alexisben committed
                  {{ end }}
                </tr>
              {{ end }}
            </tbody>
          </table>
        </div>
      </div>
    </div>
  </section>
{{- end -}}