first commit

This commit is contained in:
小喵 2022-07-11 18:09:15 +08:00 committed by Ming Tsay
commit db313f5eef
Signed by: mt
GPG key ID: 2BCF198BD3341FB3
47 changed files with 2006 additions and 0 deletions

View file

@ -0,0 +1,12 @@
<?php $this->layout('template', ['title' => $title ?? null, 'nav' => $nav ?? null]) ?>
<div class="list-group text-start mt-5 mx-auto w-fit-content">
<div class="list-group-item">請選擇檔案:</div>
<?php if (isset($list) && is_array($list)): ?>
<?php foreach ($list as $file): ?>
<a class="list-group-item list-group-item-action" href="view.php?file=<?= $this->e($file) ?>">
<?= $this->e($file) ?>
</a>
<?php endforeach ?>
<?php endif ?>
</div>

View file

@ -0,0 +1,35 @@
<?php $this->layout('template', ['title' => $title ?? null, 'nav' => $nav ?? null]) ?>
<div class="m-5">
<div class="dropdown">
<button class="btn btn-outline-secondary dropdown-toggle" type="button" id="file-selector"
data-bs-toggle="dropdown" aria-expanded="false">
請選擇檔案
</button>
<ul class="dropdown-menu" aria-labelledby="file-selector">
<?php if (isset($list) && is_array($list)): ?>
<?php foreach ($list as $filename): ?>
<li>
<?php if (isset($file) && $file === $filename): ?>
<a class="dropdown-item active" href="view.php?file=<?= $this->e($filename) ?>">
<?= $this->e($filename) ?>*
</a>
<?php else: ?>
<a class="dropdown-item" href="view.php?file=<?= $this->e($filename) ?>">
<?= $this->e($filename) ?>
</a>
<?php endif ?>
</li>
<?php endforeach ?>
<?php endif ?>
</ul>
</div>
<div class="alert alert-warning mt-5 m-auto d-table" role="alert">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor"
class="bi bi-exclamation-triangle-fill flex-shrink-0 me-2" viewBox="0 0 16 16" role="img"
aria-label="Warning:">
<path d="M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/>
</svg>
檔案不存在,請從上方選單選取欲查看之檔案。
</div>
</div>

View file

@ -0,0 +1,39 @@
<?php $this->layout('template', ['title' => $title ?? null, 'nav' => $nav ?? null]) ?>
<?php $this->push('styles') ?>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/styles/default.min.css"/>
<?php $this->end() ?>
<?php $this->push('scripts') ?>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/highlight.min.js"></script>
<!--suppress JSUnresolvedVariable -->
<script>hljs.highlightAll()</script>
<?php $this->end() ?>
<div class="dropdown my-2">
<button class="btn btn-outline-secondary dropdown-toggle"
type="button"
id="file-selector"
data-bs-toggle="dropdown"
aria-expanded="false">
<?= $this->e($file ?? '') ?>
</button>
<ul class="dropdown-menu" aria-labelledby="file-selector">
<?php if (isset($list) && is_array($list)): ?>
<?php foreach ($list as $filename): ?>
<li>
<?php if (isset($file) && $file === $filename): ?>
<a class="dropdown-item active" href="view.php?file=<?= $this->e($filename) ?>">
<?= $this->e($filename) ?>
</a>
<?php else: ?>
<a class="dropdown-item" href="view.php?file=<?= $this->e($filename) ?>">
<?= $this->e($filename) ?>
</a>
<?php endif ?>
</li>
<?php endforeach ?>
<?php endif ?>
</ul>
</div>
<pre class="file-content"><code class="language-<?= $this->e($type ?? 'plaintext') ?>"><?= $this->e($content ?? '') ?></code></pre>