Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: experimental/webtry/webtry.go

Issue 244313007: Move to using HTML templates when filling out the workspace history. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: experimental/webtry/webtry.go
diff --git a/experimental/webtry/webtry.go b/experimental/webtry/webtry.go
index 73b1ae598af110ad94728223d5e9ab5036b966c1..a895b0117843088b2785d4d45639ea7db53249d7 100644
--- a/experimental/webtry/webtry.go
+++ b/experimental/webtry/webtry.go
@@ -346,8 +346,8 @@ func imageHandler(w http.ResponseWriter, r *http.Request) {
}
type Try struct {
- Hash string
- CreateTS string
+ Hash string `json:"hash"`
+ CreateTS string `json:"create_ts"`
}
type Recent struct {
@@ -418,7 +418,7 @@ func workspaceHandler(w http.ResponseWriter, r *http.Request) {
name := ""
if len(match) == 2 {
name = match[1]
- rows, err := db.Query("SELECT create_ts, hash FROM workspacetry WHERE name=? ORDER BY create_ts DESC ", name)
+ rows, err := db.Query("SELECT create_ts, hash FROM workspacetry WHERE name=? ORDER BY create_ts", name)
if err != nil {
reportError(w, r, err, "Failed to select.")
return
@@ -437,7 +437,7 @@ func workspaceHandler(w http.ResponseWriter, r *http.Request) {
if len(tries) == 0 {
code = DEFAULT_SAMPLE
} else {
- code = getCode(tries[0].Hash)
+ code = getCode(tries[len(tries)-1].Hash)
mtklein 2014/04/21 16:19:01 Undo?
jcgregorio 2014/04/21 16:26:24 This was intentional, the history list is construc
mtklein 2014/04/21 16:31:14 Ah! Missed the DESC change. Thanks.
}
if err := workspaceTemplate.Execute(w, Workspace{Tries: tries, Code: code, Name: name}); err != nil {
log.Printf("ERROR: Failed to expand template: %q\n", err)
« experimental/webtry/js/run.js ('K') | « experimental/webtry/templates/workspace.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698