relation_list.html.tpl 735 B

1234567891011121314151617181920212223
  1. {{define "relation_list"}}
  2. <h2 class="karmen-relation-header">{{$title := .options.title}}{{if .title}}{{$title = .title}}{{end}}{{$title}}</h2>
  3. {{if gt (len .data) 0}}
  4. <div class="list-group" id="{{$title|toLower}}_list_group">
  5. {{range $el := .data}}
  6. <a href="{{$el.ID | show $.options.model}}" class="list-group-item list-group-item-action">
  7. <span class="{{$.options.icon}}"></span>
  8. {{$el | string}}
  9. {{if $.small}}
  10. {{range $s := $.small}}
  11. <div class="text-right">
  12. {{$options := `noElements: "nessun elemento"`}}
  13. {{template "small" dict "options" ($options | yaml) "data" ($el|field $s)}}
  14. </div>
  15. {{end}}
  16. {{end}}
  17. {{end}}
  18. </a>
  19. </div>
  20. {{else}}
  21. <p>{{.noElements}}</p>
  22. {{end}}
  23. {{end}}