mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-04-21 12:56:05 +02:00
3f32ec5ca1
* Fix horizontal overflow causing page content to be cut off on mobile - Add overflow-x: hidden to html/body and ng-view to prevent horizontal scrolling across all pages - Restore .container.page mobile padding to 15px to match Bootstrap .row negative margins (-15px), which previously caused 5px overflow per side - Add max-width: 100% constraints to prevent content from exceeding viewport https://claude.ai/code/session_01L2xhJCKkjghMDBuwXpSHzi * Fix Ko-fi widget overlapping hamburger menu and simplify desktop layout - Move Ko-fi "Support me" button from top-right (where it hid the navbar hamburger) to bottom-right corner - Remove card styling (border, background, border-radius) from dashboard quota section for a flatter, cleaner look - Remove fixed max-width: 960px from dashboard-page so it uses Bootstrap's standard container widths, consistent with other pages like admin https://claude.ai/code/session_01L2xhJCKkjghMDBuwXpSHzi * Redesign anonymize page: centered landing, reorganized form layout - No URL state: centered input in the middle of the page for a clean initial experience - URL provided state: preview on the left, form settings on the right in a fixed-width sidebar panel (380px on desktop) - Reorganized form sections into logical groups: Source (branch/commit) → Identity (ID/conference) → Anonymization (terms) → Display (checkboxes, no longer hidden in accordion) → Expiration - Removed card/accordion wrappers for a flatter, more scannable form - Mobile: form stacks below preview with sticky submit bar https://claude.ai/code/session_01L2xhJCKkjghMDBuwXpSHzi * Reduce navbar height on desktop - Reduce navbar padding from default .5rem to 4px vertical - Shrink nav icons from 30px/40px to 20px/28px - Reduce nav-link font size to 0.9rem with tighter padding - Shrink navbar-brand font size to 1rem https://claude.ai/code/session_01L2xhJCKkjghMDBuwXpSHzi --------- Co-authored-by: Claude <noreply@anthropic.com>
301 lines
17 KiB
HTML
301 lines
17 KiB
HTML
<div class="anonymize-page h-100">
|
|
<!-- ===== STATE 1: No URL — centered input ===== -->
|
|
<div class="anonymize-landing" ng-hide="sourceUrl">
|
|
<div class="anonymize-landing-inner">
|
|
<h2 class="mb-3">Anonymize</h2>
|
|
<div class="form-group mb-2">
|
|
<input
|
|
type="text"
|
|
class="form-control form-control-lg"
|
|
ng-model="sourceUrl"
|
|
placeholder="Paste a GitHub repo or pull request URL"
|
|
ng-model-options="{ debounce: {default: 1000, blur: 0, click: 0}, updateOn: 'default blur click' }"
|
|
ng-change="urlSelected()"
|
|
/>
|
|
</div>
|
|
<small class="form-text text-muted">
|
|
Paste a repository URL to anonymize a repo, or a pull request URL to anonymize a PR.
|
|
</small>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ===== STATE 2: URL provided — preview (left) + form (right) ===== -->
|
|
<div class="container-fluid h-100" ng-show="sourceUrl">
|
|
<div class="row h-100 flex-column flex-md-row">
|
|
|
|
<!-- Preview column (left on desktop) -->
|
|
<div
|
|
class="col-md p-2 overflow-auto markdown-body body anonymize-preview-col"
|
|
ng-bind-html="html_readme"
|
|
ng-if="detectedType === 'repo' && html_readme"
|
|
></div>
|
|
|
|
<div class="col-md p-2 overflow-auto anonymize-preview-col" ng-if="detectedType === 'pr' && details">
|
|
<div class="d-flex w-100 justify-content-between align-items-center flex-wrap">
|
|
<h2 class="pr-title mb-1">
|
|
<span ng-if="options.title">{{anonymizePrContent(details.pullRequest.title)}}</span>
|
|
<span class="badge" ng-class="{'badge-success':details.pullRequest.merged, 'badge-warning':details.pullRequest.state=='open', 'badge-danger':details.pullRequest.state=='closed' && !details.pullRequest.merged}">
|
|
{{details.pullRequest.merged ? "merged" : details.pullRequest.state | title}}
|
|
</span>
|
|
</h2>
|
|
<small ng-bind="details.pullRequest.updatedDate | date" ng-if="options.date"></small>
|
|
</div>
|
|
<small ng-if="options.origin">Pull Request on {{details.pullRequest.baseRepositoryFullName}}</small>
|
|
<div class="pr-body shadow-sm p-3 mb-4 rounded" style="background: var(--sidebar-bg-color)" ng-if="options.body">
|
|
<markdown content="anonymizePrContent(details.pullRequest.body)" options="options" terms="terms"></markdown>
|
|
</div>
|
|
<ul class="nav nav-tabs" id="prTabs" role="tablist">
|
|
<li class="nav-item" role="presentation" ng-if="options.diff">
|
|
<button class="nav-link active" id="pills-diff-tab" data-toggle="pill" data-target="#pills-diff" type="button" role="tab">Diff</button>
|
|
</li>
|
|
<li class="nav-item" role="presentation" ng-if="options.comments">
|
|
<button class="nav-link" ng-class="{'active':!options.diff}" id="pills-comments-tab" data-toggle="pill" data-target="#pills-comments" type="button" role="tab">
|
|
<ng-pluralize count="details.pullRequest.comments.length" when="{'0': 'No comment', 'one': 'One Comment', 'other': '{} Comments'}"></ng-pluralize>
|
|
</button>
|
|
</li>
|
|
</ul>
|
|
<div class="tab-content" id="pills-tabContent">
|
|
<div class="tab-pane show active" id="pills-diff" role="tabpanel" ng-if="options.diff">
|
|
<div class="pr-diff shadow-sm p-3 mb-4 rounded" style="background: var(--sidebar-bg-color)">
|
|
<pre style="overflow-x: auto"><code ng-bind-html="anonymizePrContent(details.pullRequest.diff) | diff"></code></pre>
|
|
</div>
|
|
</div>
|
|
<div class="tab-pane" ng-class="{'show active':!options.diff}" id="pills-comments" role="tabpanel" ng-if="options.comments">
|
|
<ul class="pr-comments list-group">
|
|
<li class="pr-comment list-group-item" ng-repeat="comment in details.pullRequest.comments">
|
|
<div class="d-flex w-100 justify-content-between flex-wrap">
|
|
<h5 class="mb-1" ng-if="options.username">@{{anonymizePrContent(comment.author)}}</h5>
|
|
<small ng-bind="comment.updatedDate | date" ng-if="options.date"></small>
|
|
</div>
|
|
<p class="mb-1">
|
|
<markdown class="pr-comment-body" ng-if="options.body" content="anonymizePrContent(comment.body)" options="options" terms="terms"></markdown>
|
|
</p>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Form column (right on desktop) -->
|
|
<div class="anonymize-form-col overflow-auto">
|
|
<form class="form needs-validation p-3" name="anonymize" novalidate>
|
|
|
|
<!-- Source URL -->
|
|
<div class="form-group mb-2">
|
|
<input
|
|
type="text"
|
|
class="form-control"
|
|
name="sourceUrl"
|
|
id="sourceUrl"
|
|
ng-class="{'is-invalid': anonymize.sourceUrl.$invalid}"
|
|
ng-model="sourceUrl"
|
|
placeholder="Paste a GitHub repo or pull request URL"
|
|
ng-model-options="{ debounce: {default: 1000, blur: 0, click: 0}, updateOn: 'default blur click' }"
|
|
ng-change="urlSelected()"
|
|
/>
|
|
<div class="invalid-feedback" ng-show="anonymize.sourceUrl.$error.github">
|
|
Please provide a valid GitHub URL.
|
|
</div>
|
|
<div class="invalid-feedback" ng-show="anonymize.sourceUrl.$error.access">
|
|
Not accessible. The organization may restrict access.
|
|
</div>
|
|
<div class="invalid-feedback" ng-show="anonymize.sourceUrl.$error.missing">
|
|
Does not exist or is not accessible.
|
|
</div>
|
|
<div class="invalid-feedback" ng-show="anonymize.sourceUrl.$error.used">
|
|
Already anonymized.
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb-2" ng-show="detectedType">
|
|
<span class="type-badge" ng-class="{'type-repo': detectedType === 'repo', 'type-pr': detectedType === 'pr'}">
|
|
<i ng-class="{'fas fa-code-branch': detectedType === 'repo', 'fas fa-code-merge': detectedType === 'pr'}"></i>
|
|
{{detectedType === 'repo' ? 'Repository' : 'Pull Request'}}
|
|
</span>
|
|
</div>
|
|
|
|
<!-- ── Source (repo only) ── -->
|
|
<h6 class="anonymize-section-title" ng-show="detectedType === 'repo'">
|
|
<i class="fas fa-code-branch"></i> Source
|
|
</h6>
|
|
|
|
<div ng-show="detectedType === 'repo'">
|
|
<div class="form-group">
|
|
<label for="branch">Branch</label>
|
|
<div class="input-group mb-1">
|
|
<select class="form-control" id="branch" name="branch" ng-model="source.branch">
|
|
<option ng-repeat="b in branches" ng-bind="b.name" value="{{b.name}}"></option>
|
|
</select>
|
|
<div class="input-group-append">
|
|
<button class="btn btn-outline-secondary" ng-click="getBranches(true)" title="Refresh" data-toggle="tooltip" data-placement="bottom">
|
|
<i class="fa fa-undo"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="commit">Commit</label>
|
|
<input class="form-control" id="commit" name="commit" pattern="[a-fA-Z0-9]{6,}" ng-model="source.commit" required ng-class="{'is-invalid': anonymize.commit.$invalid}" />
|
|
<small class="form-text text-muted">The SHA of the commit to anonymize.</small>
|
|
<div class="invalid-feedback" ng-show="anonymize.commit.$error.pattern || anonymize.commit.$error.required">
|
|
The commit SHA is not valid.
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group" ng-show="detectedType">
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" id="update" name="update" ng-model="options.update" />
|
|
<label class="form-check-label" for="update">Auto update</label>
|
|
<small class="form-text text-muted">Automatically update with the latest changes.</small>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ── Identity ── -->
|
|
<h6 class="anonymize-section-title" ng-show="detectedType">
|
|
<i class="fas fa-fingerprint"></i> Identity
|
|
</h6>
|
|
|
|
<div class="form-group" ng-show="detectedType === 'repo'">
|
|
<label for="repoId">Anonymized repository ID</label>
|
|
<input type="text" class="form-control" name="repoId" id="repoId" ng-class="{'is-invalid': anonymize.repoId.$invalid}" ng-model="repoId" ng-model-options="{ debounce: {default: 1000, blur: 0, click: 0}, updateOn: 'default blur click' }" />
|
|
<small class="form-text text-muted">https://anonymous.4open.science/r/{{repoId}}</small>
|
|
<div class="invalid-feedback" ng-show="anonymize.repoId.$error.format">ID can only contain letters and numbers.</div>
|
|
<div class="invalid-feedback" ng-show="anonymize.repoId.$error.used">{{repoId}} is already used.</div>
|
|
</div>
|
|
|
|
<div class="form-group" ng-show="detectedType === 'pr'">
|
|
<label for="pullRequestId">Anonymized pull request ID</label>
|
|
<input type="text" class="form-control" name="pullRequestId" id="pullRequestId" ng-class="{'is-invalid': anonymize.pullRequestId.$invalid}" ng-model="pullRequestId" ng-model-options="{ debounce: {default: 1000, blur: 0, click: 0}, updateOn: 'default blur click' }" />
|
|
<small class="form-text text-muted">https://anonymous.4open.science/pr/{{pullRequestId}}</small>
|
|
<div class="invalid-feedback" ng-show="anonymize.pullRequestId.$error.format">ID can only contain letters and numbers.</div>
|
|
<div class="invalid-feedback" ng-show="anonymize.pullRequestId.$error.used">{{pullRequestId}} is already used.</div>
|
|
</div>
|
|
|
|
<div class="form-group" ng-show="detectedType">
|
|
<label for="conference">Conference <span class="text-muted">(Optional)</span></label>
|
|
<input class="form-control" id="conference" name="conference" ng-model="conference" ng-class="{'is-invalid': anonymize.conference.$invalid}" />
|
|
<small class="form-text text-muted" ng-show="conference_data">
|
|
<a ng-href="{{conference_data.url}}" target="_blank">{{conference_data.name}}</a> expires {{conference_data.endDate | date}}.
|
|
</small>
|
|
<div class="invalid-feedback" ng-show="anonymize.conference.$error.activated">The conference is not activated.</div>
|
|
<small class="form-text text-muted" ng-show="!conference_data">Links to a conference for automatic settings.</small>
|
|
</div>
|
|
|
|
<!-- ── Anonymization ── -->
|
|
<h6 class="anonymize-section-title" ng-show="detectedType">
|
|
<i class="fas fa-shield-alt"></i> Anonymization
|
|
</h6>
|
|
|
|
<div class="form-group" ng-show="detectedType">
|
|
<label for="terms">Terms to anonymize</label>
|
|
<textarea class="form-control" id="terms" name="terms" rows="3" ng-model="terms" ng-model-options="{ debounce: 250 }" ng-class="{'is-invalid': anonymize.terms.$invalid}"></textarea>
|
|
<small class="form-text text-muted">One term per line (regex). Replaced by {{site_options.ANONYMIZATION_MASK}}-[N].</small>
|
|
<div class="warning-feedback" ng-show="anonymize.terms.$error.regex">Regex characters detected. Escape them if unintentional.</div>
|
|
<div class="invalid-feedback" ng-show="anonymize.terms.$error.format">Terms are in an invalid format.</div>
|
|
</div>
|
|
|
|
<!-- ── Display ── -->
|
|
<h6 class="anonymize-section-title" ng-show="detectedType">
|
|
<i class="fas fa-eye"></i> Display
|
|
</h6>
|
|
|
|
<div ng-show="detectedType">
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" id="link" name="link" ng-model="options.link" />
|
|
<label class="form-check-label" for="link">Keep links</label>
|
|
</div>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" id="image" name="image" ng-model="options.image" />
|
|
<label class="form-check-label" for="image">Display images</label>
|
|
</div>
|
|
|
|
<div ng-show="detectedType === 'repo'">
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" id="pdf" name="pdf" ng-model="options.pdf" />
|
|
<label class="form-check-label" for="pdf">Display PDFs</label>
|
|
</div>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" id="notebook" name="notebook" ng-model="options.notebook" />
|
|
<label class="form-check-label" for="notebook">Display Notebooks</label>
|
|
</div>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" id="page" name="page" ng-model="options.page" ng-disabled="!details.hasPage" />
|
|
<label class="form-check-label" for="page">GitHub Pages</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div ng-show="detectedType === 'pr'">
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" id="title" name="title" ng-model="options.title" />
|
|
<label class="form-check-label" for="title">PR title</label>
|
|
</div>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" id="body" name="body" ng-model="options.body" />
|
|
<label class="form-check-label" for="body">PR body</label>
|
|
</div>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" id="diff" name="diff" ng-model="options.diff" />
|
|
<label class="form-check-label" for="diff">Diff</label>
|
|
</div>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" id="comments" name="comments" ng-model="options.comments" />
|
|
<label class="form-check-label" for="comments">Comments</label>
|
|
</div>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" id="username" name="username" ng-model="options.username" />
|
|
<label class="form-check-label" for="username">Usernames</label>
|
|
</div>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" id="date" name="date" ng-model="options.date" />
|
|
<label class="form-check-label" for="date">Dates</label>
|
|
</div>
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" id="origin" name="origin" ng-model="options.origin" />
|
|
<label class="form-check-label" for="origin">Project name</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- ── Expiration ── -->
|
|
<h6 class="anonymize-section-title" ng-show="detectedType">
|
|
<i class="far fa-clock"></i> Expiration
|
|
</h6>
|
|
|
|
<div class="form-group" ng-show="detectedType">
|
|
<select class="form-control" id="expiration" name="expiration" ng-model="options.expirationMode">
|
|
<option value="never" selected>Never expire</option>
|
|
<option value="redirect">Redirect to GitHub when expired</option>
|
|
<option value="remove">Remove when expired</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group" ng-show="detectedType && options.expirationMode!='never'">
|
|
<label for="expirationDate">Expiration date</label>
|
|
<input class="form-control" type="date" name="expirationDate" id="expirationDate" ng-model="options.expirationDate" />
|
|
<small class="form-text text-muted" ng-show="options.expirationMode=='remove'">After {{options.expirationDate | date}}, the content will be removed.</small>
|
|
<small class="form-text text-muted" ng-show="options.expirationMode=='redirect'">After {{options.expirationDate | date}}, visitors will be redirected to GitHub.</small>
|
|
</div>
|
|
|
|
<div class="alert alert-danger" role="alert" ng-if="error" ng-bind="error"></div>
|
|
|
|
<div class="anonymize-submit-bar" ng-show="detectedType">
|
|
<button type="submit" class="btn btn-primary btn-block" ng-click="anonymizeRepo($event)" ng-if="detectedType === 'repo' && !isUpdate">
|
|
<i class="fas fa-user-secret mr-1"></i> Anonymize Repository
|
|
</button>
|
|
<button type="submit" class="btn btn-primary btn-block" ng-click="anonymizeRepo($event)" ng-if="detectedType === 'repo' && isUpdate">
|
|
<i class="fas fa-save mr-1"></i> Update Repository
|
|
</button>
|
|
<button type="submit" class="btn btn-primary btn-block" ng-click="anonymizePullRequest($event)" ng-if="detectedType === 'pr' && !isUpdate">
|
|
<i class="fas fa-user-secret mr-1"></i> Anonymize Pull Request
|
|
</button>
|
|
<button type="submit" class="btn btn-primary btn-block" ng-click="anonymizePullRequest($event)" ng-if="detectedType === 'pr' && isUpdate">
|
|
<i class="fas fa-save mr-1"></i> Update Pull Request
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|