forked from maxence-charriere/go-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
issue.go
56 lines (48 loc) · 871 Bytes
/
issue.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package main
import (
"fmt"
"github.com/gabstv/go-app/v9/pkg/app"
)
type issue struct {
app.Compo
Iclass string
Ititle string
}
func newIssue() *issue {
return &issue{}
}
func (i *issue) Class(v string) *issue {
if v == "" {
return i
}
if i.Iclass != "" {
i.Iclass += " "
}
i.Iclass += v
return i
}
func (i *issue) Title(v string) *issue {
i.Ititle = v
return i
}
func (i *issue) Render() app.UI {
return app.Div().
Class(i.Iclass).
Body(
app.Div().
ID("report-issue").
Class("h2").
Class("header-separator").
Text("Report issue"),
app.P().Body(
app.Text("Found something incorrect, a typo or have suggestions to improve this article? "),
app.A().
Href(fmt.Sprintf(
"%s/issues/new?title=Documentation issues in %s",
githubURL,
i.Ititle,
)).
Text("Let me know :)"),
),
)
}