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

3 4 5 6
<div class="list-group">
  <div class="list-group-item">
    <div class="row">
      <div class="col-sm-6">
7
        <a href="{% url "dashboard.views.store-upload"%}?directory={{ current|urlencode }}"
8
          class="btn btn-info btn-xs js-hidden">
9 10
          {% trans "Upload" %}
        </a>
11
        <form action="" data-action="{% url "dashboard.views.store-upload-url" %}"
12 13 14
          method="POST" enctype="multipart/form-data" class="no-js-hidden"
          id="store-upload-form">
          {% csrf_token %}
15
          <input type="hidden" name="current_dir" value="{{ current|urlencode }}"/>
16 17 18 19 20
          <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..." %}
21
              </span>
22
            </span>
23
            <input type="text" class="form-control input-tags"
24 25 26 27 28 29 30 31 32 33 34 35
             id="store-upload-filename"/>
            <span class="input-group-btn">
              <button type="submit" class="btn btn-primary btn-xs" disabled>
                <i class="fa fa-cloud-upload"></i> {% trans "Upload" %}
              </button>
            </span>
          </div>
          <input id="store-upload-file" name="data" type="file" style="display:none">
        </form>
      </div><!-- .col-sm-6 upload -->

      <div class="col-sm-6">
36 37
        <a href="{% url "dashboard.views.store-remove" %}?path={{ current|urlencode }}"
          class="btn btn-danger btn-xs pull-right store-action-button"
38 39 40
          title="{% trans "Remove directory" %}">
          <i class="fa fa-times"></i>
        </a>
41 42
        <a href="{% url "dashboard.views.store-download" %}?path={{ current|urlencode }}"
          class="btn btn-primary btn-xs pull-right store-action-button"
43 44 45 46 47 48 49 50 51 52 53
          title="{% trans "Download directory" %}">
          <i class="fa fa-cloud-download"></i>
        </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: 300px;">
            <span class="input-group-addon input-tags" title="{% trans "New directory" %}">
              <i class="fa fa-folder-open"></i>
            </span>
54
            <input type="text" class="form-control input-tags" name="name"
55 56 57 58 59 60 61 62 63 64 65
             placeholder="{% trans "Name "%}" required/>
            <span class="input-group-btn">
              <input type="submit" class="btn btn-success btn-xs" value="{% trans "Create" %}"/>
            </span>
          </div>
        </form>
      </div><!-- .col-sm-6 -->
    </div><!-- .row -->
  </div><!-- .list-group-item -->
</div><!-- .list-group -->

66
<div class="list-group" id="store-list-list">
67
  <a href="{% url "dashboard.views.store-list" %}?directory={{ up_url|urlencode }}"
68
    class="list-group-item store-list-item" data-item-type="D">
69 70
    {% if current == "/" %}
      <div class="store-list-item-icon">
71
        <i class="fa fa-refresh" id="store-list-up-icon"></i>
72 73 74 75
      </div>
      {% trans "Refresh" %}
    {% else %}
      <div class="store-list-item-icon">
76
        <i class="fa fa-reply" id="store-list-up-icon"></i>
77 78 79 80
      </div>
      ..
    {% endif %}

81 82 83 84 85 86 87
    <div class="pull-right">
      {{ current }}
    </div>
  </a>

  {% for f in root %}
  <a class="list-group-item store-list-item" data-item-type="{{ f.TYPE }}"
88 89
    href="{% if f.TYPE == "D" %}{% url "dashboard.views.store-list" %}?directory={{ f.path|urlencode }}{% else %}
    {% url "dashboard.views.store-download" %}?path={{ f.path|urlencode }}{% endif %}"
90 91 92
    >
    <div class="store-list-item-icon">
      <i class="
93
        fa fa-{{ f.icon }}{% if f.TYPE == "D" %} store-list-item-icon-directory{% endif %}"
94 95
        ></i>
    </div>
96 97 98
    <div class="store-list-item-name">
      {{ f.NAME }}
    </div>
99 100 101 102 103
    <div class="store-list-item-new">
      {% if f.is_new and f.TYPE == "F" %}
        <span class="badge badge-pulse">{% trans "new" %}</span>
      {% endif %}
    </div>
104

105 106 107 108 109 110
    <div class="store-list-item-size">
      {{ f.human_readable_size }}
    </div>
    <div class="clearfix"></div>
  </a>
  <div class="store-list-file-infos">
111 112 113 114 115
    <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>
116

117 118
          <dt>{% trans "Size" %}</dt>
          <dd>{{ f.human_readable_size }}</dd>
119

120 121 122 123 124
          <dt>{% trans "Latest modification" %}</dt>
          <dd>{{ f.human_readable_date }}</dd>
        </dl>
      </div>
      <div class="col-sm-2" style="text-align: right;">
125
        <a href="{% url "dashboard.views.store-download" %}?path={{ f.path|urlencode }}"
126 127 128 129
          class="btn btn-primary btn-sm store-download-button">
          <i class="fa fa-download"></i>
          {% trans "Download" %}
        </a>
130
        <a href="{% url "dashboard.views.store-remove" %}?path={{ f.path|urlencode }}"
131 132 133 134 135 136
          class="btn btn-danger btn-xs store-remove-button">
          <i class="fa fa-times"></i>
          {% trans "Remove" %}
        </a>
      </div>
    </div><!-- .row -->
137 138 139 140 141 142 143
  </div>
  {% empty %}
  <a class="list-group-item">
    {% trans "This folder is empty." %}
  </a>
  {% endfor %}
</div><!-- closing list-group -->