confirm-dialog.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package basics
  2. import (
  3. "fmt"
  4. "path"
  5. "strings"
  6. "github.com/qor5/docs/docsrc/examples/example_basics"
  7. "github.com/qor5/docs/docsrc/generated"
  8. "github.com/qor5/docs/docsrc/utils"
  9. . "github.com/theplant/docgo"
  10. "github.com/theplant/docgo/ch"
  11. )
  12. var ConfirmDialog = Doc(
  13. Markdown(fmt.Sprintf("`%s`", strings.TrimRight(generated.OpenConfirmDialog, ","))+`
  14. is a pre-defined event used to show a confirm dialog for user to do confirm before executing the actual action.
  15. `+
  16. `
  17. ### Queries
  18. `+fmt.Sprintf("`%s` ", strings.TrimRight(generated.ConfirmDialogConfirmEvent, ","))+
  19. `
  20. required
  21. Usually the value will be *web.Plaid().EventFunc(the actual action event)....Go()*.
  22. `+fmt.Sprintf("`%s` ", strings.TrimRight(generated.ConfirmDialogPromptText, ","))+
  23. `
  24. optional
  25. To customize the prompt text.
  26. `+fmt.Sprintf("`%s` ", strings.TrimRight(generated.ConfirmDialogDialogPortalName, ","))+
  27. `
  28. optional
  29. To use a custom portal for dialog.
  30. `),
  31. Markdown(`
  32. ## Example
  33. `),
  34. ch.Code(generated.ConfirmDialogSample).Language("go"),
  35. utils.Demo(
  36. "Confirm Dialog",
  37. path.Join(example_basics.PresetsConfirmDialogPath, "/confirm-dialog"),
  38. "example_basics/confirm-dialog.go",
  39. ),
  40. ).Slug("basics/confirm-dialog").Title("Confirm Dialog")