dmitri.shuralyov.com/app/changes

Update for octicon package rename.

Follows https://github.com/shurcooL/octicon/commit/c42b0e3b24d96976ecac81ef691662777b39ef64.
dmitshur committed 6 years ago commit 0a106ad413e3d333da336ce3a90970dc87151beb
Showing partial commit. Full Commit
Collapse all
main.go
@@ -26,11 +26,11 @@ import (
	"github.com/shurcooL/htmlg"
	"github.com/shurcooL/httperror"
	"github.com/shurcooL/httpfs/html/vfstemplate"
	"github.com/shurcooL/httpgzip"
	"github.com/shurcooL/notifications"
	"github.com/shurcooL/octiconssvg"
	"github.com/shurcooL/octicon"
	"github.com/shurcooL/reactions"
	reactionscomponent "github.com/shurcooL/reactions/component"
	"github.com/shurcooL/users"
	"golang.org/x/net/html"
	"sourcegraph.com/sourcegraph/go-diff/diff"
@@ -557,27 +557,27 @@ type state struct {
	Timeline []timelineItem
}

// Tabnav renders the tabnav.
func (s state) Tabnav(selected string) template.HTML {
	var files htmlg.Component = iconText{Icon: octiconssvg.Diff, Text: "Files"}
	var files htmlg.Component = iconText{Icon: octicon.Diff, Text: "Files"}
	if s.Change.ChangedFiles != 0 {
		files = contentCounter{Content: files, Count: s.Change.ChangedFiles}
	}
	return template.HTML(htmlg.RenderComponentsString(tabnav{
		Tabs: []tab{
			{
				Content: contentCounter{
					Content: iconText{Icon: octiconssvg.CommentDiscussion, Text: "Discussion"},
					Content: iconText{Icon: octicon.CommentDiscussion, Text: "Discussion"},
					Count:   s.Change.Replies,
				},
				URL:      fmt.Sprintf("%s/%d", s.BaseURI, s.ChangeID),
				Selected: selected == "Discussion",
			},
			{
				Content: contentCounter{
					Content: iconText{Icon: octiconssvg.GitCommit, Text: "Commits"},
					Content: iconText{Icon: octicon.GitCommit, Text: "Commits"},
					Count:   s.Change.Commits,
				},
				URL:      fmt.Sprintf("%s/%d/commits", s.BaseURI, s.ChangeID),
				Selected: selected == "Commits",
			},
@@ -622,11 +622,11 @@ func loadTemplates(state common.State, bodyPre string) (*template.Template, erro
			}
		},
		"state": func() common.State { return state },

		"octicon": func(name string) (template.HTML, error) {
			icon := octiconssvg.Icon(name)
			icon := octicon.Icon(name)
			if icon == nil {
				return "", fmt.Errorf("%q is not a valid Octicon symbol name", name)
			}
			var buf bytes.Buffer
			err := html.Render(&buf, icon)