dmitri.shuralyov.com/app/changes/component

Improve style of MergedEvent, DeletedEvent.

This helps readability, and doesn't make the page appear too wide on
narrow mobile displays.

Helps https://dmitri.shuralyov.com/app/changes/...$issues/1.
dmitshur committed 6 years ago commit 4277748913c2949855566d7d36f838ac4e7cceab
Showing partial commit. Full Commit
Collapse all
component/component.go
@@ -3,10 +3,11 @@ package component

import (
	"fmt"
	"time"

	"dmitri.shuralyov.com/html/belt"
	"dmitri.shuralyov.com/service/change"
	"github.com/dustin/go-humanize"
	"github.com/shurcooL/htmlg"
	issuescomponent "github.com/shurcooL/issuesapp/component"
	"github.com/shurcooL/octiconssvg"
@@ -128,20 +129,23 @@ func (e Event) text() []*html.Node {
		ns = append(ns, User{p.RequestedReviewer}.Render()...)
		return ns
	case change.MergedEvent:
		var ns []*html.Node
		ns = append(ns, htmlg.Text("merged commit "))
		ns = append(ns, htmlg.Strong(p.CommitID)) // TODO: Code{}, use CommitHTMLURL.
		ns = append(ns, belt.CommitID{
			SHA:     p.CommitID,
			HTMLURL: p.CommitHTMLURL,
		}.Render()...)
		ns = append(ns, htmlg.Text(" into "))
		ns = append(ns, htmlg.Strong(p.RefName)) // TODO: Code{}.
		ns = append(ns, belt.Reference{Name: p.RefName}.Render()...)
		return ns
	case change.DeletedEvent:
		switch p.Type {
		case "branch":
			var ns []*html.Node
			ns = append(ns, htmlg.Text("deleted the "))
			ns = append(ns, htmlg.Strong(p.Name)) // TODO: Code{}.
			ns = append(ns, belt.Reference{Name: p.Name}.Render()...)
			ns = append(ns, htmlg.Text(" branch"))
			return ns
		case "comment":
			return []*html.Node{htmlg.Text("deleted a comment")}
		default: