Browse Source

Move repo description to repo header

master
Gerben 6 years ago
parent
commit
93e5b95455
3 changed files with 40 additions and 11 deletions
  1. +29
    -0
      public/custom-style.css
  2. +10
    -6
      templates/repo/header.tmpl
  3. +1
    -5
      templates/repo/home.tmpl

+ 29
- 0
public/custom-style.css View File

@@ -2,3 +2,32 @@
/* Since we have no footer bar, reduce padding */
padding-bottom: 15px;
}

.repository .repo-header {
padding: 0.5rem 0;
}
.repository .header-grid > * {
padding-top: 1rem;
padding-bottom: 0.5rem;
}
.repository .header-grid {
align-items: flex-end;
align-items: last baseline;
}

.repository .mega-octicon {
margin-right: 0.5rem;
}
.repository .header-grid .fork-flag {
margin-left: 0;
}

/* These rules are copied here to pull them out of their nesting. */
.repo-description {
display: flex;
justify-content: space-between;
align-items: center;
}
#repo-desc {
font-size: 1.2em;
}

+ 10
- 6
templates/repo/header.tmpl View File

@@ -1,17 +1,21 @@
<div class="header-wrapper">
{{with .Repository}}
<div class="ui container">
<div class="ui container repo-header">
<div class="ui stackable grid header-grid">
<div class="eight wide column">
<i class="mega-octicon octicon-{{if .IsPrivate}}lock{{else if .IsMirror}}repo-clone{{else if .IsFork}}repo-forked{{else}}repo{{end}}"></i>
<div class="ui huge breadcrumb">
<i class="mega-octicon octicon-{{if .IsPrivate}}lock{{else if .IsMirror}}repo-clone{{else if .IsFork}}repo-forked{{else}}repo{{end}}"></i>
{{if .IsMirror}}<div class="fork-flag">{{$.i18n.Tr "repo.mirror_from"}} <a target="_blank" rel="noopener" href="{{$.Mirror.Address}}">{{$.Mirror.Address}}</a></div>{{end}}
{{if .IsFork}}<div class="fork-flag">{{$.i18n.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{SubStr .BaseRepo.RelLink 1 -1}}</a></div>{{end}}
<a href="{{AppSubUrl}}/{{.Owner.Name}}">{{.Owner.Name}}</a>
<div class="divider"> / </div>
<a href="{{$.RepoLink}}">{{.Name}}</a>
{{if .IsMirror}}<div class="fork-flag">{{$.i18n.Tr "repo.mirror_from"}} <a target="_blank" rel="noopener" href="{{$.Mirror.Address}}">{{$.Mirror.Address}}</a></div>{{end}}
{{if .IsFork}}<div class="fork-flag">{{$.i18n.Tr "repo.forked_from"}} <a href="{{.BaseRepo.Link}}">{{SubStr .BaseRepo.RelLink 1 -1}}</a></div>{{end}}
</div>
</div>
<div class="ui repo-description">
<div id="repo-desc">
{{if .DescriptionHTML}}<span class="description has-emoji">{{.DescriptionHTML}}</span>{{end}}
<a class="link" href="{{.Website}}">{{.Website}}</a>
</div>
</div>
</div><!-- end grid -->
</div><!-- end container -->
{{end}}


+ 1
- 5
templates/repo/home.tmpl View File

@@ -3,11 +3,7 @@
{{template "repo/header" .}}
<div class="ui container">
{{template "base/alert" .}}
<div class="ui repo-description">
<div id="repo-desc">
{{if .Repository.DescriptionHTML}}<span class="description has-emoji">{{.Repository.DescriptionHTML}}</span>{{else if .IsRepositoryAdmin}}<span class="no-description text-italic">{{.i18n.Tr "repo.no_desc"}}</span>{{end}}
<a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>
</div>
<div>
{{if .RepoSearchEnabled}}
<div class="ui repo-search">
<form class="ui form" action="{{.RepoLink}}/search" method="get">


Loading…
Cancel
Save