~bigbes/sr-ht-spec

bb3d22db80100b831492f6806f09f8bad3e141be — Eugene Blikh 11 days ago faa9163
web: git.sr.ht-style dashboard and unified nav brand

Adopt the family look the dolt service already has. The nav brand
becomes circle icon + site name + red service label (dropping the
hub-origin variant), matching every other service on the instance. The
logged-in index turns into the two-column dashboard: a sidebar with the
service blurb, review-queue/agent-tokens block buttons and the search
form, and the spaces as shared-theme event-list cards. The big in-page
h2 lives on only for anonymous visitors, where the nav has no user
context yet.
2 files changed, 20 insertions(+), 28 deletions(-)

M web/templates/index.html
M web/templates/layout.html
M web/templates/index.html => web/templates/index.html +19 -22
@@ 1,42 1,33 @@
{{define "content"}}
{{if .Data.LoggedIn}}
<div class="row">
  <div class="col-md-12">
    <h2>{{.SiteName}} <span class="text-danger">spec</span></h2>
  <div class="col-md-4">
    <p>
      Reviewable document storage: agents propose, you curate, agents read back
      the approved text. Reads default to the approved revision; add
      <code>?rev=&lt;sha&gt;</code> to pin any page to an immutable one.
    </p>
  </div>
</div>

{{if .Data.LoggedIn}}
<div class="row">
  <div class="col-md-12">
    <p>
      <a href="/inbox">Review queue</a> &mdash; proposals waiting on you.
      <a href="/tokens" class="ml-2">Agent tokens</a> &mdash; credentials for the write plane.
    </p>
    <form method="GET" action="/search" class="form-inline">
    <a href="/inbox" class="btn btn-primary btn-block">Review queue</a>
    <a href="/tokens" class="btn btn-default btn-block">Agent tokens</a>
    <form method="GET" action="/search" class="mt-3">
      <div class="form-group">
        <label class="sr-only" for="q">Query</label>
        <input class="form-control" type="text" id="q" name="q"
               placeholder="search every space" autocomplete="off">
      </div>
      <button class="btn btn-primary" type="submit">Search</button>
      <button class="btn btn-primary btn-block" type="submit">Search</button>
    </form>
  </div>
</div>

<div class="row">
  <div class="col-md-12">
    <h3>Your spaces</h3>
  <div class="col-md-8">
    <hr class="d-md-none" />
    {{if .Data.Spaces}}
    <ul class="list-unstyled">
    <div class="event-list">
      {{range .Data.Spaces}}
      <li><a href="{{.Href}}"><strong>{{.Ref}}</strong></a></li>
      <div class="event">
        <h4><a href="{{.Href}}">{{.Ref}}</a></h4>
      </div>
      {{end}}
    </ul>
    </div>
    {{else}}
    <p class="text-muted">
      No spaces yet. A space is a bare git repository owned by this service;


@@ 48,6 39,12 @@
{{else}}
<div class="row">
  <div class="col-md-12">
    <h2>{{.SiteName}} <span class="text-danger">spec</span></h2>
    <p>
      Reviewable document storage: agents propose, you curate, agents read back
      the approved text. Reads default to the approved revision; add
      <code>?rev=&lt;sha&gt;</code> to pin any page to an immutable one.
    </p>
    <p>
      <a href="{{.LoginURL}}" rel="nofollow">Log in</a> to browse the spaces on
      this instance. Agents authenticate with a bearer token instead.

M web/templates/layout.html => web/templates/layout.html +1 -6
@@ 15,18 15,13 @@
    </div>
    {{end}}
    <nav class="container navbar navbar-light navbar-expand-sm">
      {{if .HubOrigin}}
      <span class="navbar-brand">
        <a href="{{.HubOrigin}}">{{.SiteName}}</a>
      </span>
      {{else}}
      <span class="navbar-brand">
        <span class="icon icon-circle" aria-hidden="true"><svg width="22" height="22" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z"/></svg></span>
        <a class="navbar-brand" href="/">
          {{.SiteName}}
          <span class="text-danger">spec</span>
        </a>
      </span>
      {{end}}
      <ul class="navbar-nav">
        {{if .Username}}
        {{range .Nav}}