Add raw link
This commit is contained in:
parent
1da1dfe53d
commit
f447299214
|
@ -29,6 +29,10 @@
|
||||||
<div class="page-header">
|
<div class="page-header">
|
||||||
<h1>{{.Title}}</h1>
|
<h1>{{.Title}}</h1>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="pull-right">
|
||||||
|
<button type="submit" href="{{.Link}}" class="btn btn-raised btn-primary">Raw<div class="ripple-container"></div></button>
|
||||||
|
|
||||||
|
</div>
|
||||||
<div class="well" style="padding-top: 10px;">
|
<div class="well" style="padding-top: 10px;">
|
||||||
<div class="form-group is-empty" style="margin-top: 0px;">
|
<div class="form-group is-empty" style="margin-top: 0px;">
|
||||||
<textarea class="form-control" rows="20" id="textArea">{{printf "%s" .Body}}</textarea>
|
<textarea class="form-control" rows="20" id="textArea">{{printf "%s" .Body}}</textarea>
|
||||||
|
|
2
main.go
2
main.go
|
@ -40,6 +40,7 @@ type Response struct {
|
||||||
type Page struct {
|
type Page struct {
|
||||||
Title string
|
Title string
|
||||||
Body []byte
|
Body []byte
|
||||||
|
Link string
|
||||||
}
|
}
|
||||||
|
|
||||||
func check(err error) {
|
func check(err error) {
|
||||||
|
@ -228,6 +229,7 @@ func pasteHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
p := &Page{
|
p := &Page{
|
||||||
Title: paste,
|
Title: paste,
|
||||||
Body: []byte(s),
|
Body: []byte(s),
|
||||||
|
Link: ADDRESS + "/raw/" + paste
|
||||||
}
|
}
|
||||||
t, err := template.ParseFiles("assets/paste.html")
|
t, err := template.ParseFiles("assets/paste.html")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue