Add raw link
This commit is contained in:
parent
1da1dfe53d
commit
f447299214
|
@ -29,6 +29,10 @@
|
|||
<div class="page-header">
|
||||
<h1>{{.Title}}</h1>
|
||||
</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="form-group is-empty" style="margin-top: 0px;">
|
||||
<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 {
|
||||
Title string
|
||||
Body []byte
|
||||
Link string
|
||||
}
|
||||
|
||||
func check(err error) {
|
||||
|
@ -228,6 +229,7 @@ func pasteHandler(w http.ResponseWriter, r *http.Request) {
|
|||
p := &Page{
|
||||
Title: paste,
|
||||
Body: []byte(s),
|
||||
Link: ADDRESS + "/raw/" + paste
|
||||
}
|
||||
t, err := template.ParseFiles("assets/paste.html")
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue