mirror of https://github.com/IoTcat/PyOne.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
122 lines
6.0 KiB
122 lines
6.0 KiB
{%extends 'layout.html'%} |
|
{% import '_macro.html' as macros %} |
|
|
|
{%block content%} |
|
<div class="mdui-container-fluid"> |
|
<div class="mdui-typo"> |
|
<label class="mdui-switch"> |
|
看图模式 |
|
<input type="checkbox" id="image_view" {%if image_mode==1%}checked{%endif%}/> |
|
<i class="mdui-switch-icon"></i> |
|
</label> |
|
</div> |
|
{%include 'head.html'%} |
|
<div class="nexmoe-item"> |
|
<div class="mdui-row"> |
|
<ul class="mdui-list"> |
|
<li class="mdui-list-item th"> |
|
<div class="mdui-col-xs-8 mdui-col-sm-5">{{ macros.Arraw(name='文件',cur_type='name',sortby=sortby,order=order,path=path) }}</div> |
|
<div class="mdui-col-xs-4 mdui-col-sm-2">{{ macros.Arraw(name='修改时间',cur_type='lastModtime',sortby=sortby,order=order,path=path) }}</div> |
|
<div class="mdui-col-sm-2 mdui-text-right">{{ macros.Arraw(name='文件类型',cur_type='type',sortby=sortby,order=order,path=path) }}</div> |
|
<div class="mdui-col-sm-2 mdui-text-right">{{ macros.Arraw(name='大小',cur_type='size',sortby=sortby,order=order,path=path) }}</div> |
|
</li> |
|
{%if path.split(':')[-1]!=''%} |
|
<li class="mdui-list-item mdui-ripple"> |
|
{%if '/'.join(path_list(path)[:-1])==''%} |
|
<a href="{{url_for('.index',path=cur_user+':/')|safe}}"> |
|
{%else%} |
|
<a href="{{url_for('.index',path='/'.join(path_list(path)[:-1]))|safe}}"> |
|
{%endif%} |
|
<div class="mdui-col-xs-12 mdui-col-sm-7"> |
|
<i class="mdui-icon material-icons">arrow_upward</i> 返回上一层 |
|
</div> |
|
<div class="mdui-col-sm-3 mdui-text-right"></div> |
|
<div class="mdui-col-sm-2 mdui-text-right"></div> |
|
</a> |
|
</li> |
|
{%endif%} |
|
|
|
{%for data in items%} |
|
{%if data['type']=='folder' %} |
|
<li class="mdui-list-item mdui-ripple"> |
|
<a href="{{url_for('.index',path=path+'/'+data['name'])}}"> |
|
<div class="mdui-col-xs-8 mdui-col-sm-5 mdui-text-truncate"> |
|
<i class="mdui-icon material-icons">folder_open</i> {{data['name']}} |
|
</div> |
|
<div class="mdui-col-xs-4 mdui-col-sm-2">{{data['lastModtime']}}</div> |
|
<div class="mdui-col-sm-2 mdui-text-right">{{data['type']}}</div> |
|
<div class="mdui-col-sm-2 mdui-text-right">{{data['size']}}</div> |
|
</a> |
|
</li> |
|
{%else%} |
|
<li class="mdui-list-item file mdui-ripple"> |
|
<a href="{{url_for('.index',path=path+'/'+data['name'])|safe}}" target="_blank"> |
|
{%if image_mode==1%} |
|
{%if file_ico(data)=='image'%} |
|
<img class="mdui-img-fluid" src="{{url_for('.show',fileid=data['id'],user=cur_user)}}"/> |
|
{%else%} |
|
<div class="mdui-col-xs-8 mdui-col-sm-5 mdui-text-truncate"> |
|
<i class="mdui-icon material-icons">{{file_ico(data)}}</i> {{data['name']}} |
|
</div> |
|
<div class="mdui-col-xs-4 mdui-col-sm-2">{{data['lastModtime']}}</div> |
|
<div class="mdui-col-sm-2 mdui-text-right">{{data['type']}}</div> |
|
<div class="mdui-col-sm-2 mdui-text-right">{{data['size']}}</div> |
|
{%endif%} |
|
{%else%} |
|
<div class="mdui-col-xs-8 mdui-col-sm-5 mdui-text-truncate"> |
|
<i class="mdui-icon material-icons">{{file_ico(data)}}</i> {{data['name']}} |
|
</div> |
|
<div class="mdui-col-xs-4 mdui-col-sm-2">{{data['lastModtime']}}</div> |
|
<div class="mdui-col-sm-2 mdui-text-right">{{data['type']}}</div> |
|
<div class="mdui-col-sm-2 mdui-text-right">{{data['size']}}</div> |
|
{%endif%} |
|
</a> |
|
</li> |
|
{%endif%} |
|
{%endfor%} |
|
|
|
</ul> |
|
{%include 'readme.html'%} |
|
</div> |
|
</div> |
|
</div> |
|
|
|
<div class="mdui-center"> |
|
{% if pagination %} |
|
{{ macros.pagination_widget(pagination, endpoint,path=path,sortby=sortby,order=order) }} |
|
{% endif %} |
|
</div> |
|
|
|
<script> |
|
var $$ = mdui.JQ; |
|
$$(function() { |
|
$$('.file a').each(function() { |
|
$$(this).on('click', function() { |
|
var form = $$('<form target=_blank method=post></form>').attr('action', $$(this).attr('href')).get(0); |
|
$$(document.body).append(form); |
|
form.submit(); |
|
$$(form).remove(); |
|
return false; |
|
}); |
|
}); |
|
}); |
|
|
|
function setCookie(c_name, value, exdays) { |
|
var exdate = new Date(); |
|
exdate.setDate(exdate.getDate() + exdays); |
|
var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString()); |
|
document.cookie = c_name + "=" + c_value; |
|
} |
|
|
|
var ckname='image_mode' |
|
$('#image_view').change(function(){ |
|
if($(this).attr('checked')){ |
|
setCookie(ckname,1,1); |
|
window.location.href="{{url_for('.index',path=path,image_mode=0)}}"; |
|
}else{ |
|
setCookie(ckname,0,1); |
|
window.location.href="{{url_for('.index',path=path,image_mode=1)}}"; |
|
} |
|
}); |
|
</script> |
|
{%endblock content%}
|
|
|