asset_index.html 5.38 KB
Newer Older
1 2
<%inherit file="base.html" />
<%! from django.core.urlresolvers import reverse %>
3
<%! from django.utils.translation import ugettext as _ %>
4
<%block name="bodyclass">is-signedin course uploads</%block>
David Baumgold committed
5
<%block name="title">${_("Files &amp; Uploads")}</%block>
6

7 8 9 10
<%namespace name='static' file='static_content.html'/>

<%block name="jsextra">
<script src="${static.url('js/vendor/mustache.js')}"></script>
11 12
<script src="${static.url('js/vendor/jQuery-File-Upload/js/jquery.iframe-transport.js')}"> </script>
<script src="${static.url('js/vendor/jQuery-File-Upload/js/jquery.fileupload.js')}"> </script>
13 14
</%block>

15
<%block name="content">
Brian Talbot committed
16

17 18 19 20 21 22 23 24 25 26
  <script type="text/template" id="new-asset-element">
    <tr data-id='{{url}}'>
      <td class="thumb-col">
        <div class="thumb">
          {{#thumb_url}}
          <img src="{{thumb_url}}">
          {{/thumb_url}}
        </div>
      </td>
      <td class="name-col">
27
        <a data-tooltip="Open/download this file" href="{{url}}" class="filename">{{displayname}}</a>
28 29 30 31 32 33
        <div class="embeddable-xml"></div>
      </td>
      <td class="date-col">
        {{uploadDate}}
      </td>
      <td class="embed-col">
34
        <input type="text" class="embeddable-xml-input" value='{{portable_url}}' readonly>
35
      </td>
36 37 38
      <td class="delete-col">
        <a href="#" data-tooltip="${_('Delete this asset')}" class="remove-asset-button"><span class="delete-icon"></span></a>
      </td>
39 40 41
    </tr>
  </script>

42
  <div class="wrapper-mast wrapper">
43
    <header class="mast has-actions has-subtitle">
Brian Talbot committed
44
      <h1 class="page-header">
Julian Arni committed
45 46
        <small class="subtitle">${_("Content")}</small>
        <span class="sr">&gt; </span>${_("Files &amp; Uploads")}
Brian Talbot committed
47
      </h1>
48 49

      <nav class="nav-actions">
Julian Arni committed
50
        <h3 class="sr">${_("Page Actions")}</h3>
51 52
        <ul>
          <li class="nav-item">
David Baumgold committed
53
            <a href="#" class="button upload-button new-button"><i class="icon-plus"></i> ${_("Upload New File")}</a>
54 55 56 57 58 59
          </li>
        </ul>
      </nav>
    </header>
  </div>

60 61
  <div class="main-wrapper">
    <div class="inner-wrapper">
62
      <div class="page-actions">
63
        <input type="text" class="asset-search-input search wip-box" placeholder="search assets" style="display:none"/>
64
      </div>
65
      <article class="asset-library" data-remove-asset-callback-url='${remove_asset_callback_url}'>
66 67 68 69 70 71
        <table>
          <thead>
            <tr>
              <th class="thumb-col"></th>
              <th class="name-col">Name</th>
              <th class="date-col">Date Added</th>
72
              <th class="embed-col">URL</th>
73
              <th class="delete-col"></th>
74 75
            </tr>
          </thead>
76
          <tbody id="asset_table_body">
77
          % for asset in assets:
78
            <tr data-id="${asset['url']}">
79
              <td class="thumb-col">
80 81 82 83 84
                <div class="thumb">
                  % if asset['thumb_url'] is not None:
                  <img src="${asset['thumb_url']}">
                  % endif
                </div>
85 86
              </td>
              <td class="name-col">
87
                <a data-tooltip="Open/download this file" href="${asset['url']}" class="filename">${asset['displayname']}</a>
Lyla Fischer committed
88
                <div class="embeddable-xml"></div>
89 90
              </td>
              <td class="date-col">
91
                ${asset['uploadDate']}
92 93
              </td>
              <td class="embed-col">
94
                <input type="text" class="embeddable-xml-input" value="${asset['portable_url']}" readonly>
95
              </td>
96 97
              <td class="delete-col">
                <a href="#" data-tooltip="${_('Delete this asset')}" class="remove-asset-button"><span class="delete-icon"></span></a>
98
              </td>
99
            </tr>
100
          % endfor
101 102
          </tbody>
        </table>
Lyla Fischer committed
103
        <nav class="pagination wip-box">
Brian Talbot committed
104
          Page:
105 106 107 108 109 110 111 112 113
          <ol class="pages">
            <li>1</li>
            <li><a href="#">2</a></li>
            <li><a href="#">3</a></li>
            <li><a href="#">4</a></li>
            <li><a href="#">5</a></li>
          </ol>
          <a href="#" class="next">»</a>
        </nav>
114 115 116 117
      </article>
    </div>
  </div>

118
  <div class="upload-modal modal">
119
    <a href="#" class="close-button"><span class="close-icon"></span></a>
Julian Arni committed
120
      <div class="modal-body">
121
        <h1>${_("Upload New File")}</h1>
Julian Arni committed
122 123 124 125
        <p class="file-name"></a>
        <div class="progress-bar">
          <div class="progress-fill"></div>
        </div>
126
      <div class="embeddable">
127
        <label>URL:</label>
128
        <input type="text" class="embeddable-xml-input" value='' readonly>
129
      </div>
Julian Arni committed
130
        <form class="file-chooser" action="${upload_asset_callback_url}"
Lyla Fischer committed
131
                                method="post" enctype="multipart/form-data">
132
          <a href="#" class="choose-file-button">${_("Choose File")}</a>
Julian Arni committed
133
          <input type="file" class="file-input" name="file" multiple>
Julian Arni committed
134 135
        </form>
      </div>
136
    </div>
137

138
    <div class="modal-cover"></div>
139

Lyla Fischer committed
140

141
</%block>
142 143 144 145 146 147 148 149 150 151 152 153 154

<%block name="view_alerts">
<!-- alert: save confirmed with close -->
<div class="wrapper wrapper-alert wrapper-alert-confirmation" role="status">
  <div class="alert confirmation">
    <i class="icon-ok"></i>

    <div class="copy">
      <h2 class="title title-3">${_('Your file has been deleted.')}</h2>
    </div>

    <a href="" rel="view" class="action action-alert-close">
      <i class="icon-remove-sign"></i>
155
      <span class="label">${_('close alert')}</span>
156 157 158 159
    </a>
  </div>
</div>
</%block>