diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-08-28 22:14:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-28 22:14:51 +0800 |
commit | 4803766f7a5d1ca86a1e62949dcd9a9ff8d0f64c (patch) | |
tree | 777d8a03c5933b99519a2f5afaef86e245892b6c /templates/repo | |
parent | a587d2526163153a4d992527fe6040d578beaa83 (diff) | |
download | gitea-4803766f7a5d1ca86a1e62949dcd9a9ff8d0f64c.tar.gz gitea-4803766f7a5d1ca86a1e62949dcd9a9ff8d0f64c.zip |
Refactor some CSS styles and simplify code (#26771)
Refactor some CSS styles and simplify code.
Some styles are not in use, remove them.
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/branch/list.tmpl | 6 | ||||
-rw-r--r-- | templates/repo/icon.tmpl | 30 | ||||
-rw-r--r-- | templates/repo/issue/label_precolors.tmpl | 38 | ||||
-rw-r--r-- | templates/repo/issue/labels/edit_delete_label.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/issue/labels/label_new.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/search.tmpl | 4 |
6 files changed, 43 insertions, 43 deletions
diff --git a/templates/repo/branch/list.tmpl b/templates/repo/branch/list.tmpl index bd045995b2..d2535e1e30 100644 --- a/templates/repo/branch/list.tmpl +++ b/templates/repo/branch/list.tmpl @@ -132,11 +132,11 @@ {{else}} <a href="{{.LatestPullRequest.Issue.Link}}" class="gt-vm ref-issue">{{if not .LatestPullRequest.IsSameRepo}}{{.LatestPullRequest.BaseRepo.FullName}}{{end}}#{{.LatestPullRequest.Issue.Index}}</a> {{if .LatestPullRequest.HasMerged}} - <a href="{{.LatestPullRequest.Issue.Link}}" class="ui text-label purple large label gt-vm">{{svg "octicon-git-merge" 16 "gt-mr-2"}}{{$.locale.Tr "repo.pulls.merged"}}</a> + <a href="{{.LatestPullRequest.Issue.Link}}" class="ui purple large label">{{svg "octicon-git-merge" 16 "gt-mr-2"}}{{$.locale.Tr "repo.pulls.merged"}}</a> {{else if .LatestPullRequest.Issue.IsClosed}} - <a href="{{.LatestPullRequest.Issue.Link}}" class="ui text-label red large label gt-vm">{{svg "octicon-git-pull-request" 16 "gt-mr-2"}}{{$.locale.Tr "repo.issues.closed_title"}}</a> + <a href="{{.LatestPullRequest.Issue.Link}}" class="ui red large label">{{svg "octicon-git-pull-request" 16 "gt-mr-2"}}{{$.locale.Tr "repo.issues.closed_title"}}</a> {{else}} - <a href="{{.LatestPullRequest.Issue.Link}}" class="ui text-label green large label gt-vm">{{svg "octicon-git-pull-request" 16 "gt-mr-2"}}{{$.locale.Tr "repo.issues.open_title"}}</a> + <a href="{{.LatestPullRequest.Issue.Link}}" class="ui green large label">{{svg "octicon-git-pull-request" 16 "gt-mr-2"}}{{$.locale.Tr "repo.issues.open_title"}}</a> {{end}} {{end}} </td> diff --git a/templates/repo/icon.tmpl b/templates/repo/icon.tmpl index 6c63e6eca6..0568b74f63 100644 --- a/templates/repo/icon.tmpl +++ b/templates/repo/icon.tmpl @@ -1,16 +1,14 @@ -<div class="repo-icon"> - {{$avatarLink := .RelAvatarLink}} - {{if $avatarLink}} - <img class="ui avatar gt-vm" src="{{$avatarLink}}" width="32" height="32" alt="{{.FullName}}"> - {{else if $.IsTemplate}} - {{svg "octicon-repo-template" 32}} - {{else if $.IsPrivate}} - {{svg "octicon-lock" 32}} - {{else if $.IsMirror}} - {{svg "octicon-mirror" 32}} - {{else if $.IsFork}} - {{svg "octicon-repo-forked" 32}} - {{else}} - {{svg "octicon-repo" 32}} - {{end}} -</div> +{{$avatarLink := .RelAvatarLink}} +{{if $avatarLink}} + <img class="ui avatar gt-vm" src="{{$avatarLink}}" width="32" height="32" alt="{{.FullName}}"> +{{else if $.IsTemplate}} + {{svg "octicon-repo-template" 32}} +{{else if $.IsPrivate}} + {{svg "octicon-lock" 32}} +{{else if $.IsMirror}} + {{svg "octicon-mirror" 32}} +{{else if $.IsFork}} + {{svg "octicon-repo-forked" 32}} +{{else}} + {{svg "octicon-repo" 32}} +{{end}} diff --git a/templates/repo/issue/label_precolors.tmpl b/templates/repo/issue/label_precolors.tmpl index 555595fc14..146119b978 100644 --- a/templates/repo/issue/label_precolors.tmpl +++ b/templates/repo/issue/label_precolors.tmpl @@ -1,16 +1,22 @@ -<a class="color" style="background-color:#e11d21" data-color-hex="#e11d21"></a> -<a class="color" style="background-color:#eb6420" data-color-hex="#eb6420"></a> -<a class="color" style="background-color:#fbca04" data-color-hex="#fbca04"></a> -<a class="color" style="background-color:#009800" data-color-hex="#009800"></a> -<a class="color" style="background-color:#006b75" data-color-hex="#006b75"></a> -<a class="color" style="background-color:#207de5" data-color-hex="#207de5"></a> -<a class="color" style="background-color:#0052cc" data-color-hex="#0052cc"></a> -<a class="color" style="background-color:#5319e7" data-color-hex="#5319e7"></a> -<a class="color" style="background-color:#f6c6c7" data-color-hex="#f6c6c7"></a> -<a class="color" style="background-color:#fad8c7" data-color-hex="#fad8c7"></a> -<a class="color" style="background-color:#fef2c0" data-color-hex="#fef2c0"></a> -<a class="color" style="background-color:#bfe5bf" data-color-hex="#bfe5bf"></a> -<a class="color" style="background-color:#bfdadc" data-color-hex="#bfdadc"></a> -<a class="color" style="background-color:#c7def8" data-color-hex="#c7def8"></a> -<a class="color" style="background-color:#bfd4f2" data-color-hex="#bfd4f2"></a> -<a class="color" style="background-color:#d4c5f9" data-color-hex="#d4c5f9"></a> +<div class="precolors"> + <div class="gt-df"> + <a class="color" style="background-color:#e11d21" data-color-hex="#e11d21"></a> + <a class="color" style="background-color:#eb6420" data-color-hex="#eb6420"></a> + <a class="color" style="background-color:#fbca04" data-color-hex="#fbca04"></a> + <a class="color" style="background-color:#009800" data-color-hex="#009800"></a> + <a class="color" style="background-color:#006b75" data-color-hex="#006b75"></a> + <a class="color" style="background-color:#207de5" data-color-hex="#207de5"></a> + <a class="color" style="background-color:#0052cc" data-color-hex="#0052cc"></a> + <a class="color" style="background-color:#5319e7" data-color-hex="#5319e7"></a> + </div> + <div class="gt-df"> + <a class="color" style="background-color:#f6c6c7" data-color-hex="#f6c6c7"></a> + <a class="color" style="background-color:#fad8c7" data-color-hex="#fad8c7"></a> + <a class="color" style="background-color:#fef2c0" data-color-hex="#fef2c0"></a> + <a class="color" style="background-color:#bfe5bf" data-color-hex="#bfe5bf"></a> + <a class="color" style="background-color:#bfdadc" data-color-hex="#bfdadc"></a> + <a class="color" style="background-color:#c7def8" data-color-hex="#c7def8"></a> + <a class="color" style="background-color:#bfd4f2" data-color-hex="#bfd4f2"></a> + <a class="color" style="background-color:#d4c5f9" data-color-hex="#d4c5f9"></a> + </div> +</div> diff --git a/templates/repo/issue/labels/edit_delete_label.tmpl b/templates/repo/issue/labels/edit_delete_label.tmpl index d64782090c..98efc6aa94 100644 --- a/templates/repo/issue/labels/edit_delete_label.tmpl +++ b/templates/repo/issue/labels/edit_delete_label.tmpl @@ -54,9 +54,7 @@ <label for="color">{{$.locale.Tr "repo.issues.label_color"}}</label> <div class="color picker column"> <input class="color-picker" name="color" value="#70c24a" required maxlength="7"> - <div class="column precolors"> - {{template "repo/issue/label_precolors"}} - </div> + {{template "repo/issue/label_precolors"}} </div> </div> </form> diff --git a/templates/repo/issue/labels/label_new.tmpl b/templates/repo/issue/labels/label_new.tmpl index 41dced4a5b..1d3069f1bb 100644 --- a/templates/repo/issue/labels/label_new.tmpl +++ b/templates/repo/issue/labels/label_new.tmpl @@ -29,9 +29,7 @@ <label for="color">{{$.locale.Tr "repo.issues.label_color"}}</label> <div class="color picker column"> <input class="color-picker" name="color" value="#70c24a" required maxlength="7"> - <div class="column precolors"> - {{template "repo/issue/label_precolors"}} - </div> + {{template "repo/issue/label_precolors"}} </div> </div> </form> diff --git a/templates/repo/search.tmpl b/templates/repo/search.tmpl index 816be9d12c..cf088442b3 100644 --- a/templates/repo/search.tmpl +++ b/templates/repo/search.tmpl @@ -27,9 +27,9 @@ {{.locale.Tr "repo.search.results" (.Keyword|Escape) (.RepoLink|Escape) (.RepoName|Escape) | Str2html}} </h3> {{if .SearchResults}} - <div class="gt-df gt-ac gt-fw"> + <div class="flex-text-block gt-fw"> {{range $term := .SearchResultLanguages}} - <a class="ui text-label gt-df gt-ac gt-mr-1 gt-my-1 {{if eq $.Language $term.Language}}primary {{end}}basic label" href="{{$.SourcePath}}/search?q={{$.Keyword}}{{if ne $.Language $term.Language}}&l={{$term.Language}}{{end}}{{if ne $.queryType ""}}&t={{$.queryType}}{{end}}"> + <a class="ui {{if eq $.Language $term.Language}}primary{{end}} basic label gt-m-0" href="{{$.SourcePath}}/search?q={{$.Keyword}}{{if ne $.Language $term.Language}}&l={{$term.Language}}{{end}}{{if ne $.queryType ""}}&t={{$.queryType}}{{end}}"> <i class="color-icon gt-mr-3" style="background-color: {{$term.Color}}"></i> {{$term.Language}} <div class="detail">{{$term.Count}}</div> |