2013-05-22 08:52:11 -04:00
|
|
|
{% extends "blarg/views/templates/base.html" %}
|
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
|
|
|
|
<div class="page-header">
|
|
|
|
<h2>Index of {{path}}</h2>
|
|
|
|
</div>
|
|
|
|
|
2013-05-26 14:51:34 -04:00
|
|
|
{% if success %}
|
|
|
|
<div class="alert alert-success">{{success}}</div>
|
|
|
|
{% endif %}
|
|
|
|
{% if error %}
|
|
|
|
<div class="alert alert-error">{{error}}</div>
|
|
|
|
{% endif %}
|
|
|
|
{% if notice %}
|
|
|
|
<div class="alert alert-info">{{notice}}</div>
|
|
|
|
{% endif %}
|
|
|
|
|
2013-05-22 08:52:11 -04:00
|
|
|
<div>
|
2013-05-26 13:49:33 -04:00
|
|
|
<div class="pull-left form-inline">
|
2013-05-22 08:52:11 -04:00
|
|
|
<select id="tree">
|
|
|
|
{% for folder in tree %}
|
|
|
|
<option{% ifequal folder path %} selected{% endifequal %}>{{folder}}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
2013-05-26 13:49:33 -04:00
|
|
|
<a class="btn" href="#" id="tree-selector">Go</a>
|
2013-05-22 08:52:11 -04:00
|
|
|
</div>
|
|
|
|
<div class="pull-right">
|
2013-05-22 23:59:21 -04:00
|
|
|
<a class="btn btn-primary" href="#" data-toggle="modal" data-target="#newFileModal">Upload File</a>
|
2013-05-22 08:52:11 -04:00
|
|
|
</div>
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
</div>
|
|
|
|
|
2013-05-26 14:02:59 -04:00
|
|
|
<div class="file-list-container">
|
2013-07-29 22:44:27 -04:00
|
|
|
{% if not files|is-empty %}
|
2013-05-26 14:02:59 -04:00
|
|
|
<table class="table table-hover table-condensed">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th width="440px">Filename</th>
|
|
|
|
<th width="100px">Size</th>
|
|
|
|
<th width="240px">Last Modified</th>
|
|
|
|
<th width="160px"> </th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for file in files %}
|
2013-05-26 15:38:53 -04:00
|
|
|
<tr{% if not file.published %} class="unpublished-file"{% endif %}>
|
2013-05-26 14:02:59 -04:00
|
|
|
<td>
|
|
|
|
<a href="{{context}}/files{{path}}{{file.filename}}"><i class="icon-file"></i> {{file.filename}}</a><br />
|
|
|
|
<small class="muted">{{file.content-type}}</small>
|
|
|
|
</td>
|
|
|
|
<td>{{file.size}}</td>
|
|
|
|
<td>{{file.last_modified|to_fulltime}}</td>
|
|
|
|
<td style="text-align: right;">
|
2013-05-26 20:02:30 -04:00
|
|
|
<a class="btn btn-warning" title="Update File" data-updatefileid="{{file.id}}" href="#"><i class="icon-pencil icon-white"></i></a>
|
2013-05-26 15:35:45 -04:00
|
|
|
{% if file.published %}
|
2013-06-07 20:12:08 -04:00
|
|
|
<a class="btn btn-warning" title="Unpublish File" href="{{context}}/unpublishfile{{file.id}}?returnpath={{path}}"><i class="icon-minus-sign icon-white"></i></a>
|
2013-05-26 15:35:45 -04:00
|
|
|
{% endif %}
|
|
|
|
{% if not file.published %}
|
2013-06-07 20:12:08 -04:00
|
|
|
<a class="btn btn-success" title="Publish File" href="{{context}}/publishfile{{file.id}}?returnpath={{path}}"><i class="icon-ok-sign icon-white"></i></a>
|
2013-05-26 15:35:45 -04:00
|
|
|
{% endif %}
|
2013-05-26 20:02:30 -04:00
|
|
|
<a class="btn btn-danger" title="Delete File" data-deletefileid="{{file.id}}" href="#"><i class="icon-remove icon-white"></i></a>
|
2013-05-26 14:02:59 -04:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
{% else %}
|
|
|
|
<p class="text-center">No files found.</p>
|
2013-07-29 18:32:27 -04:00
|
|
|
{% endif %}
|
2013-05-26 14:02:59 -04:00
|
|
|
</div>
|
2013-05-22 08:52:11 -04:00
|
|
|
|
|
|
|
<div id="newFileModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="newFileModalLabel" aria-hidden="true">
|
|
|
|
<div class="modal-header">
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
2013-05-22 23:59:21 -04:00
|
|
|
<h3 id="newFileModalLabel">Upload File</h3>
|
2013-05-22 08:52:11 -04:00
|
|
|
</div>
|
2013-06-07 20:12:08 -04:00
|
|
|
<form action="{{context}}/uploadfile?returnpath={{path}}" method="post" enctype="multipart/form-data" class="form-horizontal">
|
2013-05-26 14:06:36 -04:00
|
|
|
<input type="hidden" id="newPath" name="path" value="{{path}}" />
|
2013-05-22 08:52:11 -04:00
|
|
|
<div class="modal-body">
|
|
|
|
<div class="control-group">
|
|
|
|
<label class="control-label" for="newFile">Upload File</label>
|
|
|
|
<div class="controls">
|
|
|
|
<input type="file" id="newFile" name="file" placeholder="File" />
|
|
|
|
</div>
|
|
|
|
</div>
|
2013-05-26 14:06:36 -04:00
|
|
|
<p>If a file exists in this directory with the same filename as the one uploaded it will be updated automatically.</p>
|
2013-05-22 08:52:11 -04:00
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
|
|
|
<button type="submit" class="btn btn-primary">Upload</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
2013-05-26 15:07:20 -04:00
|
|
|
<div id="updateFileModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="updateFileModalLabel" aria-hidden="true">
|
|
|
|
<div class="modal-header">
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
|
|
<h3 id="updateFileModalLabel">Update File</h3>
|
|
|
|
</div>
|
2013-06-07 20:12:08 -04:00
|
|
|
<form action="{{context}}/updatefile?returnpath={{path}}" method="post" enctype="multipart/form-data" class="form-horizontal">
|
2013-05-26 15:07:20 -04:00
|
|
|
<input type="hidden" id="updateFileId" name="id" />
|
|
|
|
<div class="modal-body">
|
|
|
|
<p>Select a file to upload over top of this file with:</p>
|
|
|
|
<p><strong id="updateFileModalFilename"></strong></p>
|
|
|
|
<div class="control-group">
|
|
|
|
<label class="control-label" for="updateFile">Upload File</label>
|
|
|
|
<div class="controls">
|
|
|
|
<input type="file" id="updateFile" name="file" placeholder="File" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
|
|
|
<button type="submit" class="btn btn-primary">Upload</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
2013-05-23 09:26:19 -04:00
|
|
|
<div id="deleteFileModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="deleteFileModalLabel" aria-hidden="true">
|
|
|
|
<div class="modal-header">
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
|
|
<h3 id="deleteFileModalLabel">Delete File</h3>
|
|
|
|
</div>
|
2013-06-07 20:12:08 -04:00
|
|
|
<form action="{{context}}/deletefile?returnpath={{path}}" method="post" class="form-horizontal">
|
2013-05-26 14:55:18 -04:00
|
|
|
<input type="hidden" id="deleteFileId" name="id" />
|
2013-05-23 09:26:19 -04:00
|
|
|
<div class="modal-body">
|
|
|
|
<p>Confirm that you would like to delete the following file:</p>
|
|
|
|
<p><strong id="deleteFileModalFilename"></strong></p>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
|
|
|
|
<button type="submit" class="btn btn-primary">Delete</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
|
2013-05-22 08:52:11 -04:00
|
|
|
<script type="text/javascript">
|
2013-05-26 13:49:33 -04:00
|
|
|
$(document).ready(function() {
|
|
|
|
$('#tree').combobox({force_match: false});
|
|
|
|
$('#tree').data('combobox').val('{{path}}');
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#tree-selector').click(function() {
|
|
|
|
var path = $('#tree').data('combobox').val();
|
|
|
|
window.location.href = '{{context}}/listfiles' + path;
|
2013-05-23 09:26:19 -04:00
|
|
|
});
|
|
|
|
|
2013-05-26 15:07:20 -04:00
|
|
|
$('a[data-updatefileid]').click(function() {
|
|
|
|
var fileId = $(this).data('updatefileid');
|
|
|
|
|
|
|
|
$('#updateFileModal').modal({backdrop: 'static', keyboard: false});
|
|
|
|
$('#updateFileId').val(fileId);
|
|
|
|
$('#updateFileModalFilename').text(fileId);
|
|
|
|
});
|
|
|
|
|
2013-05-23 09:26:19 -04:00
|
|
|
$('a[data-deletefileid]').click(function() {
|
|
|
|
var fileId = $(this).data('deletefileid');
|
|
|
|
|
|
|
|
$('#deleteFileModal').modal({backdrop: 'static', keyboard: false});
|
|
|
|
$('#deleteFileId').val(fileId);
|
|
|
|
$('#deleteFileModalFilename').text(fileId);
|
|
|
|
});
|
|
|
|
|
2013-05-22 08:52:11 -04:00
|
|
|
</script>
|
|
|
|
|
|
|
|
{% endblock %}
|