Files
ap-ds-git-code/templates/directory.html
T

81 lines
3.4 KiB
HTML

{% extends "base.html" %}
{% block title %}目录浏览 - ap_ds{% endblock %}
{% block content %}
<div class="repo-container">
<!-- 面包屑导航 -->
<div class="repo-breadcrumb repo-mb-4">
<a href="{{ url_for('code_browser') }}?branch={{ branch }}&version={{ version }}" class="repo-breadcrumb__link">根目录</a>
{% for crumb in breadcrumbs %}
<span class="repo-breadcrumb__separator">/</span>
<a href="{{ url_for('browse_directory', dir_path=crumb.path, branch=branch, version=version) }}" class="repo-breadcrumb__link">
{{ crumb.name }}
</a>
{% endfor %}
</div>
<div class="repo-card">
<div class="repo-card__body">
<table class="repo-table">
<thead>
<tr>
<th>名称</th>
<th>大小</th>
<th>修改时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{% if current_path %}
<tr>
<td>
<a href="{{ url_for('code_browser') }}?branch={{ branch }}&version={{ version }}" class="repo-text-link">..</a>
</td>
<td>-</td>
<td>-</td>
<td>-</td>
</tr>
{% endif %}
{% for file in files %}
<tr>
<td>
{% if file.type == 'dir' %}
<span class="icon-folder repo-mr-2"></span>
<a href="{{ url_for('browse_directory', dir_path=file.path, branch=branch, version=version) }}" class="repo-text-link">
{{ file.name }}
</a>
{% else %}
<span class="icon-file repo-mr-2"></span>
<a href="{{ url_for('view_file', file_path=file.path, branch=branch, version=version) }}" class="repo-text-link">
{{ file.name }}
</a>
{% endif %}
</td>
<td class="repo-text-secondary repo-text-sm">
{% if file.type == 'file' %}
{% if file.size < 1024 %}
{{ file.size }} B
{% elif file.size < 1024*1024 %}
{{ (file.size/1024)|round(1) }} KB
{% else %}
{{ (file.size/(1024*1024))|round(1) }} MB
{% endif %}
{% else %}
-
{% endif %}
</td>
<td class="repo-text-secondary repo-text-sm">{{ file.modified }}</td>
<td>
{% if file.type == 'file' %}
<a href="{{ url_for('download_file', file_path=file.path) }}" class="repo-btn repo-btn--sm repo-btn--ghost">下载</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock %}