Пример #1
0
// Get implemented Get method for SamplesRouter.
func (this *SamplesRouter) Get() {
	this.Data["IsSamples"] = true

	reqUrl := this.Ctx.Request.URL.String()
	sec := reqUrl[strings.LastIndex(reqUrl, "/")+1:]
	if qm := strings.Index(sec, "?"); qm > -1 {
		sec = sec[:qm]
	}

	if len(sec) == 0 || sec == "samples" {
		this.Redirect("/samples/Samples_Introduction", 302)
		return
	} else {
		this.Data[sec] = true
	}

	// Get language.
	curLang, _ := this.Data["LangVer"].(langType)
	df := models.GetDoc(sec, curLang.Lang)
	if df == nil {
		this.Redirect("/samples/Samples_Introduction", 302)
		return
	}

	this.Data["Title"] = df.Title
	this.Data["Data"] = string(df.Data)
	this.Data["IsHasMarkdown"] = true
	this.TplName = "samples_" + curLang.Lang + ".html"
}
Пример #2
0
// Get implemented Get method for DocsRouter.
func (this *DocsRouter) Get() {
	// Set language version.
	curLang := globalSetting(this.Ctx, this.Input(), this.Data)

	this.Data["IsDocs"] = true

	reqUrl := this.Ctx.Request.URL.String()
	sec := reqUrl[strings.LastIndex(reqUrl, "/")+1:]
	if qm := strings.Index(sec, "?"); qm > -1 {
		sec = sec[:qm]
	}

	if len(sec) == 0 || sec == "docs" {
		this.Redirect("/docs/Overview_Introduction", 302)
		return
	} else {
		this.Data[sec] = true
	}

	df := models.GetDoc(sec, curLang.Lang)
	if df == nil {
		this.Redirect("/docs/Overview_Introduction", 302)
		return
	}
	this.Data["Title"] = df.Title
	this.Data["Data"] = string(df.Data)
	this.Data["IsHasMarkdown"] = true
	this.TplNames = "docs_" + curLang.Lang + ".html"
}
Пример #3
0
// Get implemented Get method for CommunityRouter.
func (this *CommunityRouter) Get() {
	this.Data["IsCommunity"] = true
	this.TplNames = "community.html"

	df := models.GetDoc("usecases", this.Lang)
	this.Data["Section"] = "usecases"
	this.Data["Data"] = string(df.Data)
}
Пример #4
0
// Get implemented Get method for VideoRouter.
func (this *VideoRouter) Get() {
	this.Data["IsVideo"] = true
	this.TplName = "video.html"

	df := models.GetDoc("screencasts", this.Lang)
	this.Data["Section"] = "screencasts"
	this.Data["Data"] = string(df.Data)
	this.Data["IsHasMarkdown"] = true
}
Пример #5
0
func (this *AboutRouter) Get() {
	this.Data["IsAbout"] = true
	this.TplName = "about.html"

	// Get language.
	df := models.GetDoc("about", this.Lang)
	this.Data["Title"] = df.Title
	this.Data["Data"] = string(df.Data)
}
Пример #6
0
func (this *PageRouter) Get() {
	this.Data["IsTeam"] = true
	this.TplName = "team.html"

	// Get language.
	df := models.GetDoc("team", this.Lang)
	this.Data["Title"] = df.Title
	this.Data["Data"] = string(df.Data)
}
Пример #7
0
// Get implemented Get method for DonateRouter.
func (this *DonateRouter) Get() {
	this.Data["IsDonate"] = true
	this.TplNames = "donate.html"

	// Get language.
	df := models.GetDoc("donate", "zh-CN")
	this.Data["Title"] = df.Title
	this.Data["Data"] = string(df.Data)
	this.Data["IsHasMarkdown"] = true
}
Пример #8
0
// Get implemented Get method for QuickStartRouter.
func (this *QuickStartRouter) Get() {
	this.Data["IsQuickStart"] = true
	this.TplNames = "quickstart.html"

	df := models.GetDoc("quickstart", this.Lang)
	this.Data["Section"] = "quickstart"
	this.Data["Title"] = df.Title
	this.Data["Data"] = string(df.Data)
	this.Data["IsHasMarkdown"] = true
}
Пример #9
0
// Get implemented Get method for QuickStartRouter.
func (this *QuickStartRouter) Get() {
	// Set language version.
	curLang := globalSetting(this.Ctx, this.Input(), this.Data)

	this.Data["IsQuickStart"] = true
	df := models.GetDoc("quickstart", curLang.Lang)
	this.Data["Title"] = df.Title
	this.Data["Data"] = string(df.Data)
	this.Data["IsHasMarkdown"] = true
	this.TplNames = "quickstart_" + curLang.Lang + ".html"
}
Пример #10
0
// Get implemented Get method for QuickStartRouter.
func (this *QuickStartRouter) Get() {
	this.Data["IsQuickStart"] = true

	// Get language.
	curLang, _ := this.Data["LangVer"].(langType)
	df := models.GetDoc("quickstart", curLang.Lang)
	this.Data["Title"] = df.Title
	this.Data["Data"] = string(df.Data)
	this.Data["IsHasMarkdown"] = true
	this.TplNames = "quickstart_" + curLang.Lang + ".html"
}
Пример #11
0
// Get implemented Get method for DocsRouter.
func (this *DocsRouter) Get() {
	this.Data["IsDocs"] = true
	this.TplNames = "docs.html"

	reqUrl := this.Ctx.Request.URL.String()
	fullName := reqUrl[strings.LastIndex(reqUrl, "/")+1:]
	if qm := strings.Index(fullName, "?"); qm > -1 {
		fullName = fullName[:qm]
	}

	this.Data["Sections"] = models.TplTree.Sections

	if fullName == "docs" {
		this.Redirect("/docs/Overview_Introduction", 302)
		return
	}

	df := models.GetDoc(fullName, this.Lang)
	if df == nil {
		this.Redirect("/docs/Overview_Introduction", 302)
		return
	}

	this.Data[fullName] = true

	// Set showed section.
	i := strings.Index(fullName, "_")
	if i > -1 {
		sec := fullName[:i]
		node := fullName[i+1:]
		this.Data["Section"] = getSection(sec)
		this.Data["Node"] = node
		this.Data["FullName"] = fullName
	}
	this.Data["Title"] = df.Title
	this.Data["Data"] = string(df.Data)
	this.Data["IsHasMarkdown"] = true
}