-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from flimzy/doneCard
Done card
- Loading branch information
Showing
13 changed files
with
102 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,3 +66,4 @@ main.js.map | |
|
||
# go-bindata | ||
controllers/ankibasic/data.go | ||
repository/done/data.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Package done provides a single card to display when there is nothing left to | ||
// study. | ||
package done | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/FlashbackSRS/flashback/webclient/views/studyview" | ||
) | ||
|
||
// Card is a card displaying a "no cards to study" message | ||
type Card struct{} | ||
|
||
// GetCard returns the done card. | ||
func GetCard() *Card { | ||
return &Card{} | ||
} | ||
|
||
// DocID returns a dummy document ID. | ||
func (c *Card) DocID() string { | ||
return "<<done>>" | ||
} | ||
|
||
// Buttons returns the list of available buttons. As there is only one face | ||
// for Done cards, the face value is ignored. | ||
func (c *Card) Buttons(_ int) (studyview.ButtonMap, error) { | ||
return studyview.ButtonMap{ | ||
studyview.ButtonRight: studyview.ButtonState{ | ||
Name: "Check Again", | ||
Enabled: true, | ||
}, | ||
}, nil | ||
} | ||
|
||
// Action always returns true, to allow checking for new due cards. | ||
func (c *Card) Action(_ *int, _ time.Time, _ studyview.Button) (done bool, err error) { | ||
return true, nil | ||
} | ||
|
||
// Body returns the Done card body. | ||
func (c *Card) Body(_ int) (string, string, error) { | ||
body, err := Asset("done.html") | ||
if err != nil { | ||
return "", "", err | ||
} | ||
return string(body), "doneIFrame", nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../webclient/html/done.html |
Oops, something went wrong.