_list-box.html 4.41 KB
Newer Older
1 2 3
{% load i18n %}

<div class="list-group" id="store-list-list">
4 5
  <a href="{% url "dashboard.views.store-list" %}?directory={{ up_url }}" 
    class="list-group-item store-list-item" data-item-type="D">
6
    <i class="fa fa-reply store-list-item-icon"></i>
7 8 9 10 11 12 13 14
    ..
    <div class="pull-right">
      {{ current }}
    </div>
  </a>

  {% for f in root %}
  <a class="list-group-item store-list-item" data-item-type="{{ f.TYPE }}"
15
    href="{% if f.TYPE == "D" %}{% url "dashboard.views.store-list" %}?directory={{ f.path }}{% else %}
16 17 18 19
    {% url "dashboard.views.store-download" %}?path={{ f.path }}{% endif %}"
    >
    <div class="store-list-item-icon">
      <i class="
20
        fa fa-{% if f.TYPE == "D" %}folder-open store-list-item-icon-directory{% else %}file{% endif %}"
21 22
        ></i>
    </div>
23 24 25
    <div class="store-list-item-name">
      {{ f.NAME }}
    </div>
26 27 28 29 30 31 32 33 34 35 36 37
    <div class="store-list-item-new">
      {% if f.is_new and f.TYPE == "F" %}
        <span class="badge badge-pulse">{% trans "new" %}</span>
      {% endif %}
    </div>
    
    <div class="store-list-item-size">
      {{ f.human_readable_size }}
    </div>
    <div class="clearfix"></div>
  </a>
  <div class="store-list-file-infos">
38 39 40 41 42
    <div class="row">
      <div class="col-sm-10">
        <dl class="dl-horizontal" style="margin: 0; padding: 0;">
          <dt>{% trans "Filename" %}</dt>
          <dd>{{ f.NAME }}</dd>
43

44 45
          <dt>{% trans "Size" %}</dt>
          <dd>{{ f.human_readable_size }}</dd>
46

47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
          <dt>{% trans "Latest modification" %}</dt>
          <dd>{{ f.human_readable_date }}</dd>
        </dl>
      </div>
      <div class="col-sm-2" style="text-align: right;">
        <a href="{% url "dashboard.views.store-download" %}?path={{ f.path }}" 
          class="btn btn-primary btn-sm store-download-button">
          <i class="fa fa-download"></i>
          {% trans "Download" %}
        </a>
        <a href="{% url "dashboard.views.store-remove" %}?path={{ f.path }}" 
          class="btn btn-danger btn-xs store-remove-button">
          <i class="fa fa-times"></i>
          {% trans "Remove" %}
        </a>
      </div>
    </div><!-- .row -->
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
  </div>
  {% empty %}
  <a class="list-group-item">
    {% trans "This folder is empty." %}
  </a>
  {% endfor %}

  <div class="list-group-item">
    {% trans "Upload file to this folder" %}
    <a href="{% url "dashboard.views.store-upload"%}?directory={{ current }}"
      class="btn btn-info btn-xs pull-right js-hidden">
      {% trans "Upload" %}
    </a>
    <form action="" data-action="{% url "dashboard.views.store-upload-url" %}" 
      method="POST" enctype="multipart/form-data" class="pull-right no-js-hidden"
      id="store-upload-form">
      {% csrf_token %}
      <input type="hidden" name="current_dir" value="{{ current }}"/>
      <input type="hidden" name="next" value="{{ next_url }}"/>
      <div class="input-group" style="max-width: 350px;">
        <span class="input-group-btn" id="store-upload-browse">
          <span class="btn btn-primary btn-xs">
            {% trans "Browse..." %}
          </span>     
        </span>
        <input type="text" class="form-control input-tags" 
         id="store-upload-filename"/>
        <span class="input-group-btn">
92
          <button type="submit" class="btn btn-primary btn-xs" disabled>
93
            <i class="fa fa-cloud-upload"></i> {% trans "Upload" %}
94
          </button>
95 96
        </span>
      </div>
97
      <input id="store-upload-file" name="data" type="file" style="display:none">
98 99 100 101 102 103 104 105
    </form>
  </div>
</div><!-- closing list-group -->

<div class="list-group">
  <div class="list-group-item">
    <a href="{% url "dashboard.views.store-remove" %}?path={{ current }}" 
      class="btn btn-danger btn-xs pull-right">
106
      <i class="fa fa-times"></i> {% trans "Remove directory" %}
107 108 109 110 111 112
    </a>
    <form method="POST" action="{% url "dashboard.views.store-new-directory" %}">
      {% csrf_token %}
      <input type="hidden" name="path" value="{{ current }}"/>
      <div class="input-group" style="max-width: 350px;">
        <span class="input-group-addon input-tags" title="{% trans "New directory" %}">
113
          <i class="fa fa-folder-open-alt"></i>
114 115 116 117 118 119 120 121 122 123
        </span>
        <input type="text" class="form-control input-tags" name="name"
         placeholder="{% trans "Name "%}"/>
        <span class="input-group-btn">
          <input type="submit" class="btn btn-success btn-xs" value="{% trans "Create" %}"/>
        </span>
      </div>
    </form>
  </div>
</div>