Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/treetrek.git

Adds clone button

Author Dave Jarvis <email>
Date 2026-02-18 23:20:15 GMT-0800
Commit 059b2e59666c6482c8c6c97dc4321705b1392a34
Parent a922e28
pages/BasePage.php
?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title><?php echo $siteTitle . $pageTitle; ?></title>
- <link rel="stylesheet"
- href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css">
- <link rel="stylesheet" href="/styles/repo.css">
- </head>
- <body>
- <div class="container">
- <header>
- <h1><?php echo Config::SITE_TITLE; ?></h1>
- <nav class="nav">
- <a href="<?php echo (new UrlBuilder())->build(); ?>">Home</a>
- <?php if( $currentRepo ): ?>
- <?php $safeName = $currentRepo['safe_name']; ?>
- <a href="<?php echo (new UrlBuilder())
- ->withRepo( $safeName )
- ->withAction( 'tree' )
- ->build(); ?>">Files</a>
- <a href="<?php echo (new UrlBuilder())
- ->withRepo( $safeName )
- ->withAction( 'commits' )
- ->build(); ?>">Commits</a>
- <a href="<?php echo (new UrlBuilder())
- ->withRepo( $safeName )
- ->withAction( 'tags' )
- ->build(); ?>">Tags</a>
- <?php endif; ?>
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title><?php echo $siteTitle . $pageTitle; ?></title>
+ <link rel="stylesheet"
+ href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css">
+ <link rel="stylesheet" href="/styles/repo.css">
+</head>
+<body>
+<div class="container">
+ <header>
+ <h1><?php echo Config::SITE_TITLE; ?></h1>
+ <nav class="nav">
+ <a href="<?php echo (new UrlBuilder())->build(); ?>">Home</a>
+ <?php if( $currentRepo ) { ?>
+ <?php $safeName = $currentRepo['safe_name']; ?>
+ <a href="<?php echo (new UrlBuilder())
+ ->withRepo( $safeName )
+ ->withAction( 'tree' )
+ ->build(); ?>">Files</a>
+ <a href="<?php echo (new UrlBuilder())
+ ->withRepo( $safeName )
+ ->withAction( 'commits' )
+ ->build(); ?>">Commits</a>
+ <a href="<?php echo (new UrlBuilder())
+ ->withRepo( $safeName )
+ ->withAction( 'tags' )
+ ->build(); ?>">Tags</a>
- <?php if( $currentRepo ): ?>
- <div class="repo-selector">
- <label>Repository:</label>
- <select onchange="<?php echo (new UrlBuilder())
- ->withSwitcher( 'this.value' )
- ->build(); ?>">
- <?php foreach( $this->repositories as $r ): ?>
- <option
- value="<?php echo htmlspecialchars( $r['safe_name'] ); ?>"
- <?php
- echo $r['safe_name'] === $currentRepo['safe_name']
- ? 'selected'
- : '';
- ?>>
- <?php echo htmlspecialchars( $r['name'] ); ?>
- </option>
- <?php endforeach; ?>
- </select>
- </div>
- <?php endif; ?>
- </nav>
- </header>
+ <input type="checkbox" id="clone-toggle" class="clone-checkbox">
+ <label for="clone-toggle" class="clone-link">Clone</label>
+ <?php } ?>
- <?php call_user_func( $contentCallback ); ?>
+ <?php if( $currentRepo ) { ?>
+ <div class="repo-selector">
+ <label>Repository:</label>
+ <select onchange="<?php echo (new UrlBuilder())
+ ->withSwitcher( 'this.value' )
+ ->build(); ?>">
+ <?php foreach( $this->repositories as $r ) { ?>
+ <option
+ value="<?php echo htmlspecialchars( $r['safe_name'] ); ?>"
+ <?php
+ echo $r['safe_name'] === $currentRepo['safe_name']
+ ? 'selected'
+ : '';
+ ?>>
+ <?php echo htmlspecialchars( $r['name'] ); ?>
+ </option>
+ <?php } ?>
+ </select>
+ </div>
+ <?php } ?>
+ </nav>
- </div>
- </body>
- </html>
+ <?php if( $currentRepo ) { ?>
+ <div class="clone-region">
+ <input type="text" class="clone-input" readonly
+ value="<?php
+ echo htmlspecialchars(
+ 'https://' . $_SERVER['HTTP_HOST'] . '/repo/' .
+ $currentRepo['safe_name'] . '.git'
+ );
+ ?>">
+ </div>
+ <?php } ?>
+ </header>
+
+ <?php call_user_func( $contentCallback ); ?>
+
+</div>
+</body>
+</html>
<?php
}
styles/repo.css
}
+.clone-checkbox {
+ display: none;
+}
+
+.clone-link {
+ cursor: pointer;
+ color: #58a6ff;
+ text-decoration: none;
+}
+
+.clone-link:hover {
+ text-decoration: underline;
+}
+
+.clone-region {
+ display: none;
+ margin-top: 1rem;
+ padding: 0.75rem;
+ background-color: #161b22;
+ border: 1px solid #30363d;
+ border-radius: 6px;
+}
+
+.clone-checkbox:checked ~ .clone-region {
+ display: block;
+}
+
+.clone-input {
+ width: 100%;
+ padding: 5px;
+ background: #0d1117;
+ color: #c9d1d9;
+ border: 1px solid #30363d;
+ border-radius: 4px;
+ font-family: monospace;
+}
+
Delta 109 lines added, 57 lines removed, 52-line increase