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 Extra Info to Branches Page #7461

Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 2 additions & 1 deletion public/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,8 @@ tbody.commit-list{vertical-align:baseline}
.ui.repository.list .item .time{font-size:12px;color:grey}
.ui.repository.list .item .ui.tags{margin-bottom:1em}
.ui.repository.list .item .ui.avatar.image{width:24px;height:24px}
.ui.repository.branches .time{font-size:12px;color:grey}
.ui.repository.branches .info{font-size:12px;color:grey}
.ui.repository.branches .info i{vertical-align:middle}
.ui.user.list .item{padding-bottom:25px}
.ui.user.list .item:not(:first-child){border-top:1px solid #eee;padding-top:25px}
.ui.user.list .item .ui.avatar.image{width:40px;height:40px}
Expand Down
5 changes: 4 additions & 1 deletion public/less/_explore.less
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@
}

.ui.repository.branches {
.time {
.info {
font-size: 12px;
color: #808080;
i {
vertical-align: middle;
}
gary-kim marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down
19 changes: 16 additions & 3 deletions templates/repo/branch/list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,17 @@
<table class="ui very basic striped fixed table single line">
<tbody>
<tr>
<td>{{.DefaultBranch}}</td>
<td>
{{range $branch := .Branches}}
{{if eq .Name $.DefaultBranch}}
{{if .IsProtected}}
<i class="octicon octicon-shield"></i>
{{end}}
{{$.DefaultBranch}}
<p class="info"><i class="octicon octicon-git-commit"></i><a href="{{$.RepoLink}}/commit/{{.Commit.ID.String}}">{{ShortSha .Commit.ID.String}}</a> · {{Safe (EllipsisString (Printf "%s" (RenderCommitMessage .Commit.CommitMessage $.RepoLink $.Repository.ComposeMetas)) 72)}} · {{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Commit.Committer.When $.i18n.Lang}}</p>
{{end}}
{{end}}
</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -41,10 +51,13 @@
<td>
{{if .IsDeleted}}
<s><a href="{{$.RepoLink}}/src/branch/{{.Name | EscapePound}}">{{.Name}}</a></s>
<p class="time">{{$.i18n.Tr "repo.branch.deleted_by" .DeletedBranch.DeletedBy.Name}} {{TimeSinceUnix .DeletedBranch.DeletedUnix $.i18n.Lang}}</p>
<p class="info">{{$.i18n.Tr "repo.branch.deleted_by" .DeletedBranch.DeletedBy.Name}} {{TimeSinceUnix .DeletedBranch.DeletedUnix $.i18n.Lang}}</p>
{{else}}
{{if .IsProtected}}
<i class="octicon octicon-shield"></i>
{{end}}
<a href="{{$.RepoLink}}/src/branch/{{.Name | EscapePound}}">{{.Name}}</a>
<p class="time">{{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Commit.Committer.When $.i18n.Lang}}</p>
<p class="info"><i class="octicon octicon-git-commit"></i><a href="{{$.RepoLink}}/commit/{{.Commit.ID.String}}">{{ShortSha .Commit.ID.String}}</a> · {{Safe (EllipsisString (Printf "%s" (RenderCommitMessage .Commit.CommitMessage $.RepoLink $.Repository.ComposeMetas)) 72)}} · {{$.i18n.Tr "org.repo_updated"}} {{TimeSince .Commit.Committer.When $.i18n.Lang}}</p>
{{end}}
</td>
<td class="ui">
Expand Down