diff --git a/conf/app.ini b/conf/app.ini index f8ff81db7..cc7d0a907 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -7,6 +7,7 @@ LANG_IGNS=Google Go|C|Python|Ruby LICENSES=Apache v2 License|GPL v2|MIT License|BSD (3-Clause) License [server] +DOMAIN = gogits.org HTTP_ADDR = HTTP_PORT = 3000 diff --git a/modules/base/conf.go b/modules/base/conf.go index f1508d7a6..05412f387 100644 --- a/modules/base/conf.go +++ b/modules/base/conf.go @@ -18,6 +18,7 @@ import ( var ( AppVer string AppName string + Domain string Cfg *goconfig.ConfigFile ) @@ -58,4 +59,5 @@ func init() { Cfg.BlockMode = false AppName = Cfg.MustValue("", "APP_NAME") + Domain = Cfg.MustValue("server", "DOMAIN") } diff --git a/modules/base/template.go b/modules/base/template.go index 1a0b5977e..4517cd47a 100644 --- a/modules/base/template.go +++ b/modules/base/template.go @@ -19,6 +19,9 @@ var TemplateFuncs template.FuncMap = map[string]interface{}{ "AppVer": func() string { return AppVer }, + "AppDomain": func() string { + return Domain + }, "AvatarLink": AvatarLink, "str2html": Str2html, "TimeSince": TimeSince, diff --git a/public/css/gogs.css b/public/css/gogs.css index 668df4f7c..5352f8e39 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -415,16 +415,8 @@ html, body { margin-left: 0; } -.gogs-repo-btns { - margin-top: 18px; -} - -.gogs-repo-btns .btn-group { - margin-left: 1em; -} - -.gogs-repo-btns .btn-group .btn { - padding-left: 6px; +.gogs-repo-nav .actions { + padding-top: 20px; } #gogs-repo-watching .dropdown-menu { diff --git a/public/js/app.js b/public/js/app.js index 58633718f..30296bc33 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -40,6 +40,25 @@ var Gogits = { //container: "body" }); }; + Gogits.initPopovers = function () { + var hideAllPopovers = function() { + $('[data-toggle=popover]').each(function() { + $(this).popover('hide'); + }); + }; + + $(document).on('click', function(e) { + var $e = $(e.target); + if($e.data('toggle') == 'popover'||$e.parents("[data-toggle=popover], .popover").length > 0){ + return; + } + hideAllPopovers(); + }); + + $("body").popover({ + selector: "[data-toggle=popover]" + }); + }; Gogits.initTabs = function () { var $tabs = $('[data-init=tabs]'); $tabs.find("li:eq(0) a").tab("show"); @@ -76,6 +95,7 @@ var Gogits = { function initCore() { Gogits.initTooltips(); + Gogits.initPopovers(); Gogits.initTabs(); Gogits.initModals(); Gogits.renderMarkdown(); diff --git a/templates/repo/nav.tmpl b/templates/repo/nav.tmpl index 6637062a8..b41b62d5d 100644 --- a/templates/repo/nav.tmpl +++ b/templates/repo/nav.tmpl @@ -1,42 +1,41 @@
-
-
- - - +
+
+

{{.Owner.Name}} / {{.Repository.Name}}

-
- - -
\ No newline at end of file