Skip to content

Commit

Permalink
Improved UI
Browse files Browse the repository at this point in the history
  • Loading branch information
unknwon committed Oct 29, 2013
1 parent c50e2cd commit 751ff2c
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 20 deletions.
2 changes: 1 addition & 1 deletion beeweb.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
)

const (
APP_VER = "0.5.5.0929"
APP_VER = "0.5.6.1029"
)

// We have to call a initialize function manully
Expand Down
6 changes: 3 additions & 3 deletions models/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ func InitModels() {
// ATTENTION: you'd better comment following code when developing.

// Start check ticker.
// checkTicker = time.NewTicker(5 * time.Minute)
// go checkTickerTimer(checkTicker.C)
checkTicker = time.NewTicker(5 * time.Minute)
go checkTickerTimer(checkTicker.C)

// checkDocUpdates()
checkDocUpdates()
}

func initDocMap() {
Expand Down
2 changes: 2 additions & 0 deletions routers/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ func (this *DocsRouter) Get() {
return
}

this.Data["Section"] = sec

// Set showed section.
i := strings.Index(sec, "_")
if i == -1 {
Expand Down
8 changes: 6 additions & 2 deletions views/T.footer.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,15 @@
node = node.wrap('<div id="' + val + '" class="anchor-wrap" ></div>');
node.append('<a class="anchor" href="#' + val + '"><span class="octicon octicon-link"></span></a>')
});
{{end}}
$('.accordion').on('show hide', function (n) {
$(n.target).siblings('.accordion-heading').find('i').toggleClass('fa-chevron-right fa-chevron-down');
});
{{end}}
})(jQuery);
$(function(){
if (($("#navlist").height()+80)>$(window).height()){
if (($("#navlist").height()+80)>$(window).height()) {
$("#navlist").css({"overflow-y":"scroll","height":($(window).height()-100)})
}else{
$("#navlist").css({"overflow-y":"","height":"auto"})
Expand Down
2 changes: 2 additions & 0 deletions views/T.header.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<link href="/static/css/main.css" rel="stylesheet" />
<link href="/static/css/link.css" rel="stylesheet" />
<link href="/static/css/github.css" rel="stylesheet" />
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.1/css/font-awesome.css" rel="stylesheet">
{{end}}

{{define "header_zh"}}
Expand All @@ -30,4 +31,5 @@
<link href="/static/css/main.css" rel="stylesheet" />
<link href="/static/css/link.css" rel="stylesheet" />
<link href="/static/css/github.css" rel="stylesheet" />
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.1/css/font-awesome.css" rel="stylesheet">
{{end}}
17 changes: 10 additions & 7 deletions views/docs_en.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="accordion" id="navlist">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Overview">Overview</a>
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Overview"><i class="fa fa-chevron-{{if .IsOverview}}down{{else}}right{{end}}"></i> Overview</a>
</div>

<div id="nav_Overview" class="accordion-body collapse {{if .IsOverview}}in{{end}}">
Expand All @@ -25,7 +25,7 @@

<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Controllers">Controllers</a>
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Controllers"><i class="fa fa-chevron-{{if .IsControllers}}down{{else}}right{{end}}"></i> Controllers</a>
</div>

<div id="nav_Controllers" class="accordion-body collapse {{if .IsControllers}}in{{end}}">
Expand All @@ -46,7 +46,7 @@

<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Views">Views</a>
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Views"><i class="fa fa-chevron-{{if .IsViews}}down{{else}}right{{end}}"></i> Views</a>
</div>

<div id="nav_Views" class="accordion-body collapse {{if .IsViews}}in{{end}}">
Expand All @@ -58,7 +58,7 @@

<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Models">Models</a>
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Models"><i class="fa fa-chevron-{{if .IsModels}}down{{else}}right{{end}}"></i> Models</a>
</div>

<div id="nav_Models" class="accordion-body collapse {{if .IsModels}}in{{end}}">
Expand All @@ -80,7 +80,7 @@

<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Operational">Operational</a>
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Operational"><i class="fa fa-chevron-{{if .IsOperational}}down{{else}}right{{end}}"></i> Operational</a>
</div>

<div id="nav_Operational" class="accordion-body collapse {{if .IsOperational}}in{{end}}">
Expand All @@ -95,7 +95,7 @@

<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Reference">Reference</a>
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Reference"><i class="fa fa-chevron-{{if .IsReference}}down{{else}}right{{end}}"></i> Reference</a>
</div>

<div id="nav_Reference" class="accordion-body collapse {{if .IsReference}}in{{end}}">
Expand All @@ -113,7 +113,10 @@

<div class="span10">
<div class="page-header">
<h1>{{.Title}}</h1>
<h1>
{{.Title}}
<a href="https://github.com/beego/beedoc/blob/master/{{.LangVer.Lang}}/{{.Section}}.md" class="pull-right btn btn-info" target="_blank">Improve this page on GitHub</a>
</h1>
</div>

<div id="markdown" class="markdown span10">{{.Data | str2html}}</div>
Expand Down
17 changes: 10 additions & 7 deletions views/docs_zh.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="accordion" id="navlist">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Overview">文档概述</a>
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Overview"><i class="fa fa-chevron-{{if .IsOverview}}down{{else}}right{{end}}"></i> 文档概述</a>
</div>

<div id="nav_Overview" class="accordion-body collapse {{if .IsOverview}}in{{end}}">
Expand All @@ -25,7 +25,7 @@

<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Controllers">控制器(Ctrlers)</a>
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Controllers"><i class="fa fa-chevron-{{if .IsControllers}}down{{else}}right{{end}}"></i> 控制器(Ctrlers)</a>
</div>

<div id="nav_Controllers" class="accordion-body collapse {{if .IsControllers}}in{{end}}">
Expand All @@ -46,7 +46,7 @@

<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Views">视图(Views)</a>
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Views"><i class="fa fa-chevron-{{if .IsViews}}down{{else}}right{{end}}"></i> 视图(Views)</a>
</div>

<div id="nav_Views" class="accordion-body collapse {{if .IsViews}}in{{end}}">
Expand All @@ -58,7 +58,7 @@

<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Models">模型(Models)</a>
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Models"><i class="fa fa-chevron-{{if .IsModels}}down{{else}}right{{end}}"></i> 模型(Models)</a>
</div>

<div id="nav_Models" class="accordion-body collapse {{if .IsModels}}in{{end}}">
Expand All @@ -80,7 +80,7 @@

<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Operational">运维管理</a>
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Operational"><i class="fa fa-chevron-{{if .IsOperational}}down{{else}}right{{end}}"></i> 运维管理</a>
</div>

<div id="nav_Operational" class="accordion-body collapse {{if .IsOperational}}in{{end}}">
Expand All @@ -95,7 +95,7 @@

<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Reference">其它说明</a>
<a class="accordion-toggle nav-header" data-toggle="collapse" data-parent="#navlist" href="#nav_Reference"><i class="fa fa-chevron-{{if .IsReference}}down{{else}}right{{end}}"></i> 其它说明</a>
</div>

<div id="nav_Reference" class="accordion-body collapse {{if .IsReference}}in{{end}}">
Expand All @@ -113,7 +113,10 @@

<div class="span10">
<div class="page-header">
<h1>{{.Title}}</h1>
<h1>
{{.Title}}
<a href="https://github.com/beego/beedoc/blob/master/{{.LangVer.Lang}}/{{.Section}}.md" class="pull-right btn btn-info" target="_blank">到 GitHub 上改进本页面</a>
</h1>
</div>

<div id="markdown" class="markdown span10">{{.Data | str2html}}</div>
Expand Down

0 comments on commit 751ff2c

Please sign in to comment.