-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview_trades.go
More file actions
37 lines (31 loc) · 852 Bytes
/
view_trades.go
File metadata and controls
37 lines (31 loc) · 852 Bytes
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
package main
import (
"net/http"
)
// Cycle 1: Trades and offers view handlers
func (app *App) handleTradesView(w http.ResponseWriter, r *http.Request) {
data := struct {
Title string
CurrentPage string
}{
Title: "Market Trades - Obsrvr Intelligence Console",
CurrentPage: "trades",
}
if err := app.templates.ExecuteTemplate(w, "trades.html", data); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
}
func (app *App) handleOffersView(w http.ResponseWriter, r *http.Request) {
data := struct {
Title string
CurrentPage string
}{
Title: "Market Offers - Obsrvr Intelligence Console",
CurrentPage: "offers",
}
if err := app.templates.ExecuteTemplate(w, "offers.html", data); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
}