Commit 205691a7a9
Verified · cmc
Layout: unified · split
internal/httpd/web.go +1 −11
| @@ -8,7 +8,6 @@ import ( | |||
| 8 | "fmt" | 8 | "fmt" |
| 9 | "hash/fnv" | 9 | "hash/fnv" |
| 10 | "io" | 10 | "io" |
| 11 | "io/fs" | ||
| 12 | "log" | 11 | "log" |
| 13 | "math" | 12 | "math" |
| 14 | "os" | 13 | "os" |
| @@ -177,21 +176,12 @@ func (s *Server) index(w http.ResponseWriter, r *http.Request) { | |||
| 177 | Host string | 176 | Host string |
| 178 | Accounts bool | 177 | Accounts bool |
| 179 | Signup bool | 178 | Signup bool |
| 180 | Picture bool | ||
| 181 | EmailLogin bool | 179 | EmailLogin bool |
| 182 | }{basePage{Site: s.siteName(), Host: s.cfg.SiteHost()}, host, s.cfg.Web.Mode == "accounts", | 180 | }{basePage{Site: s.siteName(), Host: s.cfg.SiteHost()}, host, s.cfg.Web.Mode == "accounts", |
| 183 | s.cfg.Web.Mode == "accounts" && s.cfg.Registration.Mode != "closed", | 181 | s.cfg.Web.Mode == "accounts" && s.cfg.Registration.Mode != "closed", |
| 184 | landingPicture, s.emailLoginEnabled()}) | 182 | s.emailLoginEnabled()}) |
| 185 | } | 183 | } |
| 186 | 184 | ||
| 187 | // landingPicture says whether the landing page's screenshot images exist to | ||
| 188 | // show, checked once against the embedded images. | ||
| 189 | var landingPicture = func() bool { | ||
| 190 | _, e1 := fs.Stat(web.ImageFS, "static/img/mr-dark.png") | ||
| 191 | _, e2 := fs.Stat(web.ImageFS, "static/img/mr-light.png") | ||
| 192 | return e1 == nil && e2 == nil | ||
| 193 | }() | ||
| 194 | |||
| 195 | func (s *Server) dashboard(w http.ResponseWriter, r *http.Request, viewer store.User) { | 185 | func (s *Server) dashboard(w http.ResponseWriter, r *http.Request, viewer store.User) { |
| 196 | mrs, _ := s.st.DashboardMRs(viewer.ID) | 186 | mrs, _ := s.st.DashboardMRs(viewer.ID) |
| 197 | issues, _ := s.st.DashboardIssues(viewer.ID) | 187 | issues, _ := s.st.DashboardIssues(viewer.ID) |
internal/web/templates/landing.html +2 −2
| @@ -6,10 +6,10 @@ | |||
| 6 | <p class="lede">A git forge you drive from the terminal. Repositories, issues, merge requests and CI over SSH, with a fast, readable web view of the same state.</p> | 6 | <p class="lede">A git forge you drive from the terminal. Repositories, issues, merge requests and CI over SSH, with a fast, readable web view of the same state.</p> |
| 7 | <pre class="quickstart">ssh git@{{.Host}} help # every command, no client to install | 7 | <pre class="quickstart">ssh git@{{.Host}} help # every command, no client to install |
| 8 | git clone ssh://git@{{.Host}}/owner/repo.git</pre> | 8 | git clone ssh://git@{{.Host}}/owner/repo.git</pre> |
| 9 | {{if .Picture}}<div class="shot"><picture> | 9 | <div class="shot"><picture> |
| 10 | <source srcset="/static/img/mr-dark.png" media="(prefers-color-scheme: dark)"> | 10 | <source srcset="/static/img/mr-dark.png" media="(prefers-color-scheme: dark)"> |
| 11 | <img src="/static/img/mr-light.png" width="1280" height="900" alt="A merge request page: the conversation on the left, checks and reviewers on the right."> | 11 | <img src="/static/img/mr-light.png" width="1280" height="900" alt="A merge request page: the conversation on the left, checks and reviewers on the right."> |
| 12 | </picture></div>{{end}} | 12 | </picture></div> |
| 13 | <div class="facets"> | 13 | <div class="facets"> |
| 14 | <section><h2>Read</h2><p>Browse and clone any public repository over HTTPS or <code>git://</code>, no account. Every commit shows whether its signature verified.</p></section> | 14 | <section><h2>Read</h2><p>Browse and clone any public repository over HTTPS or <code>git://</code>, no account. Every commit shows whether its signature verified.</p></section> |
| 15 | <section><h2>Write</h2><p>Push over SSH with the key you already have. Create a repository, file an issue, open and merge a request, all as commands.</p></section> | 15 | <section><h2>Write</h2><p>Push over SSH with the key you already have. Create a repository, file an issue, open and merge a request, all as commands.</p></section> |