mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-09-12 13:48:58 +02:00
72 lines
5.3 KiB
HTML
72 lines
5.3 KiB
HTML
<div class="explorer-page">
|
|
<button class="sidebar-toggle" v-show="files?.length" @click="sidebarCollapsed = !sidebarCollapsed" :aria-label="(sidebarCollapsed ? 'Show files' : 'Hide files')">
|
|
<i class="fas" :class="sidebarCollapsed ? 'fa-folder-open' : 'fa-times'"></i>
|
|
<span v-text="sidebarCollapsed ? 'Files' : 'Close'"></span>
|
|
</button>
|
|
|
|
<div class="leftCol" v-show="files?.length" :class="{'collapsed': sidebarCollapsed}">
|
|
<div class="leftCol-head">
|
|
<span class="leftCol-eyebrow">Files</span>
|
|
<button class="leftCol-close" aria-label="Close files" @click="sidebarCollapsed = true">
|
|
<i class="fas fa-times"></i>
|
|
</button>
|
|
</div>
|
|
<div class="leftCol-search">
|
|
<div class="tree-search-box">
|
|
<i class="fas tree-search-icon" :class="fileSearchLoading ? 'fa-spinner fa-spin' : 'fa-search'"></i>
|
|
<input type="text" class="tree-search-input" placeholder="Search files" aria-label="Search files" v-field="{ state: viewState, set: value => { fileSearchQuery = value }, value: fileSearchQuery, form: null, options: { debounce: 300 }, change: () => { onFileSearchChange() } }">
|
|
<kbd class="tree-search-kbd" v-show="!(fileSearchQuery)">{{ isMac ? '⌘' : 'Ctrl+' }}K</kbd>
|
|
<button class="tree-search-clear" aria-label="Clear search" v-show="fileSearchQuery" @click="fileSearchQuery = ''; onFileSearchChange()">×</button>
|
|
</div>
|
|
</div>
|
|
<div class="leftCol-project-header">
|
|
<span class="project-name" v-text="repoId"></span>
|
|
<span class="project-file-count">{{ fileCounts?.[''] || files?.length }} files</span>
|
|
</div>
|
|
<div class="leftCol-body">
|
|
<div class="paper-inline-warning" role="alert" v-if="options?.truncatedFolders?.length > 0">
|
|
<i class="fas fa-exclamation-triangle"></i>
|
|
{{ fmt?.translate('WARNINGS.repo_truncated') }}
|
|
</div>
|
|
<div class="paper-inline-warning" role="alert" v-if="options?.hasSubmodules">
|
|
<i class="fas fa-exclamation-triangle"></i>
|
|
{{ fmt?.translate('WARNINGS.submodules_not_included') }}
|
|
</div>
|
|
<tree class="files" :file="files" :search-query="fileSearchQuery" :search-results="fileSearchResults" :page="viewState"></tree>
|
|
</div>
|
|
<div class="leftCol-foot">
|
|
<span class="last-update" data-toggle="tooltip" data-placement="top" :title="(options?.lastUpdateDate)">
|
|
Updated {{ fmt?.date(options?.lastUpdateDate) }}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="leftCol-backdrop" v-show="files?.length && !sidebarCollapsed" @click="sidebarCollapsed = true"></div>
|
|
|
|
<div class="explorer-main">
|
|
<div class="status-bar">
|
|
<ol class="breadcrumb paths" aria-label="Path">
|
|
<li class="breadcrumb-item" v-for="(p, index) in paths" v-text="p"></li>
|
|
</ol>
|
|
<div class="status-bar-actions">
|
|
<a class="btn btn-sm" aria-label="Edit" v-if="options?.isAdmin || options?.isOwner" :href="safeUrl("/anonymize/" + (repoId))"><i class="far fa-edit"></i><span class="d-none d-md-inline"> Edit</span></a>
|
|
<button class="btn btn-sm" aria-label="Allow this document to run JavaScript" title="Scripts in this file are blocked by default. Enable them only if you trust the repository — the document stays isolated from your session either way." v-if="type == 'html-doc' && !showSource" :class="{'btn-active': allowScripts}" @click="toggleAllowScripts()">
|
|
<i class="fab fa-js"></i><span class="d-none d-md-inline">
|
|
{{ allowScripts ? "JS on" : "JS off" }}</span>
|
|
</button>
|
|
<button class="btn btn-sm" aria-label="Toggle between the rendered document and its source" title="Toggle between the rendered document and its source" v-if="type == 'html-doc'" @click="toggleSource()">
|
|
<i class="fas" :class="showSource ? 'fa-eye' : 'fa-code'"></i><span class="d-none d-md-inline">
|
|
{{ showSource ? "Rendered" : "Source" }}</span>
|
|
</button>
|
|
<a target="_self" class="btn btn-sm" aria-label="View raw current file" title="View the raw content of the current file" v-show="content != null" :href="safeUrl((url))"><i class="fas fa-file-alt"></i><span class="d-none d-md-inline"> Raw</span></a>
|
|
<a target="_self" class="btn btn-sm" aria-label="Download current file" title="Download the current file" v-show="content != null" :href="safeUrl((url) + "&download=true")"><i class="fas fa-download"></i><span class="d-none d-md-inline"> Download</span></a>
|
|
<a target="_self" class="btn btn-sm" aria-label="Download full repository as ZIP" title="Download the full repository as a ZIP archive" v-if="options?.download" :href="safeUrl("/api/repo/" + (repoId) + "/zip")"><i class="fas fa-file-archive"></i><span class="d-none d-md-inline"> Full repo ZIP</span></a>
|
|
<a target="_self" class="btn btn-sm" aria-label="Website" v-if="options?.hasWebsite" :href="safeUrl("/w/" + (repoId) + "/")"><i class="fas fa-globe"></i><span class="d-none d-md-inline"> Website</span></a>
|
|
</div>
|
|
</div>
|
|
<div class="explorer-content">
|
|
<partial-view name="partials/pageView.htm" :state="viewState"></partial-view>
|
|
</div>
|
|
</div>
|
|
</div>
|