Skip to content
quarry Artifact [7317aacb24]
Login

Artifact [7317aacb24]

Artifact 7317aacb24e802ecf54c4da3e92698808788bd9a77a5009638e479cb13d6e298:


package web

import "html/template"

// The resolve page: a conflicting landing's three-pane merge, on a page
// of its own. On the record it came first and buried the proposal under
// a screen of editor; the record now says the landing conflicts and
// links here, and a commit from here returns to the record.
var landingResolvePage = page(template.Must(template.Must(base.Clone()).Parse(mergeStepsSource + `{{define "content"}}{{with .Landing}}
<div class="lr-page" data-hook="resolve-page" data-state="{{.Mergeable}}">
<h1 class="l-title">Resolve {{if .Number}}{{lnum .Number .State}} {{end}}{{unmark (titleline .Title)}}</h1>
<p class="l-meta"><code class="l-branch">{{.Target}}</code> into <code class="l-branch">{{.Branch}}</code><span class="l-bit">the resolution is committed on <code>{{.Branch}}</code></span></p>
{{- $back := print (repoURL $.Repo) "/landing/" (printf "%.12s" .ID)}}
{{if eq .Mergeable "conflict"}}
<div class="l-strip" data-hook="resolve-strip">
<div class="ls-s"><span class="ls-lbl bad">Conflicts</span><p class="ls-why"><strong>{{.Branch}} conflicts with {{.Target}}</strong> in {{len .Conflicts}} file{{if ne (len .Conflicts) 1}}s{{end}}.{{if and .Meld .Meld.CanResolve}} Answer each conflict, then commit the merge below.{{end}}</p></div>
<div class="ls-a"><span class="ls-quiet"><a href="{{$back}}" data-hook="resolve-back">Back to the landing</a></span></div>
</div>
{{if .Meld}}<ul class="lr-files" data-hook="resolve-files">{{range .Meld.Files}}<li><a href="#mf-{{.Path}}"><code>{{.Path}}</code></a>
{{- if .Omitted}}<span class="ls-lbl mute">{{.Omitted}}</span>{{else}}<span class="ls-lbl warn">{{.Conflicts}} conflict{{if ne .Conflicts 1}}s{{end}}</span>{{end}}</li>{{end}}</ul>
{{template "meld" .Meld}}
{{else}}<ul class="lr-files" data-hook="resolve-files">{{range .Conflicts}}<li><code>{{.}}</code></li>{{end}}</ul>{{end}}
<section class="lr-steps"><h2>In a checkout</h2>{{template "merge-steps" .}}</section>
{{else}}
<div class="l-strip" data-hook="resolve-strip">
<div class="ls-s"><span class="ls-lbl ok">No conflicts</span><p class="ls-why"><strong>{{.Branch}}</strong> has nothing to resolve against <code>{{.Target}}</code>.</p></div>
<div class="ls-a"><a class="btn btn-primary" href="{{$back}}" data-hook="resolve-back">Back to the landing</a></div>
</div>
{{end}}
</div>{{end}}{{end}}`)))