Add error display
This commit is contained in:
parent
b9d5c2df46
commit
07da911b05
|
@ -11,22 +11,44 @@
|
|||
img { max-width: 100%; box-shadow: 0 0 10px 10px lightgray; }
|
||||
img:hover { box-shadow: 0 0 10px 10px darkgray}
|
||||
h3 { margin-top: 100px; }
|
||||
.errors { padding: 0.5rem; border: 1px solid #f5c6cb; color: #721c24; background: #f8d7da; }
|
||||
* { line-height: 1.5em; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>{n}hats.com domains</h1>
|
||||
{{ $errors := false -}}
|
||||
{{- range . -}}
|
||||
{{- with .Error -}}
|
||||
{{- $errors = true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if $errors -}}
|
||||
<div class="errors">
|
||||
<h4>Errors occurred during processing</h3>
|
||||
<ol>
|
||||
{{- range . -}}
|
||||
{{- if .Error }}
|
||||
<li>{{.DomainName}}: {{.Error}}</li>
|
||||
{{ end -}}
|
||||
{{- end -}}
|
||||
</ol>
|
||||
</div>
|
||||
{{end}}
|
||||
<h3>Summary</h3>
|
||||
<ul>
|
||||
{{range .}}
|
||||
{{if not .Error}}
|
||||
{{if .Available}}
|
||||
<li><a href="#{{.DomainName}}">{{.DomainName}}</a> – Available!</li>
|
||||
{{else}}
|
||||
<li><a href="#{{.DomainName}}">{{.DomainName}}</a> – Registered since {{(parseTime .DomainInfo.CreatedDate).Format "Mon Jan 2 2006" }}</li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
</ul>
|
||||
{{range .}}
|
||||
{{if not .Error}}
|
||||
<h3 id="{{.DomainName}}">{{.DomainName}}</h3>
|
||||
<dl>
|
||||
<dt>Fetched</dt>
|
||||
|
@ -52,5 +74,6 @@
|
|||
</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue