patx/gitman

update ux for pages repos (user.gitman.io) rev8

Commit 3202460 · patx · 2026-05-06T00:27:29-04:00

Changeset
32024607f42ee397fbbce09df52990c3352029b1
Parents
3acae286aa1b0953c772a8fb01b57b1fb5fbd338

View source at this commit

Comments

No comments yet.

Log in to comment

Diff

diff --git a/templates/repo_settings.tpl b/templates/repo_settings.tpl
index f03d158..3fa10f0 100644
--- a/templates/repo_settings.tpl
+++ b/templates/repo_settings.tpl
@@ -49,24 +49,26 @@
       <p class="alert">{{pages_settings["cname_error"]}}</p>
     % elif pages_settings["cname_domain"]:
       % custom_domain = pages_settings["custom_domain"]
-      <p>
-        <strong class="muted">Custom Domain:</strong>
-        {{pages_settings["cname_domain"]}}
-        % if custom_domain and custom_domain["status"]:
-          <small class="muted">{{custom_domain["status"]}}</small>
-        % end
-        % if custom_domain and custom_domain["verified_at"]:
-          <small class="notice">@{{custom_domain["verified_at"]}}.</small>
-        % end
-      </p>
-      <p class="muted">Create this DNS TXT record before verifying:</p>
-      <pre>{{pages_settings["txt_name"]}}
-{{pages_settings["txt_value"]}}</pre>
-      <form method="post">
+      <form class="panel-heading" method="post">
         {{!csrf_field()}}
         <input type="hidden" name="action" value="verify_custom_domain">
-        <button class="button" type="submit">Verify DNS</button>
+        <div>
+          <p>
+            <strong class="muted">Custom Domain:</strong>
+            {{pages_settings["cname_domain"]}}
+            % if custom_domain and custom_domain["status"]:
+              <small class="muted">{{custom_domain["status"]}}</small>
+            % end
+            % if custom_domain and custom_domain["verified_at"]:
+              <small class="notice">@{{custom_domain["verified_at"]}}.</small>
+            % end
+          </p>
+        </div>
+        <button class="button" type="submit">{{"Reverify DNS" if custom_domain and custom_domain["verified_at"] else "Verify DNS"}}</button>
       </form>
+      <p class="muted">Create this DNS TXT record before verifying:</p>
+      <pre>{{pages_settings["txt_name"]}}
+{{pages_settings["txt_value"]}}</pre>
     % else:
       <p class="muted"><strong>Custom Domain:</strong> Add a root CNAME file to this repository to configure a custom domain.</p>
     % end
diff --git a/tests/test_app.py b/tests/test_app.py
index 322a998..c6d449f 100644
--- a/tests/test_app.py
+++ b/tests/test_app.py
@@ -829,6 +829,8 @@ def test_custom_pages_domain_requires_dns_txt_verification_and_current_cname(iso
     settings_response = alice_client.get("/alice/alice.gitman.io/settings")
     assert settings_response.status_code == 200
     assert "_gitman-pages.www.example.com" in settings_response.text
+    assert "Verify DNS" in settings_response.text
+    assert "Reverify DNS" not in settings_response.text
 
     custom_domain = isolated_app.get_custom_domain_for_user(owner["id"], "www.example.com")
     expected_txt = isolated_app.custom_domain_txt_value(custom_domain["verification_token"])
@@ -841,12 +843,14 @@ def test_custom_pages_domain_requires_dns_txt_verification_and_current_cname(iso
     response = alice_client.post("/alice/alice.gitman.io/settings", {"action": "verify_custom_domain"})
     assert response.status_code == 200
     assert "TXT verification record was not found" in response.text
+    assert "Verify DNS" in response.text
     assert isolated_app.get_custom_domain_for_user(owner["id"], "www.example.com")["verified_at"] is None
 
     monkeypatch.setattr(isolated_app, "resolve_dns_txt", lambda record_name: [expected_txt])
     response = alice_client.post("/alice/alice.gitman.io/settings", {"action": "verify_custom_domain"})
     assert response.status_code == 200
     assert "Custom domain verified." in response.text
+    assert "Reverify DNS" in response.text
     assert isolated_app.get_custom_domain_for_user(owner["id"], "www.example.com")["verified_at"]
 
     response = alice_client.get("/", headers={"Host": "www.example.com"})