Example #1
0
func viewInit() {
	// Load layout template
	layout := kview.New("layout.kt")

	// Load template which shows list of articles
	article_list := kview.New("list.kt")

	// Create main page
	main_view = layout.Copy()
	main_view.Div("left", article_list)
	main_view.Div("right", kview.New("show.kt", utils))

	// Create edit page
	edit_view = layout.Copy()
	edit_view.Div("left", article_list)
	edit_view.Div("right", kview.New("edit.kt"))
}
Example #2
0
File: main.go Project: ziutek/de
func main() {
	page = kview.New("page.kt")
	http.HandleFunc("/", html)
	http.Handle("/img", Img)
	http.Handle("/data", websocket.Handler(data))
	log.Printf("Web server (at %s) is ready.\n", listenOn)
	http.ListenAndServe(listenOn, nil)
}
Example #3
0
func init() {
	// 加载 layout 模板
	layout := kview.New("layout.kt")

	// 加载用来展示文章列表的模板
	article_list := kview.New("list.kt")

	// 创建主页面
	main_view = layout.Copy()
	main_view.Div("left", article_list)
	main_view.Div("right", kview.New("show.kt", utils))

	// 创建编辑页面
	edit_view = layout.Copy()
	edit_view.Div("left", article_list)
	edit_view.Div("right", kview.New("edit.kt"))
}
Example #4
0
File: view.go Project: ziutek/kview
func viewInit() {
	layout := kview.New("layout.kt")
	menu := kview.New("menu.kt")

	// Create right column
	right := kview.New("right.kt")
	// Add view components
	right.Div("info", kview.New("right/info.kt"))
	right.Div("commercial", kview.New("right/commercial.kt"))

	// Create home view as layout copy.
	home_view = layout.Copy()
	home_view.Div("menu", menu)
	home_view.Div("left", kview.New("left/home.kt"))
	home_view.Div("right", right)

	// Create edit view.
	edit_view = layout.Copy()
	edit_view.Div("menu", menu)
	edit_view.Div("left", kview.New("left/edit.kt"))
	edit_view.Div("right", right)
}
Example #5
0
func viewInit() {
	// Load layout templates
	layout := kview.New("index.kt")
	layoutArticle := kview.New("index/index_view.kt")
	layoutdelArticle := kview.New("index/delindex_view.kt")
	layoutEntry := kview.New("entries/entry_view.kt")
	layoutComments := kview.New("entries.kt")
	layoutComments2 := kview.New("entries/entries2.kt")
	layoutCommentsFail := kview.New("entries/entriesfail.kt")
	layoutCommentsFail2 := kview.New("entries/entries2fail.kt")
	layoutdelEntry := kview.New("entries/delentry_view.kt")
	layoutFoot1 := kview.New("index/foot1.kt")
	layoutFoot2 := kview.New("index/foot2.kt")
	layoutLast := kview.New("index/lastpost_view.kt")
	layoutSearch := kview.New("index/search.kt")
	layoutSearchview := kview.New("index/search_view.kt")
	layoutAdmin := kview.New("admin.kt")
	layoutAdmin2 := kview.New("admin/admin2.kt")
	layoutAdmin3 := kview.New("admin/admin3.kt")

	// Index page
	index = layout.Copy()
	index.Div("content", layoutArticle)

	foot1 = layoutFoot1.Copy()
	foot2 = layoutFoot2.Copy()
	foot1.Div("login", kview.New("index/login.kt"))
	foot1.Div("version", kview.New("index/version.kt"))
	foot2.Div("lastpost", layoutLast)

	index_view = layoutArticle.Copy()
	index_view.Div("post", kview.New("index/art.kt"))

	// Admin delete article procedure
	index.Div("delcontent", layoutdelArticle)
	index_del = layoutdelArticle.Copy()
	index_del.Div("delart", kview.New("index/delart.kt"))

	// Common Last published
	foot_last = layoutLast.Copy()
	foot_last.Div("last", kview.New("index/lastpost.kt"))

	// Common Search
	searching = layoutSearch.Copy()
	searching.Div("searching", layoutSearchview)
	results = layoutSearchview.Copy()
	results.Div("results", kview.New("index/results.kt"))

	// Admin page
	adminshow = layoutAdmin.Copy()
	adminshow2 = layoutAdmin2.Copy()
	adminshow3 = layoutAdmin3.Copy()

	// Comment page
	comment = layoutComments.Copy()
	comment.Div("article", kview.New("entries/single.kt"))
	comment.Div("artitle", kview.New("entries/title.kt"))
	comment2 = layoutComments2.Copy()
	comment2.Div("artitid", kview.New("entries/threadid.kt"))
	comment2.Div("captch", kview.New("entries/captcha.kt"))

	comment_view = layoutEntry.Copy()
	comment_view.Div("contenty", layoutEntry)
	comment_view.Div("comment", kview.New("entries/comment.kt"))

	// Admin delete entry procedure
	comment.Div("delcontenty", layoutdelEntry)
	comment_del = layoutdelEntry.Copy()
	comment_del.Div("delcomment", kview.New("entries/delcomment.kt"))

	// Comment page when captcha is failed after updateEntry()
	commentfail = layoutCommentsFail.Copy()
	commentfail.Div("articlefail", kview.New("entries/singlefail.kt"))
	commentfail.Div("artitlefail", kview.New("entries/title.kt"))
	commentfail2 = layoutCommentsFail2.Copy()
	commentfail2.Div("artitidfail", kview.New("entries/threadid.kt"))
	commentfail2.Div("captchfail", kview.New("entries/captcha.kt"))
}