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}} {{if .RequireTribute}}
<script src="{{AppSubUrl}}/vendor/plugins/tribute/tribute.min.js"></script> <script src="{{AppSubUrl}}/vendor/plugins/tribute/tribute.min.js"></script>


{{if .Assignees}}
<script> <script>
var issuesTribute = new Tribute({ var issuesTribute = new Tribute({
values: [ values: [
@@ -66,7 +65,6 @@
}) })
issuesTribute.attach(document.getElementById('content')) issuesTribute.attach(document.getElementById('content'))
</script> </script>
{{end}}
<script> <script>
var emojiTribute = new Tribute({ var emojiTribute = new Tribute({
collection: [{ collection: [{
@@ -107,6 +105,13 @@
<!-- JavaScript --> <!-- JavaScript -->
<script src="{{AppSubUrl}}/vendor/plugins/semantic/semantic.min.js"></script> <script src="{{AppSubUrl}}/vendor/plugins/semantic/semantic.min.js"></script>
<script src="{{AppSubUrl}}/js/index.js?v={{MD5 AppVer}}"></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" .}} {{template "custom/footer" .}}
</body> </body>
</html> </html>

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

@@ -5,6 +5,21 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge"> <meta http-equiv="x-ua-compatible" content="ie=edge">
<title>{{if .Title}}{{.Title}} - {{end}}{{AppName}}</title> <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="theme-color" content="{{ThemeColorMetaTag}}">
<meta name="author" content="{{if .Repository}}{{.Owner.Name}}{{else}}{{end}}" /> <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}}" /> <meta name="description" content="{{if .Repository}}{{.Repository.Name}}{{if .Repository.Description}} - {{.Repository.Description}}{{end}}{{else}}{{end}}" />
@@ -100,6 +115,9 @@
{{end}} {{end}}
{{if .RequireDropzone}} {{if .RequireDropzone}}
<link rel="stylesheet" href="{{AppSubUrl}}/vendor/plugins/dropzone/dropzone.css"> <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}} {{end}}
<style class="list-search-style"></style> <style class="list-search-style"></style>




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

@@ -1,7 +1,7 @@
{{/* {{/*
{{if and .PullRequestCtx.Allowed .IsViewBranch}} {{if and .PullRequestCtx.Allowed .IsViewBranch}}
<div class=""> <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> <button class="ui green tiny compact button"><i class="octicon octicon-git-compare"></i></button>
</a> </a>
</div> </div>


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

@@ -22,37 +22,37 @@
{{if not .IsDiffCompare}} {{if not .IsDiffCompare}}
<div class="ui tabs container"> <div class="ui tabs container">
<div class="ui tabular stackable menu navbar"> <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"}} <i class="octicon octicon-code"></i> {{.i18n.Tr "repo.code"}}
</a> </a>
{{end}} {{end}}


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


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


{{if .Repository.AllowsPulls}}
{{if and .Repository.CanEnablePulls (.Permission.CanRead $.UnitTypePullRequests)}}
<a class="{{if .PageIsPullList}}active{{end}} item" href="{{.RepoLink}}/pulls"> <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> <i class="octicon octicon-git-pull-request"></i> {{.i18n.Tr "repo.pulls"}} <span class="ui small label">{{.Repository.NumOpenPulls}}</span>
</a> </a>
{{end}} {{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"> <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> <i class="octicon octicon-tag"></i> {{.i18n.Tr "repo.releases"}} <span class="ui small label">{{.Repository.NumReleases}}</span>
</a> </a>
{{end}} {{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"> <a class="{{if .PageIsActivity}}active{{end}} item" href="{{.RepoLink}}/activity">
<i class="octicon octicon-pulse"></i> {{.i18n.Tr "repo.activity"}} <i class="octicon octicon-pulse"></i> {{.i18n.Tr "repo.activity"}}
</a> </a>
@@ -60,7 +60,7 @@


{{template "custom/extra_tabs" .}} {{template "custom/extra_tabs" .}}


{{if .IsRepositoryAdmin}}
{{if .Permission.IsAdmin}}
<div class="right menu"> <div class="right menu">
<a class="{{if .PageIsSettings}}active{{end}} item" href="{{.RepoLink}}/settings"> <a class="{{if .PageIsSettings}}active{{end}} item" href="{{.RepoLink}}/settings">
<i class="octicon octicon-tools"></i> {{.i18n.Tr "repo.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}}"> <video controls src="{{EscapePound $.RawFileLink}}">
<strong>{{.i18n.Tr "repo.video_not_supported_in_browser"}}</strong> <strong>{{.i18n.Tr "repo.video_not_supported_in_browser"}}</strong>
</video> </video>
{{else if .IsAudioFile}}
<audio controls src="{{EscapePound $.RawFileLink}}">
<strong>{{.i18n.Tr "repo.audio_not_supported_in_browser"}}</strong>
</audio>
{{else if .IsPDFFile}} {{else if .IsPDFFile}}
<iframe width="100%" height="600px" src="{{AppSubUrl}}/vendor/plugins/pdfjs/web/viewer.html?file={{EscapePound $.RawFileLink}}"></iframe> <iframe width="100%" height="600px" src="{{AppSubUrl}}/vendor/plugins/pdfjs/web/viewer.html?file={{EscapePound $.RawFileLink}}"></iframe>
{{else}} {{else}}


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

@@ -5,6 +5,16 @@
{{template "base/alert" .}} {{template "base/alert" .}}
<div class="ui mobile reversed stackable grid"> <div class="ui mobile reversed stackable grid">
<div class="ten wide column"> <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" .}} {{template "user/dashboard/feeds" .}}
</div> </div>
<div id="app" class="six wide column"> <div id="app" class="six wide column">


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

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


{{if eq .TabName "activity"}} {{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"> <div class="feeds">
{{template "user/dashboard/feeds" .}} {{template "user/dashboard/feeds" .}}
</div> </div>


Loading…
Cancel
Save