added variable templating, template parts
This commit is contained in:
@ -3,6 +3,7 @@ package manager
|
||||
// package for the web menagment of the api paths
|
||||
|
||||
import (
|
||||
"api_manager/lib"
|
||||
"api_manager/web/api"
|
||||
"api_manager/web/render"
|
||||
"fmt"
|
||||
@ -29,3 +30,18 @@ func Show_apis(w http.ResponseWriter, req *http.Request) {
|
||||
|
||||
fmt.Fprint(w, render.Template_with_string(eval))
|
||||
}
|
||||
|
||||
func Render_apis(w http.ResponseWriter, req *http.Request) {
|
||||
apis := api.Apis()
|
||||
eval := "<div>"
|
||||
for tag, varr := range apis {
|
||||
eval_group := ""
|
||||
eval_group += tag
|
||||
eval_group += "-"
|
||||
eval_group += fmt.Sprintf("%v", varr)
|
||||
eval_group += "<br>"
|
||||
eval += eval_group
|
||||
}
|
||||
eval += "</div>"
|
||||
fmt.Fprint(w, render.Put_vars_to_template(render.Template_with_part("json_out"), lib.Map_args("json_code", eval)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user