Browse Source

Incorporate some changes from upstream (up to commit 7606061)

master
Gerben 5 years ago
parent
commit
4f19ae6c5f
7 changed files with 58 additions and 11 deletions
  1. +7
    -2
      templates/base/footer.tmpl
  2. +18
    -0
      templates/base/head.tmpl
  3. +1
    -1
      templates/repo/branch_dropdown.tmpl
  4. +8
    -8
      templates/repo/header.tmpl
  5. +4
    -0
      templates/repo/view_file.tmpl
  6. +10
    -0
      templates/user/dashboard/dashboard.tmpl
  7. +10
    -0
      templates/user/profile.tmpl

+ 7
- 2
templates/base/footer.tmpl View File

@@ -45,7 +45,6 @@
{{if .RequireTribute}}
<script src="{{AppSubUrl}}/vendor/plugins/tribute/tribute.min.js"></script>

{{if .Assignees}}
<script>
var issuesTribute = new Tribute({
values: [
@@ -66,7 +65,6 @@
})
issuesTribute.attach(document.getElementById('content'))
</script>
{{end}}
<script>
var emojiTribute = new Tribute({
collection: [{
@@ -107,6 +105,13 @@
<!-- JavaScript -->
<script src="{{AppSubUrl}}/vendor/plugins/semantic/semantic.min.js"></script>
<script src="{{AppSubUrl}}/js/index.js?v={{MD5 AppVer}}"></script>
{{if .EnableHeatmap}}
<script src="{{AppSubUrl}}/vendor/plugins/moment/moment.min.js" charset="utf-8"></script>
<script src="{{AppSubUrl}}/vendor/plugins/vue-calendar-heatmap/vue-calendar-heatmap.browser.js" charset="utf-8"></script>
<script type="text/javascript">
initHeatmap('user-heatmap', '{{.HeatmapUser}}');
</script>
{{end}}
{{template "custom/footer" .}}
</body>
</html>

+ 18
- 0
templates/base/head.tmpl View File

@@ -5,6 +5,21 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>{{if .Title}}{{.Title}} - {{end}}{{AppName}}</title>
<link rel="manifest" href="{{AppSubUrl}}/manifest.json">

<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('{{AppSubUrl}}/serviceworker.js').then(function(registration) {
// Registration was successful
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}, function(err) {
// registration failed :(
console.log('ServiceWorker registration failed: ', err);
});
});
}
</script>
<meta name="theme-color" content="{{ThemeColorMetaTag}}">
<meta name="author" content="{{if .Repository}}{{.Owner.Name}}{{else}}{{end}}" />
<meta name="description" content="{{if .Repository}}{{.Repository.Name}}{{if .Repository.Description}} - {{.Repository.Description}}{{end}}{{else}}{{end}}" />
@@ -100,6 +115,9 @@
{{end}}
{{if .RequireDropzone}}
<link rel="stylesheet" href="{{AppSubUrl}}/vendor/plugins/dropzone/dropzone.css">
{{end}}
{{if .EnableHeatmap}}
<link rel="stylesheet" href="{{AppSubUrl}}/vendor/plugins/vue-calendar-heatmap/vue-calendar-heatmap.css">
{{end}}
<style class="list-search-style"></style>



+ 1
- 1
templates/repo/branch_dropdown.tmpl View File

@@ -1,7 +1,7 @@
{{/*
{{if and .PullRequestCtx.Allowed .IsViewBranch}}
<div class="">
<a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch}}...{{.Repository.Owner.Name}}:{{.BranchName}}">
<a href="{{.BaseRepo.Link}}/compare/{{.BaseRepo.DefaultBranch | EscapePound}}...{{.Repository.Owner.Name}}:{{.BranchName | EscapePound}}">
<button class="ui green tiny compact button"><i class="octicon octicon-git-compare"></i></button>
</a>
</div>


+ 8
- 8
templates/repo/header.tmpl View File

@@ -22,37 +22,37 @@
{{if not .IsDiffCompare}}
<div class="ui tabs container">
<div class="ui tabular stackable menu navbar">
{{if .Repository.UnitEnabled $.UnitTypeCode}}
<a class="{{if .PageIsViewCode}}active{{end}} item" href="{{.RepoLink}}{{if (ne .BranchName .Repository.DefaultBranch)}}/src/{{.BranchNameSubURL}}{{end}}">
{{if .Permission.CanRead $.UnitTypeCode}}
<a class="{{if .PageIsViewCode}}active{{end}} item" href="{{.RepoLink}}{{if (ne .BranchName .Repository.DefaultBranch)}}/src/{{.BranchNameSubURL | EscapePound}}{{end}}">
<i class="octicon octicon-code"></i> {{.i18n.Tr "repo.code"}}
</a>
{{end}}

{{if .Repository.UnitEnabled $.UnitTypeIssues}}
{{if .Permission.CanRead $.UnitTypeIssues}}
<a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues" rel="noopener noreferrer">
<i class="octicon octicon-issue-opened"></i> {{.i18n.Tr "repo.issues"}} <span class="ui small label">{{.Repository.NumOpenIssues}}</span>
</a>
{{end}}

{{if .Repository.UnitEnabled $.UnitTypeExternalTracker}}
{{if .Permission.CanRead $.UnitTypeExternalTracker}}
<a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues" target="_blank">
<i class="octicon octicon-issue-opened"></i> {{.i18n.Tr "repo.issues"}} </span>
</a>
{{end}}

{{if .Repository.AllowsPulls}}
{{if and .Repository.CanEnablePulls (.Permission.CanRead $.UnitTypePullRequests)}}
<a class="{{if .PageIsPullList}}active{{end}} item" href="{{.RepoLink}}/pulls">
<i class="octicon octicon-git-pull-request"></i> {{.i18n.Tr "repo.pulls"}} <span class="ui small label">{{.Repository.NumOpenPulls}}</span>
</a>
{{end}}

{{if and (.Repository.UnitEnabled $.UnitTypeReleases) (not .IsBareRepo) }}
{{if and (.Permission.CanRead $.UnitTypeReleases) (not .IsBareRepo) }}
<a class="{{if .PageIsReleaseList}}active{{end}} item" href="{{.RepoLink}}/releases">
<i class="octicon octicon-tag"></i> {{.i18n.Tr "repo.releases"}} <span class="ui small label">{{.Repository.NumReleases}}</span>
</a>
{{end}}

{{if and (.Repository.AnyUnitEnabled $.UnitTypePullRequests $.UnitTypeIssues $.UnitTypeReleases) (not .IsBareRepo)}}
{{if and (.Permission.CanReadAny $.UnitTypePullRequests $.UnitTypeIssues $.UnitTypeReleases) (not .IsBareRepo)}}
<a class="{{if .PageIsActivity}}active{{end}} item" href="{{.RepoLink}}/activity">
<i class="octicon octicon-pulse"></i> {{.i18n.Tr "repo.activity"}}
</a>
@@ -60,7 +60,7 @@

{{template "custom/extra_tabs" .}}

{{if .IsRepositoryAdmin}}
{{if .Permission.IsAdmin}}
<div class="right menu">
<a class="{{if .PageIsSettings}}active{{end}} item" href="{{.RepoLink}}/settings">
<i class="octicon octicon-tools"></i> {{.i18n.Tr "repo.settings"}}


+ 4
- 0
templates/repo/view_file.tmpl View File

@@ -57,6 +57,10 @@
<video controls src="{{EscapePound $.RawFileLink}}">
<strong>{{.i18n.Tr "repo.video_not_supported_in_browser"}}</strong>
</video>
{{else if .IsAudioFile}}
<audio controls src="{{EscapePound $.RawFileLink}}">
<strong>{{.i18n.Tr "repo.audio_not_supported_in_browser"}}</strong>
</audio>
{{else if .IsPDFFile}}
<iframe width="100%" height="600px" src="{{AppSubUrl}}/vendor/plugins/pdfjs/web/viewer.html?file={{EscapePound $.RawFileLink}}"></iframe>
{{else}}


+ 10
- 0
templates/user/dashboard/dashboard.tmpl View File

@@ -5,6 +5,16 @@
{{template "base/alert" .}}
<div class="ui mobile reversed stackable grid">
<div class="ten wide column">
{{if .EnableHeatmap}}
<div id="user-heatmap" style="padding-right: 40px">
<activity-heatmap :locale="locale" :suburl="suburl" :user="heatmapUser">
<div slot="loading">
<div class="ui active centered inline indeterminate text loader" id="loading-heatmap">{{.i18n.Tr "user.heatmap.loading"}}</div>
</div>
</activity-heatmap>
</div>
<div class="ui divider"></div>
{{end}}
{{template "user/dashboard/feeds" .}}
</div>
<div id="app" class="six wide column">


+ 10
- 0
templates/user/profile.tmpl View File

@@ -13,6 +13,16 @@
</div>

{{if eq .TabName "activity"}}
{{if .EnableHeatmap}}
<div id="user-heatmap" style="padding-right: 40px">
<activity-heatmap :locale="locale" :suburl="suburl" :user="heatmapUser">
<div slot="loading">
<div class="ui active centered inline indeterminate text loader" id="loading-heatmap">{{.i18n.Tr "user.heatmap.loading"}}</div>
</div>
</activity-heatmap>
</div>
<div class="ui divider"></div>
{{end}}
<div class="feeds">
{{template "user/dashboard/feeds" .}}
</div>


Loading…
Cancel
Save