Skip to content

Commit 0c2b767

Browse files
n0toosefuxiaohei
authored andcommitted
Improve RSS feed icons (go-gitea#28368)
- The RSS Feed icons were placed in a proper button, so that it does not look "inconsistent". This also makes the problem of the button being improperly aligned go away. - The icon that shows on user profiles has not been modified because of a lack of better implementation ideas. - Where applicable, the RSS Feed icon was put directly next to the Follow button (right menu), as both functionalities effectively share the same purpose. - Despite the attempt at achieving less inconsistency, a conscious decision to not add any text to those buttons was made, opting for tooltips instead. "Make it present, but not too annoying." - A special exception was made for the Releases pages (which contains text, not a tooltip), where an RSS feed would be particularly beneficial to users. The fact that the RSS functionality is explicitly optional was taken into account, and these improvements were made with public-facing instances (where the feature works best) in mind.
1 parent 9196535 commit 0c2b767

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

templates/org/home.tmpl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
{{if .Org.Visibility.IsLimited}}<span class="ui large basic horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</span>{{end}}
1010
{{if .Org.Visibility.IsPrivate}}<span class="ui large basic horizontal label">{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}</span>{{end}}
1111
</span>
12-
{{if .EnableFeed}}
13-
<a class="rss-icon gt-mx-3" href="{{.Org.HomeLink}}.rss" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">{{svg "octicon-rss" 24}}</a>
14-
{{end}}
1512
</div>
1613
{{if $.RenderedDescription}}<div class="render-content markup">{{$.RenderedDescription|Str2html}}</div>{{end}}
1714
<div class="text grey meta">
@@ -23,6 +20,11 @@
2320
</div>
2421
</div>
2522
<div class="right menu">
23+
{{if .EnableFeed}}
24+
<button class="link-action ui basic label button gt-mr-0" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}" data-url="{{$.Org.HomeLink}}.rss">
25+
{{svg "octicon-rss" 24}}
26+
</button>
27+
{{end}}
2628
<button class="link-action ui basic button gt-mr-0" data-url="{{.Org.HomeLink}}?action={{if $.IsFollowing}}unfollow{{else}}follow{{end}}">
2729
{{if $.IsFollowing}}
2830
{{ctx.Locale.Tr "user.unfollow"}}

templates/repo/header.tmpl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@
2525
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.template"}}</span>
2626
{{end}}
2727
</div>
28-
{{if $.EnableFeed}}
29-
<a class="rss-icon gt-ml-3" href="{{$.RepoLink}}.rss" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</a>
30-
{{end}}
3128
</div>
3229
{{if $.PullMirror}}
3330
<div class="fork-flag">{{ctx.Locale.Tr "repo.mirror_from"}} <a target="_blank" rel="noopener noreferrer" href="{{$.PullMirror.RemoteAddress}}">{{$.PullMirror.RemoteAddress}}</a></div>
@@ -55,6 +52,12 @@
5552
</div>
5653
</form>
5754
{{end}}
55+
{{if $.EnableFeed}}
56+
{{/* An extra div-element is not necessary here, as this button does not secretly contain two buttons. */}}
57+
<button class="ui compact small basic button" data-url="{{$.RepoLink}}.rss" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">
58+
{{svg "octicon-rss" 16}}
59+
</button>
60+
{{end}}
5861
<form method="post" action="{{$.RepoLink}}/action/{{if $.IsWatchingRepo}}un{{end}}watch?redirect_to={{$.Link}}">
5962
{{$.CsrfTokenHtml}}
6063
<div class="ui labeled button" {{if not $.IsSigned}}data-tooltip-content="{{ctx.Locale.Tr "repo.watch_guest_user"}}"{{end}}>

templates/repo/release_tag_header.tmpl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
<a class="{{if .PageIsTagList}}active {{end}}item" href="{{.RepoLink}}/tags">{{ctx.Locale.PrettyNumber .NumTags}} {{ctx.Locale.TrN .NumTags "repo.tag" "repo.tags"}}</a>
1111
{{end}}
1212
</h2>
13-
{{if .EnableFeed}}
14-
<a class="rss-icon gt-mx-3" href="{{.RepoLink}}/{{if .PageIsTagList}}tags{{else}}releases{{end}}.rss" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</a>
15-
{{end}}
1613
</div>
14+
{{if .EnableFeed}}
15+
<a class="ui small button" href="{{.RepoLink}}/{{if .PageIsTagList}}tags{{else}}releases{{end}}.rss">
16+
{{svg "octicon-rss" 18}} {{ctx.Locale.Tr "rss_feed"}}
17+
</a>
18+
{{end}}
1719
{{if and (not .PageIsTagList) .CanCreateRelease}}
1820
<a class="ui small primary button" href="{{$.RepoLink}}/releases/new">
1921
{{ctx.Locale.Tr "repo.release.new_release"}}

templates/repo/view_file.tmpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
<a download href="{{$.RawFileLink}}"><span class="btn-octicon" data-tooltip-content="{{ctx.Locale.Tr "repo.download_file"}}">{{svg "octicon-download"}}</span></a>
4444
<a id="copy-content" class="btn-octicon {{if not .CanCopyContent}} disabled{{end}}"{{if or .IsImageFile (and .HasSourceRenderedToggle (not .IsDisplayingSource))}} data-link="{{$.RawFileLink}}"{{end}} data-tooltip-content="{{if .CanCopyContent}}{{ctx.Locale.Tr "copy_content"}}{{else}}{{ctx.Locale.Tr "copy_type_unsupported"}}{{end}}">{{svg "octicon-copy" 14}}</a>
4545
{{if .EnableFeed}}
46-
<a class="btn-octicon" href="{{$.FeedURL}}/rss/{{$.BranchNameSubURL}}/{{PathEscapeSegments .TreePath}}">{{svg "octicon-rss" 14}}</a>
46+
<a class="btn-octicon" href="{{$.FeedURL}}/rss/{{$.BranchNameSubURL}}/{{PathEscapeSegments .TreePath}}" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">
47+
{{svg "octicon-rss" 14}}
48+
</a>
4749
{{end}}
4850
{{if .Repository.CanEnableEditor}}
4951
{{if .CanEditFile}}

0 commit comments

Comments
 (0)