patx/gitman

Match repository settings to the account settings card layout

Commit 61a7b3b · patx · Nov 3 at 10:10PM

Changeset
61a7b3b35c09d43d7d457243011e1c9f297023e4
Parents
b25eeb22c7315d89e78e035079081e6684a5a604

View source at this commit

Comments

No comments yet.

Log in to comment

Diff

diff --git a/static/styles.css b/static/styles.css
index b180b7f..f99d4c7 100644
--- a/static/styles.css
+++ b/static/styles.css
@@ -74,8 +74,8 @@ h1, h2, h3, h4 {
   color: var(--ink);
   font-weight: 700;
 }
-h1 { font-size: clamp(2rem, 6vw, 2.5rem); line-height: 1.2; }
-h2 { font-size: 1.25rem; line-height: 1.4; }
+h1, .settings-heading { font-size: clamp(2rem, 6vw, 2.5rem); line-height: 1.2; }
+h2, .settings-card > h3 { font-size: 1.25rem; line-height: 1.4; }
 h3 { font-size: 1.05rem; line-height: 1.4; }
 
 p, ul, ol, dl { margin: 0 0 .75rem; }
@@ -516,13 +516,13 @@ th { color: var(--ink); font-weight: 700; }
 
 .alert { margin-bottom: 1rem; color: var(--ink); font-weight: 700; }
 .notice { margin-bottom: 1rem; color: var(--text); }
-.danger-zone { margin-top: 1rem; padding-top: 2rem; border-top: 1px solid var(--surface-border); }
-.danger-zone h2 { margin-top: 0; }
 
 .settings-page { max-width: 42rem; }
 .settings-cards { display: grid; gap: 1.5rem; margin-top: 1.5rem; }
 .settings-card > :last-child { margin-bottom: 0; }
-.settings-card > form { margin-top: 1.25rem; }
+.settings-card > form { margin-block: 1.25rem; }
+.settings-card > form > div > :last-child { margin-bottom: 0; }
+.contributor-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; }
 .settings-back { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; margin-top: 1.5rem; }
 
 .mention-menu {
diff --git a/templates/base.tpl b/templates/base.tpl
index f0fce47..8b98d50 100644
--- a/templates/base.tpl
+++ b/templates/base.tpl
@@ -20,7 +20,7 @@
   % if theme != 'light':
     <link rel="stylesheet" href="/static/vendor/highlight.js/github-dark.min.css"{{!' media="(prefers-color-scheme: dark)"' if theme == 'auto' else ''}}>
   % end
-  <link rel="stylesheet" href="/static/styles.css?v=16">
+  <link rel="stylesheet" href="/static/styles.css?v=17">
 </head>
 <body>
   <header class="site-header">
diff --git a/templates/repo_settings.tpl b/templates/repo_settings.tpl
index a20c200..a5cbd6c 100644
--- a/templates/repo_settings.tpl
+++ b/templates/repo_settings.tpl
@@ -10,8 +10,11 @@
   </div>
 </section>
 
-<section class="panel">
-  <h2>Description</h2>
+<section class="settings-page">
+  <h2 class="settings-heading">Repository settings</h2>
+  <div class="settings-cards">
+<section class="settings-card" aria-labelledby="repo-description-title">
+  <h3 id="repo-description-title">Description</h3>
   <form method="post">
     {{!csrf_field()}}
     <input type="hidden" name="action" value="save">
@@ -24,8 +27,8 @@
 </section>
 
 % if commit_count == 0 or import_bundle_finalizing:
-<section class="panel">
-  <h2>Import Git bundle</h2>
+<section class="settings-card" aria-labelledby="repo-import-title">
+  <h3 id="repo-import-title">Import Git bundle</h3>
     <p class="muted">Create a bundle from the source repository using 
         <strong>git bundle create repo.bundle --all</strong>, 
         then upload it here.
@@ -37,6 +40,7 @@
     {{!csrf_field()}}
     <input type="hidden" name="action" value="import_bundle">
     <label>
+      Git bundle
       <input name="bundle" type="file" accept=".bundle,application/octet-stream" data-import-bundle-file required>
     </label>
     <p class="muted" data-import-bundle-status hidden></p>
@@ -46,11 +50,11 @@
 </section>
 % end
 
-<section class="panel">
-  <h2>Pages</h2>
+<section class="settings-card" aria-labelledby="repo-pages-title">
+  <h3 id="repo-pages-title">Pages</h3>
   % if pages_settings["docs_publishable"]:
     <p class="muted"><strong>Pages URL:</strong> <a href="{{pages_settings['url']}}">{{pages_settings["url"]}}</a></p>
-    <form class="panel-heading" method="post">
+    <form method="post">
       {{!csrf_field()}}
       <input type="hidden" name="action" value="update_pages">
       <input type="hidden" name="pages_docs_enabled" value="{{0 if pages_settings['docs_enabled'] else 1}}">
@@ -74,7 +78,7 @@
     <p class="alert">{{pages_settings["cname_error"]}}</p>
   % elif pages_settings["cname_domain"]:
     % custom_domain = pages_settings["custom_domain"]
-    <form class="panel-heading" method="post">
+    <form method="post">
       {{!csrf_field()}}
       <input type="hidden" name="action" value="verify_custom_domain">
       <div>
@@ -103,12 +107,12 @@
   % end
 </section>
 
-<section class="panel">
-  <h2>Contributors</h2>
+<section class="settings-card" aria-labelledby="repo-contributors-title">
+  <h3 id="repo-contributors-title">Contributors</h3>
   % if contributors:
     <ul class="clean-list">
       % for contributor in contributors:
-        <li class="panel-heading">
+        <li class="contributor-row">
           <span><a href="/{{contributor['username']}}">{{contributor["username"]}}</a> <span class="muted">added {{contributor["contributor_since"]}}</span></span>
           <form class="inline-form" method="post">
             {{!csrf_field()}}
@@ -133,8 +137,8 @@
   </form>
 </section>
 
-<section class="panel danger-zone">
-  <h2>Delete repository</h2>
+<section class="settings-card" aria-labelledby="repo-delete-title">
+  <h3 id="repo-delete-title">Delete repository</h3>
   <p>This permanently deletes the repository, its issues, pull requests, and Git data.</p>
   <form method="post">
     {{!csrf_field()}}
@@ -145,4 +149,9 @@
     </label>
     <button class="button danger" type="submit">Delete repository</button>
   </form>
+</section>
+  </div>
+  <nav class="settings-back" aria-label="Repository actions">
+    <a href="/{{repo['owner_username']}}/{{repo['name']}}">Back to repository</a>
+  </nav>
 </section>