{{define "content"}}
<div class="panel">
  <div class="panel-head"><h2>Gelen Mesajlar ({{len .Messages}})</h2></div>
  {{if .Messages}}
  <div class="msg-list">
    {{range .Messages}}
    <div class="msg {{if not .Read}}msg-unread{{end}}">
      <div class="msg-head">
        <strong>{{.Name}}</strong>
        <span class="muted">{{dt .CreatedAt}}</span>
      </div>
      <div class="msg-meta">
        {{if .Phone}}<a href="{{tel .Phone}}"><svg class="ico ico-xs"><use href="/static/icons.svg#i-phone"/></svg>{{.Phone}}</a>{{end}}
        {{if .Email}}<a href="mailto:{{.Email}}"><svg class="ico ico-xs"><use href="/static/icons.svg#i-mail"/></svg>{{.Email}}</a>{{end}}
      </div>
      <p>{{.Body}}</p>
      <div class="msg-actions">
        {{if not .Read}}
        <form method="post" action="/admin/mesaj/{{.ID}}/okundu"><button class="btn btn-sm btn-dark" type="submit">Okundu İşaretle</button></form>
        {{end}}
        <form method="post" action="/admin/mesaj/{{.ID}}/sil" onsubmit="return confirm('Mesaj silinsin mi?')"><button class="btn btn-sm btn-danger" type="submit">Sil</button></form>
      </div>
    </div>
    {{end}}
  </div>
  {{else}}
  <p class="muted">Henüz mesaj yok. İletişim formundan gelen mesajlar burada görünecek.</p>
  {{end}}
</div>
{{end}}
