<div ng-cloak>
  <dl>
    <dd>
      <strong class="jskomNoWrap">
        <jskom:a text-no="{{ text.text_no }}">{{ text.text_no }}</jskom:a> /
        {{ text | textDate | dateString }} / {{ text | textAuthor }}
      </strong>
      {{ text | textExtraInfo }}
    </dd>

    <dd class="jskomNoWrap" ng-repeat="ct in text.comment_to_list">
      <span class="secondary label">{{ ct.type|capitalize }}</span>
      to <jskom:a text-no="{{ ct.text_no }}">{{ ct.text_no }}</jskom:a>
      by {{ ct.author|personName }}
    </dd>
    
    <dd ng-repeat="r in text.recipient_list">
      <span class="secondary label">{{ r.type|capitalize }}</span>
      
      <a href="/conferences/{{r.recpt.conf_no}}">{{ r.recpt | confName }}</a>
      <span ng-show="r.sent_by">
        <span class="hide-for-small">
          <br/>Sent by: {{ r.sent_by | personName }}
          <br/>Sent at: {{ r.sent_at | dateString }}
        </span>
      </span>
    </dd>
    
    <dd ng-class="hide-for-small" ng-show="text.no_of_marks > 0">
      <span class="secondary label">Marked by</span>
      <span ng-show="currentMark != null">
        you (type: {{ currentMark.type }})
        <span ng-show="text.no_of_marks > 1"> and {{text.no_of_marks - 1}} other persons</span>
      </span>
      <span ng-show="currentMark == null">{{text.no_of_marks}} persons</span>
    </dd>
    
    <dd>
      <span class="label">Subject</span> {{ text.subject }}
      <span ng-show="text | hasKomfeederUrl">
        (<a href="{{ text | komfeederUrl}}"><i class="icon-external-link"></i></a>)
      </span>
    </dd>
  </dl>
  
  <div class="jskomTextBody">
    <article ng-switch="text.jskomBodyType">
      <div ng-switch-default>
        [unknown content-type: &quot;{{ text.content_type }}&quot;]
      </div>
      <div ng-switch-when="image"><img ng-src="{{ text.jskomImageUrl }}" /></div>
      <div ng-switch-when="text">
        <ng-switch on="textMode">
          <div ng-switch-default jskom-bind-body="text.body"></div>
          <div ng-switch-when="text" jskom-bind-body="text.body"></div>
          <pre ng-switch-when="raw" jskom-bind-body="text.body"></pre>
          <div ng-switch-when="html" ng-bind-html="text.body"></div>
        </ng-switch>
      </div>
      <div ng-switch-when="html">
        <ng-switch on="textMode">
          <div ng-switch-default jskom-bind-body="text.body"></div>
          <div ng-switch-when="text" jskom-bind-body="text.body"></div>
          <pre ng-switch-when="raw" jskom-bind-body="text.body"></pre>
          <div><p ng-switch-when="html" ng-bind-html="text.body"></p></div>
        </ng-switch>
      </div>
    </article>
  </div>
  
  <div ng-show="text.jskomFastReplies">
    <span class="secondary label">Remarks</span>
    <dl>
      <dd ng-repeat="ai in text.jskomFastReplies">
        &quot;<span>{{ ai.data }}</span>&quot;
        / <span>{{ ai.creator|personName }}</span>
      </dd>
    </dl>
  </div>
  
  <dl>
    <dd class="jskomNoWrap" ng-repeat="ci in text.comment_in_list">
      <span class="secondary label">{{ ci.type|capitalize }}</span> in
      <jskom:a text-no="{{ ci.text_no }}">{{ ci.text_no }}</jskom:a>
      by {{ ci.author|personName }}
    </dd>
  </dl>
  
  <div class="row">
    <div class="six mobile-two columns">
      <ul class="button-group" data-toggle="buttons-radio"
          ng-show="text.jskomBodyType != 'image'">
        <li>
          <a ng-click="textMode = 'text'" class="small secondary button">
            <i class="icon-align-left"></i>
          </a>
        </li>
        <li>
          <a ng-click="textMode = 'raw'" class="small secondary button">
            <i class="icon-align-justify"></i>
          </a>
        </li>
        <li>
          <a ng-click="textMode = 'html'" class="small secondary button">
            <i class="icon-cloud"></i>
          </a>
        </li>
      </ul>
    </div>
    
    <div class="three mobile-one columns"></div>
    
    <div class="three mobile-one columns">
      <div class="jskomRight">
        <span ng-show="text.text_no|isUnread:membership">
          <span class="secondary label"><i class="icon-unread"></i> Unread</span>
        </span>
        <span class="success label" ng-hide="text.text_no|isUnread:membership">Read</span>
      </div>
      <div style="clear: both;">&nbsp;</div>
    </div>
  </div>
</div>

<div id="jskomBelowText"></div>
