From 62f91c5ed27042e250b8956b0863b8626fb87b7b Mon Sep 17 00:00:00 2001 From: Thomas Miceli <27960254+thomiceli@users.noreply.github.com> Date: Sat, 27 May 2023 20:20:20 +0200 Subject: [PATCH] Small fixes (#42) * UI color fixes * Typos * Fancy badge in README --- README.md | 1 + internal/web/gist.go | 2 +- internal/web/git_http.go | 5 ++--- templates/base/base_header.html | 2 +- templates/pages/auth_form.html | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index dac42fe..db1b02b 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/thomiceli/opengist?sort=semver) ![License](https://img.shields.io/github/license/thomiceli/opengist?color=blue) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/thomiceli/opengist/go.yml) +[![Go Report Card](https://goreportcard.com/badge/github.com/thomiceli/opengist)](https://goreportcard.com/report/github.com/thomiceli/opengist) A self-hosted pastebin **powered by Git**. [Try it here](https://opengist.thomice.li). diff --git a/internal/web/gist.go b/internal/web/gist.go index 9778f31..de3e845 100644 --- a/internal/web/gist.go +++ b/internal/web/gist.go @@ -318,7 +318,7 @@ func processCreate(ctx echo.Context) error { } if err = gist.AddAndCommitFiles(&dto.Files); err != nil { - return errorRes(500, "Error adding and commiting files", err) + return errorRes(500, "Error adding and committing files", err) } if isCreate { diff --git a/internal/web/git_http.go b/internal/web/git_http.go index 38902ac..54e0649 100644 --- a/internal/web/git_http.go +++ b/internal/web/git_http.go @@ -151,10 +151,9 @@ func infoRefs(ctx echo.Context) error { gist := getData(ctx, "gist").(*models.Gist) serviceType := ctx.QueryParam("service") - if !strings.HasPrefix(serviceType, "git-") { - service = "" + if strings.HasPrefix(serviceType, "git-") { + service = strings.TrimPrefix(serviceType, "git-") } - service = strings.TrimPrefix(serviceType, "git-") if service != "upload-pack" && service != "receive-pack" { if err := gist.UpdateServerInfo(); err != nil { diff --git a/templates/base/base_header.html b/templates/base/base_header.html index 9aed20a..b0a67dc 100644 --- a/templates/base/base_header.html +++ b/templates/base/base_header.html @@ -77,7 +77,7 @@ {{ end }} -