Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Octicon SVG spritemap #10107

Merged
merged 38 commits into from Feb 11, 2020
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
5bd9a66
Add octicon SVG sprite
jolheiser Feb 2, 2020
e2249e7
Static prefix
jolheiser Feb 2, 2020
7273e68
SVG for all repo icons
jolheiser Feb 2, 2020
215242b
make vendor
jolheiser Feb 2, 2020
d7d6e68
Swap out octicons
jolheiser Feb 4, 2020
43b858a
Move octicons to top of less imports
jolheiser Feb 4, 2020
6b717dc
Fix JS
jolheiser Feb 5, 2020
85f29d1
Definitely not a search/replace
jolheiser Feb 5, 2020
e690697
Missed regex
jolheiser Feb 5, 2020
084df84
Move to more generic calls and webpack
jolheiser Feb 6, 2020
ee8a100
Merge branch 'master' of github.com:go-gitea/gitea into octicon
jolheiser Feb 6, 2020
5016230
make svg -> make webpack
jolheiser Feb 6, 2020
db1745e
Remove svg-sprite
jolheiser Feb 6, 2020
f61b1a5
Update tests
jolheiser Feb 6, 2020
8144af2
Missed a test
jolheiser Feb 6, 2020
21b92a6
Remove svg from makefile
jolheiser Feb 6, 2020
d4489e8
Suggestions
jolheiser Feb 6, 2020
61e5659
Attempt to fix test
jolheiser Feb 6, 2020
cd6e7b3
Update tests
jolheiser Feb 6, 2020
957b098
Revert timetracking test
jolheiser Feb 6, 2020
10db7dc
Merge branch 'master' into octicon
jolheiser Feb 6, 2020
74f9370
Swap .octicon for .svg in less
jolheiser Feb 6, 2020
7a56b18
Add aria-hidden
jolheiser Feb 6, 2020
cc05fd0
Replace mega-octicon
jolheiser Feb 6, 2020
495df17
Fix webpack globbing on Windows
jolheiser Feb 6, 2020
0df9b40
Revert
jolheiser Feb 6, 2020
8c319f2
Fix octions from upstream
jolheiser Feb 6, 2020
89eb82c
Merge branch 'master' of https://github.com/go-gitea/gitea into octicon
jolheiser Feb 6, 2020
6a37ddc
Merge branch 'octicon' of https://github.com/jolheiser/gitea into oct…
jolheiser Feb 6, 2020
bcf1ef8
Fix Vue and missed JS function
jolheiser Feb 6, 2020
8701f87
Add JS helper and PWA
jolheiser Feb 7, 2020
4fa203e
Preload SVG
jolheiser Feb 7, 2020
f184f24
Merge branch 'master' into octicon
jolheiser Feb 7, 2020
5e5ae63
Merge branch 'master' into octicon
jolheiser Feb 7, 2020
73f4eb9
Merge branch 'master' into octicon
jolheiser Feb 8, 2020
472a8bb
Merge branch 'master' of https://github.com/go-gitea/gitea into octicon
jolheiser Feb 11, 2020
41a8a20
Merge branch 'octicon' of https://github.com/jolheiser/gitea into oct…
jolheiser Feb 11, 2020
ec424cb
Merge branch 'master' into octicon
techknowlogick Feb 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions Makefile
Expand Up @@ -505,6 +505,10 @@ css:
@echo "'make css' is deprecated, please use 'make webpack'"
$(MAKE) webpack

.PHONY: svg
svg:
npx svg-sprite --symbol --symbol-dest=public/img/svg --symbol-sprite=octicons.svg node_modules/@primer/octicons/build/svg/*.svg

jolheiser marked this conversation as resolved.
Show resolved Hide resolved
.PHONY: fomantic
fomantic: node-check $(FOMANTIC_EVIDENCE)

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -97,7 +97,7 @@ require (
github.com/yuin/goldmark v1.1.19
go.etcd.io/bbolt v1.3.3 // indirect
golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876
golang.org/x/net v0.0.0-20191101175033-0deb6923b6d9
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
golang.org/x/sys v0.0.0-20191127021746-63cb32ae39b2
golang.org/x/text v0.3.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Expand Up @@ -616,8 +616,8 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191101175033-0deb6923b6d9 h1:DPz9iiH3YoKiKhX/ijjoZvT0VFwK2c6CWYWQ7Zyr8TU=
golang.org/x/net v0.0.0-20191101175033-0deb6923b6d9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa h1:F+8P+gmewFQYRk6JoLQLwjBCTu3mcIURZfNkVweuRKA=
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/oauth2 v0.0.0-20180620175406-ef147856a6dd/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down
2 changes: 1 addition & 1 deletion modules/base/tool.go
Expand Up @@ -414,7 +414,7 @@ func EntryIcon(entry *git.TreeEntry) string {
return "file-submodule"
}

return "file-text"
return "file"
}

// SetupGiteaRoot Sets GITEA_ROOT if it is not already set and returns the value
Expand Down
7 changes: 7 additions & 0 deletions modules/templates/helper.go
Expand Up @@ -285,6 +285,13 @@ func NewFuncMap() []template.FuncMap {
}
return false
},
"octicon": func(mega bool, icon string) template.HTML {
jolheiser marked this conversation as resolved.
Show resolved Hide resolved
size := ""
if mega {
size = "mega-"
}
return template.HTML(fmt.Sprintf(`<svg class="%socticon"><use xlink:href="%s/img/svg/octicons.svg#%s" /></svg>`, size, setting.StaticURLPrefix, icon))
},
}}
}

Expand Down