{#
 # Saku Gateway Index List.
 # Copyright (c) 2005 shinGETsu Project.
 #}
{% if target %}
<div class="form-grid">
  <form method="get" action="{{gateway_cgi}}/{{target}}" id="filterform" class="grid-row">
    <label for="filter-input">{{message.filter}} ({{message.string}})</label>
    <div class="inline">
      <input id="filter-input" name="filter" value="{{filter}}" size="40" />
      <button class="btn">{{message.show}}</button>
    </div>
  </form>
  <form method="get" action="{{gateway_cgi}}/{{target}}" id="tagform" class="grid-row">
    <label for="tag-input">{{message.tag}} ({{message.string}})</label>
    <div class="inline">
      <input id="tag-input" name="tag" value="{{tag}}" size="40" />
      <button class="btn">{{message.show}}</button>
    </div>
  </form>
</div>
{% endif %}

{% if isadmin %}
  <form method="post" action="{{admin_cgi}}">
  <p><input type="hidden" name="cmd" value="fdel" /></p>
{% endif %}

{% if target %}
  <p class="tags">
  {% for t in taglist %}
    <a href="{{gateway_cgi}}/{{target}}?tag={{str_encode(t)}}" class="tag">{{t}}</a>
  {% endfor %}
  </p>
{% endif %}

{% for type in types %}
  <ul id="{{type}}_index">
  {% for cache in cachelist %}
    {% if cache.type == type %}
      {{make_list_item(cache, target=target, search=search_new_file)}}
    {% endif %}
  {% endfor %}
  </ul>
{% endfor %}
{% if (not cachelist) and (isfriend or isadmin) %}
  <p>{{message.empty_list % (gateway_link(gateway_cgi, 'recent'))}}</p>
{% endif %}

{% if isadmin %}
  <p><input type="submit" value="{{message.del_file}}" class="btn" /></p>
  </form>
{% endif %}

{% if target %}
  <p><a href="{{gateway_cgi}}/csv/{{target}}/file,stamp,date,path,uri,type,title,records,size,tag,sugtag">CSV</a>
  {% if target == 'recent' %}
  <a href="{{gateway_cgi}}/recent_rss">RSS</a>
  {% endif %}
  </p>
{% endif %}
