Files
anonymous_github/public/partials/explorer.htm
T
tdurieuxandClaude Opus 5.5 57412d0610 feat: refine the reviewer explorer and the visual system
- Explorer: redacted terms are highlighted in Markdown and code, the
  sidebar shows when the link expires, "Download repository" is the one
  primary action, and signed-out reviewers get a header without Sign in
  or the source-code link.
- Status: a ready anonymization leads with a copyable share link; the
  support links sit flat inside their section.
- One primary colour (accent) for actions and progress; mono is kept for
  IDs, hashes and paths; settings are plain sections instead of cards.
- Font sizes snap to one scale (10-40px); rem values keep following the
  reader's browser font size.
- Ko-fi button uses a dark surface in dark mode instead of a white pill.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 14:45:54 +02:00

85 lines
6.9 KiB
HTML

<div class="explorer-page">
<button class="sidebar-toggle" v-show="files?.length" @click="sidebarCollapsed = !sidebarCollapsed" :aria-label="(sidebarCollapsed ? &#x27;Show files&#x27; : &#x27;Hide files&#x27;)">
<svg class="ui-icon" aria-hidden="true"><use :href="sidebarCollapsed ? '#ui-icon-folder' : '#project-icon-close'"></use></svg>
<span v-text="sidebarCollapsed ? &#x27;Files&#x27; : &#x27;Close&#x27;"></span>
</button>
<div class="leftCol" v-show="files?.length" :class="{&#x27;collapsed&#x27;: sidebarCollapsed}">
<div class="leftCol-head">
<span class="leftCol-eyebrow">Files</span>
<button class="leftCol-close" aria-label="Close files" @click="sidebarCollapsed = true">
<svg class="ui-icon" aria-hidden="true"><use href="#project-icon-close"></use></svg>
</button>
</div>
<div class="leftCol-search">
<div class="tree-search-box">
<svg class="ui-icon tree-search-icon" aria-hidden="true" :class="{'fa-spin': fileSearchLoading}"><use :href="fileSearchLoading ? '#ui-icon-spinner' : '#ui-icon-search'"></use></svg>
<input type="text" class="tree-search-input" placeholder="Search files" aria-label="Search files" v-field="{ state: viewState, set: value =&gt; { fileSearchQuery = value }, value: fileSearchQuery, form: null, options: { debounce: 300 }, change: () =&gt; { 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 = &#x27;&#x27;; onFileSearchChange()">&times;</button>
</div>
</div>
<div class="leftCol-project-header">
<span class="project-name" v-text="repoId" :title="repoId"></span>
<span class="project-file-count">{{ fileCounts?.[''] || files?.length }} files</span>
<span class="project-expiry" v-if="options?.expirationDate" :title="options.expirationDate">
<svg class="ui-icon" aria-hidden="true"><use href="#project-icon-clock"></use></svg>
Available until {{ fmt?.date(options.expirationDate) }}
</span>
</div>
<div class="leftCol-body">
<div class="paper-inline-warning" role="alert" v-if="options?.truncatedFolders?.length &gt; 0">
<svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-warning"></use></svg>
{{ fmt?.translate('WARNINGS.repo_truncated') }}
</div>
<div class="paper-inline-warning" role="alert" v-if="options?.hasSubmodules">
<svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-warning"></use></svg>
{{ 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" :title="options?.sourceCommitDate || options?.anonymizedAt || options?.lastUpdateDate">
{{ options?.sourceCommitDate ? 'Source commit' : options?.anonymizedAt ? 'Anonymized' : 'Updated' }} {{ fmt?.date(options?.sourceCommitDate || options?.anonymizedAt || options?.lastUpdateDate) }}
</span>
<span class="last-update" v-if="options?.settingsSavedAt" :title="options.settingsSavedAt">
Settings saved {{ fmt?.date(options.settingsSavedAt) }}
</span>
<span class="last-update" v-if="options?.publishedAt" :title="options.publishedAt">
Snapshot ready {{ fmt?.date(options.publishedAt) }}
</span>
<span class="last-update" v-if="options?.anonymizedAt &amp;&amp; !options?.publishedAt" title="Older repositories have no recorded publication date. The source commit date does not establish when files became available here.">
Snapshot ready date not recorded
</span>
</div>
</div>
<div class="leftCol-backdrop" v-show="files?.length &amp;&amp; !sidebarCollapsed" @click="sidebarCollapsed = true"></div>
<div class="explorer-main">
<div class="status-bar" v-show="type != &#x27;error&#x27; || files?.length">
<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(&quot;/anonymize/&quot; + (repoId))"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-edit"></use></svg><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 == &#x27;html-doc&#x27; &amp;&amp; !showSource" :class="{&#x27;btn-active&#x27;: 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 == &#x27;html-doc&#x27;" @click="toggleSource()">
<svg class="ui-icon" aria-hidden="true"><use :href="showSource ? '#project-icon-eye' : '#ui-icon-code'"></use></svg><span class="d-none d-md-inline">
{{ showSource ? "Rendered" : "Source" }}</span>
</button>
<a target="_self" class="btn btn-sm btn-icon-only" aria-label="View raw current file" title="View raw file" v-show="content != null &amp;&amp; type != &#x27;error&#x27; &amp;&amp; type != &#x27;rate_limited&#x27;" :href="safeUrl((url))"><svg class="ui-icon" aria-hidden="true"><use href="#project-icon-file"></use></svg></a>
<a target="_self" class="btn btn-sm btn-icon-only" aria-label="Download current file" title="Download this file" v-show="content != null &amp;&amp; type != &#x27;error&#x27; &amp;&amp; type != &#x27;rate_limited&#x27;" :href="safeUrl((url) + &quot;&amp;download=true&quot;)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-download"></use></svg></a>
<a target="_self" class="btn btn-sm btn-ink" aria-label="Download repository as ZIP" title="Download the whole repository as a ZIP archive" v-if="options?.download" :href="safeUrl(&quot;/api/repo/&quot; + (repoId) + &quot;/zip&quot;)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-archive"></use></svg><span class="d-none d-md-inline"> Download repository</span></a>
<a target="_self" class="btn btn-sm" aria-label="Website" v-if="options?.hasWebsite" :href="safeUrl(&quot;/w/&quot; + (repoId) + &quot;/&quot;)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-globe"></use></svg><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>