<%#
  # @file
  # templates for the upper right autocomplete results
  #%>

<div class="templates">

<div class="topicTemplate">
<div class="result{{rtype}}">
  <div class="topicMetacode">
    <img src="{{typeImageURL}}" class="topicIcon" />
    <span class="metacodeTip">{{type}}</span>
  </div>
  <div class="resultText">
    <p class="resultTitle">{{label}}</p>
    <p class="resultDesc">{{description}}</p>
  </div>
  <div class="autoOptions">
    
    <% if controller_name == 'maps' && action_name == 'show' && authenticated? && @map.authorize_to_edit(@current) %>
    <button class="addToMap hoverForTip" onclick="return keepFromCommons(event, {{id}})">
      <span class="tip">add to map</span>
    </button>
    <% end %>
    <a href="/topics/{{id}}" target="_blank" class="goTo hoverForTip">
      <span class="tip">open in new tab</span>
    </a>
    <div class="mapCount hoverForTip">
      <span class="tip">appears on this # of maps</span>
      {{mapCount}}
    </div>
    <div class="synapseCount hoverForTip">
      <span class="tip"> has this # of synapses</span>
      {{synapseCount}}
    </div>
    <div class="topicOriginatorIcon hoverForTip">
      <span class="tip topicOriginator">created by {{originator}}</span>
    </div>
    <div class="topicPermission {{permission}} hoverForTip">
      <span class="tip">topic is {{permission}}</span>
    </div>
  </div>
  <div class="clearfloat"></div>
</div>
</div>

<div class="mapTemplate">
<div class="result{{rtype}}">
  <img class="icon" src="/assets/map.png">
  <div class="resultText">
    <p class="resultTitle">{{label}}</p>
    <p class="resultDesc">{{description}}</p>
  </div>
  <div class="autoOptions">
    <a href="/maps/{{id}}" target="_blank" class="goTo hoverForTip">
      <span class="tip">open in new tab</span>
    </a>
    <div class="topicCount hoverForTip">
      <span class="tip">has this # of topics</span>
      {{topicCount}}
    </div>
    <div class="synapseCount hoverForTip">
      <span class="tip">has this # of synapses</span>
      {{synapseCount}}
    </div>
    <div class="mapContributorsIcon hoverForTip">
      <span class="tip mapContributors">{{contributorList}}</span>
      {{contributorCount}}
    </div>
    <div class="mapPermission {{permission}} hoverForTip">
      <span class="tip">map is {{permission}}</span>
    </div>
  </div>
  <div class="clearfloat"></div>
</div>
</div>

<div class="mapperTemplate">
<div class="result{{rtype}}">
  <img class="icon" width="28" height="28" src="/assets/MMCCicon_mapper.png">
  <div class="resultText">
    <p class="resultTitle">{{label}}</p>
  </div>
  <div class="autoOptions">
    <a href="/maps/mappers/{{id}}" target="_blank" class="goTo hoverForTip">
      <span class="tip">open in new tab</span>
    </a>
    <div class="mapCount hoverForTip">
      <span class="tip">created this # of maps</span>
      {{mapCount}}
    </div>
  </div>
  <div class="clearfloat"></div>
</div>
</div>

<div class="synapseTemplate">
  <div class="result{{rtype}}">
  <p class="autocompleteSection synapseDesc">{{label}}</p>
  <div class="autocompleteSection synapsePermission {{permission}}"></div>
  <div class="autocompleteSection synapseOriginatorIcon hoverForTip">
    <span class="tip synapseOriginator">{{originator}}</span>
  </div>
  <div class="clearfloat"></div>
  </div>
</div>

</div>