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

RSS icon fixes #24476

Merged
merged 16 commits into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions templates/org/home.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<div class="ui container gt-df">
{{avatar $.Context .Org 140 "org-avatar"}}
<div id="org-info">
<div class="ui header">
<div class="ui header gt-df gt-fw">
{{.Org.DisplayName}}
{{if .EnableFeed}}
<a href="{{.Org.HomeLink}}.rss"><i class="ui grey icon gt-ml-3" data-tooltip-content="{{.locale.Tr "rss_feed"}}">{{svg "octicon-rss" 36}}</i></a>
{{end}}
<span class="org-visibility">
{{if .Org.Visibility.IsLimited}}<div class="ui large basic horizontal label">{{.locale.Tr "org.settings.visibility.limited_shortname"}}</div>{{end}}
{{if .Org.Visibility.IsPrivate}}<div class="ui large basic horizontal label">{{.locale.Tr "org.settings.visibility.private_shortname"}}</div>{{end}}
{{if .Org.Visibility.IsLimited}}<span class="ui large basic horizontal label">{{.locale.Tr "org.settings.visibility.limited_shortname"}}</span>{{end}}
{{if .Org.Visibility.IsPrivate}}<span class="ui large basic horizontal label">{{.locale.Tr "org.settings.visibility.private_shortname"}}</span>{{end}}
</span>
{{if .EnableFeed}}
<a class="muted" href="{{.Org.HomeLink}}.rss" data-tooltip-content="{{.locale.Tr "rss_feed"}}">{{svg "octicon-rss" 24}}</a>
{{end}}
</div>
{{if $.RenderedDescription}}<div class="render-content markup">{{$.RenderedDescription|Str2html}}</div>{{end}}
<div class="text grey meta">
Expand Down
6 changes: 3 additions & 3 deletions templates/repo/header.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
<a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>
<div class="gt-mx-2">/</div>
<a href="{{$.RepoLink}}">{{.Name}}</a>
{{if $.EnableFeed}}
<a href="{{$.RepoLink}}.rss"><i class="ui grey icon gt-ml-3" data-tooltip-content="{{$.locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</i></a>
{{end}}
<div class="labels gt-df gt-ac gt-fw">
{{if .IsTemplate}}
{{if .IsPrivate}}
Expand All @@ -38,6 +35,9 @@
<span class="ui basic label">{{$.locale.Tr "repo.desc.archived"}}</span>
{{end}}
</div>
{{if $.EnableFeed}}
<a class="muted gt-ml-3" href="{{$.RepoLink}}.rss" data-tooltip-content="{{$.locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</a>
{{end}}
</div>
{{if $.IsPullMirror}}
{{$address := MirrorRemoteAddress $.Context . $.Mirror.GetRemoteName false}}
Expand Down
9 changes: 1 addition & 8 deletions templates/repo/release/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,7 @@
{{template "repo/header" .}}
<div class="ui container">
{{template "base/alert" .}}
{{template "repo/sub_menu_release_tag" .}}

{{if .CanCreateRelease}}
<a class="ui right small green button" href="{{$.RepoLink}}/releases/new">
{{.locale.Tr "repo.release.new_release"}}
</a>
{{end}}

{{template "repo/release_tag_header" .}}
<ul id="release-list">
{{range $idx, $release := .Releases}}
<li class="ui grid">
Expand Down
27 changes: 27 additions & 0 deletions templates/repo/release_tag_header.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{$canReadReleases := $.Permission.CanRead $.UnitTypeReleases}}
{{$canReadCode := $.Permission.CanRead $.UnitTypeCode}}

{{if $canReadReleases}}
<div class="gt-df">
<div class="gt-f1">
<h2 class="ui compact small menu header small-menu-items">
<a class="{{if .PageIsReleaseList}}active {{end}}item" href="{{.RepoLink}}/releases">{{.locale.Tr "repo.release.releases"}}</a>
{{if $canReadCode}}
<a class="{{if .PageIsTagList}}active {{end}}item" href="{{.RepoLink}}/tags">{{.locale.Tr "repo.release.tags"}}</a>
{{end}}
</h2>
{{if .EnableFeed}}
<a class="muted gt-mx-3" href="{{.RepoLink}}/{{if .PageIsTagList}}tags{{else}}releases{{end}}.rss" data-tooltip-content="{{.locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</a>
{{end}}
</div>
{{if and (not .PageIsTagList) .CanCreateRelease}}
<a class="ui right small green button" href="{{$.RepoLink}}/releases/new">
{{.locale.Tr "repo.release.new_release"}}
</a>
{{end}}
</div>
<div class="ui divider"></div>
{{else if $canReadCode}}
{{/* if the "repo.releases" unit is disabled, only show the "commits / branches / tags" sub menu */}}
{{template "repo/sub_menu" .}}
{{end}}
17 changes: 0 additions & 17 deletions templates/repo/sub_menu_release_tag.tmpl

This file was deleted.

8 changes: 1 addition & 7 deletions templates/repo/tag/list.tmpl
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
{{template "base/head" .}}

<div role="main" aria-label="{{.Title}}" class="page-content repository tags">
{{template "repo/header" .}}
<div class="ui container">
{{template "base/alert" .}}
{{template "repo/sub_menu_release_tag" .}}

<div class="ui divider"></div>

{{template "repo/release_tag_header" .}}
<h4 class="ui top attached header">
<div class="five wide column gt-df gt-ac">
{{svg "octicon-tag" 16 "gt-mr-2"}}{{.locale.Tr "repo.release.tags"}}
</div>
</h4>

{{$canReadReleases := $.Permission.CanRead $.UnitTypeReleases}}

<div class="ui attached table segment">
<table class="ui very basic striped fixed table single line" id="tags-table">
<tbody class="tag-list">
Expand Down
6 changes: 6 additions & 0 deletions web_src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,12 @@ a.label,
text-decoration: none !important;
}

/* for most cases, we only use our svg icon as inline icon, so we need to make them inline-block and vertical-align: middle */
svg.svg {
display: inline-block;
vertical-align: middle;
}

.ui.red.labels .label,
.ui.ui.ui.red.label,
.ui.red.button,
Expand Down
5 changes: 0 additions & 5 deletions web_src/css/organization.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,6 @@
margin-bottom: 0;
}

.organization.profile #org-info .ui.header .org-visibility .label {
margin-left: 5px;
margin-top: 2px;
}

.organization.profile #org-info .desc {
font-size: 16px;
margin-bottom: 10px;
Expand Down
2 changes: 1 addition & 1 deletion web_src/js/components/RepoBranchTagSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<div class="scrolling menu" ref="scrollContainer">
<div v-for="(item, index) in filteredItems" :key="item.name" class="item" :class="{selected: item.selected, active: active === index}" @click="selectItem(item)" :ref="'listItem' + index">
{{ item.name }}
<a v-if="enableFeed && mode === 'branches'" role="button" class="ui compact muted right" :href="rssURLPrefix + item.url" target="_blank" @click.stop>
<a v-if="enableFeed && mode === 'branches'" role="button" class="ui compact right muted" :href="rssURLPrefix + item.url" target="_blank" @click.stop>
<svg-icon name="octicon-rss" :size="14"/>
</a>
</div>
Expand Down