view_w_watch_list_add.go 873 B

1234567891011121314151617181920212223242526272829303132333435
  1. package route
  2. import "opennamu/route/tool"
  3. func View_w_watch_list_add(config tool.Config, doc_name string, do_type string) string {
  4. db := tool.DB_connect()
  5. defer tool.DB_close(db)
  6. switch do_type {
  7. case "watchlist_from":
  8. do_type = "watchlist"
  9. case "star_doc_from":
  10. do_type = "star_doc"
  11. }
  12. if do_type != "watchlist" {
  13. do_type = "star_doc"
  14. }
  15. out := tool.Get_template(
  16. db,
  17. config,
  18. doc_name,
  19. `<form method="post">
  20. <button id="opennamu_save_button" type="submit">` + tool.Get_language(db, "send", true) + `</button>
  21. </form>`,
  22. []any{ "(" + tool.Get_language(db, do_type, true) + ")" },
  23. [][]any{
  24. { "w/" + tool.Url_parser(doc_name), tool.Get_language(db, "return", true) },
  25. },
  26. map[string]string{},
  27. )
  28. return out
  29. }