func (VS *Server) showEditStep(c *gin.Context) {
	service, b := VS.getOurService(c, "h_videos", "showEditStep", "service, _ := VS.getOurService")
	if !b {
		return
	}
	id, b := VS.getIDParamFromURL(c, "id")
	if !b {
		return
	}

	// Get the /number param of the URL
	numberURL, b := VS.getParamFromURL(c, "current-step")
	if !b {
		return
	}
	n, err := strconv.Atoi(numberURL)
	VS.checkOperation(c, "h_videos", "showEditStep", "n, err := strconv.Atoi(numberURL)", err)
	numberNoURL := n + 1

	// Get the Product from DataBase
	product, _ := VS.getVideoCourseByID(c, id, "h_videos", "showEditStep", "product, _ := VS.getVideoCourseByID", true)
	steps := VS.getAllStepsFromSpecificVideoCourse(c, id, "h_videos", "showEditStep", "steps := VS.getAllStepsFromSpecificVideoCourse")
	tools := VS.getAllItemsForRent(c, service.TypeID)
	materials := VS.getAllItemsForSell(c, service.TypeID)
	// step := VS.getStepByProductIDAndIndexOrder(c, product.ID, n, "h_videos", "showEditStep", "step := VS.getStepByProductIDAndIndexOrder")
	step := steps[n]

	fmt.Print("All ssteps i DB")
	fmt.Print(len(steps))
	// Check for a translation in another language
	trans, b := VS.mayLookForTranslation(c, step.ID)
	if b {
		step = trans.(Step)
	}

	var pagination []Pagination
	var p Pagination
	for i := 0; i < len(steps); i++ {
		p.Active = false
		p.Fakenumb = i + 1
		pagination = append(pagination, p)
	}
	pagination[n].Active = true

	render(c, gin.H{
		"product":     product,
		"numStep":     numberNoURL,
		"tools":       tools,
		"step":        step,
		"edit":        true,
		"materials":   materials,
		"id":          id.Hex(),
		"pagination":  pagination,
		"serviceType": service.TypeID,
	}, "form-step.html")
}
// Shows the page with the information of the Step to modify
Shows the page with the information of the Step to modify
// Shows the page with the information of the Step to modify
func (VS *Server) showEditStep(c *gin.Context) {
	service, b := VS.getOurService(c, "h_videos", "showEditStep", "service, _ := VS.getOurService")
	if !b {
		return
	}
	id, b := VS.getIDParamFromURL(c, "id")
	if !b {
		return
	}
	numberURL, b := VS.getParamFromURL(c, "current-step")
	if !b {
		return
	}
	n, err := strconv.Atoi(numberURL)
	VS.checkOperation(c, "h_videos", "showEditStep", "n, err := strconv.Atoi(numberURL)", err)
	numberNoURL := n + 1
	product, _ := VS.getVideoCourseByID(c, id, "h_videos", "showEditStep", "product, _ := VS.getVideoCourseByID", true)
	steps := VS.getAllStepsFromSpecificVideoCourse(c, id, "h_videos", "showEditStep", "steps := VS.getAllStepsFromSpecificVideoCourse")
	tools := VS.getAllItemsForRent(c, service.TypeID)
	materials := VS.getAllItemsForSell(c, service.TypeID)
	step := steps[n]
	fmt.Print("All ssteps i DB")
	fmt.Print(len(steps))
	trans, b := VS.mayLookForTranslation(c, step.ID)
	if b {
		step = trans.(Step)
	}
	var pagination []Pagination
	var p Pagination
	for i := 0; i < len(steps); i++ {
		p.Active = false
		p.Fakenumb = i + 1
		pagination = append(pagination, p)
	}
	pagination[n].Active = true
	render(c, gin.H{
		"product":     product,
		"numStep":     numberNoURL,
		"tools":       tools,
		"step":        step,
		"edit":        true,
		"materials":   materials,
		"id":          id.Hex(),
		"pagination":  pagination,
		"serviceType": service.TypeID,
	}, "form-step.html")
}
func ( VS * Server ) showEditStep ( c * gin . Context ) { service , b := VS . getOurService ( c , " " , " " , " " ) if ! b { return } id , b := VS . getIDParamFromURL ( c , " " ) if ! b { return } numberURL , b := VS . getParamFromURL ( c , " " ) if ! b { return } n , err := strconv . Atoi ( numberURL ) VS . checkOperation ( c , " " , " " , " " , err ) numberNoURL := n + 1 product , _ := VS . getVideoCourseByID ( c , id , " " , " " , " " , true ) steps := VS . getAllStepsFromSpecificVideoCourse ( c , id , " " , " " , " " ) tools := VS . getAllItemsForRent ( c , service . TypeID ) materials := VS . getAllItemsForSell ( c , service . TypeID ) step := steps [ n ] fmt . Print ( " " ) fmt . Print ( len ( steps ) ) trans , b := VS . mayLookForTranslation ( c , step . ID ) if b { step = trans . ( Step ) } var pagination [ ] Pagination var p Pagination for i := 0 ; i < len ( steps ) ; i ++ { p . Active = false p . Fakenumb = i + 1 pagination = append ( pagination , p ) } pagination [ n ] . Active = true render ( c , gin . H { " " : product , " " : numberNoURL , " " : tools , " " : step , " " : true , " " : materials , " " : id . Hex ( ) , " " : pagination , " " : service . TypeID , } , " " ) }
Shows the page with the information of the Step to modify
Shows the page with the information of the Step to modify
// Get the /number param of the URL // Get the Product from DataBase // step := VS.getStepByProductIDAndIndexOrder(c, product.ID, n, "h_videos", "showEditStep", "step := VS.getStepByProductIDAndIndexOrder") // Check for a translation in another language