#1080: Remove footer ads/branding from default template

This commit is contained in:
Unknwon 2015-03-23 10:19:19 -04:00
parent ade343f6dc
commit 2bb982dada
10 changed files with 23 additions and 8 deletions

View file

@ -288,3 +288,6 @@ ARGS =
[i18n] [i18n]
LANGS = en-US,zh-CN,zh-HK,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,ja-JP,es-ES,pt-BR,pl-PL LANGS = en-US,zh-CN,zh-HK,de-DE,fr-FR,nl-NL,lv-LV,ru-RU,ja-JP,es-ES,pt-BR,pl-PL
NAMES = English,简体中文,繁體中文,Deutsch,Français,Nederlands,Latviešu,Русский,日本语,Español,Português,Polski NAMES = English,简体中文,繁體中文,Deutsch,Français,Nederlands,Latviešu,Русский,日本语,Español,Português,Polski
[other]
SHOW_FOOTER_BRANDING = false

View file

@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/setting"
) )
const APP_VER = "0.6.0.0320 Beta" const APP_VER = "0.6.0.0323 Beta"
func init() { func init() {
runtime.GOMAXPROCS(runtime.NumCPU()) runtime.GOMAXPROCS(runtime.NumCPU())

View file

@ -50,10 +50,10 @@ type Version struct {
// If you want to "retire" a migration, remove it from the top of the list and // If you want to "retire" a migration, remove it from the top of the list and
// update _MIN_VER_DB accordingly // update _MIN_VER_DB accordingly
var migrations = []Migration{ var migrations = []Migration{
NewMigration("generate collaboration from access", accessToCollaboration), // V0 -> V1 NewMigration("generate collaboration from access", accessToCollaboration), // V0 -> V1:v0.5.13
NewMigration("make authorize 4 if team is owners", ownerTeamUpdate), // V1 -> V2 NewMigration("make authorize 4 if team is owners", ownerTeamUpdate), // V1 -> V2:v0.5.13
NewMigration("refactor access table to use id's", accessRefactor), // V2 -> V3 NewMigration("refactor access table to use id's", accessRefactor), // V2 -> V3:v0.5.13
NewMigration("generate team-repo from team", teamToTeamRepo), // V3 -> V4 NewMigration("generate team-repo from team", teamToTeamRepo), // V3 -> V4:v0.5.13
} }
// Migrate database to current version // Migrate database to current version

File diff suppressed because one or more lines are too long

View file

@ -209,6 +209,7 @@ func Contexter() macaron.Handler {
ctx.Data["CsrfTokenHtml"] = template.HTML(`<input type="hidden" name="_csrf" value="` + x.GetToken() + `">`) ctx.Data["CsrfTokenHtml"] = template.HTML(`<input type="hidden" name="_csrf" value="` + x.GetToken() + `">`)
ctx.Data["ShowRegistrationButton"] = setting.Service.ShowRegistrationButton ctx.Data["ShowRegistrationButton"] = setting.Service.ShowRegistrationButton
ctx.Data["ShowFooterBranding"] = setting.ShowFooterBranding
c.Map(ctx) c.Map(ctx)
} }

View file

@ -130,6 +130,9 @@ var (
// I18n settings. // I18n settings.
Langs, Names []string Langs, Names []string
// Other settings.
ShowFooterBranding bool
// Global setting objects. // Global setting objects.
Cfg *ini.File Cfg *ini.File
CustomPath string // Custom directory path. CustomPath string // Custom directory path.
@ -327,6 +330,8 @@ func NewConfigContext() {
Langs = Cfg.Section("i18n").Key("LANGS").Strings(",") Langs = Cfg.Section("i18n").Key("LANGS").Strings(",")
Names = Cfg.Section("i18n").Key("NAMES").Strings(",") Names = Cfg.Section("i18n").Key("NAMES").Strings(",")
ShowFooterBranding = Cfg.Section("other").Key("SHOW_FOOTER_BRANDING").MustBool()
HasRobotsTxt = com.IsFile(path.Join(CustomPath, "robots.txt")) HasRobotsTxt = com.IsFile(path.Join(CustomPath, "robots.txt"))
} }

View file

@ -1 +1 @@
0.6.0.0320 Beta 0.6.0.0323 Beta

View file

@ -5,10 +5,12 @@
© 2015 Gogs · {{.i18n.Tr "version"}}: {{AppVer}} · {{.i18n.Tr "page"}}: <strong>{{LoadTimes .PageStartTime}}</strong> · {{.i18n.Tr "template"}}: <strong>{{call .TmplLoadTimes}}</strong> © 2015 Gogs · {{.i18n.Tr "version"}}: {{AppVer}} · {{.i18n.Tr "page"}}: <strong>{{LoadTimes .PageStartTime}}</strong> · {{.i18n.Tr "template"}}: <strong>{{call .TmplLoadTimes}}</strong>
</div> </div>
<div class="ui right links"> <div class="ui right links">
{{if .ShowFooterBranding}}
<a target="_blank" href="https://github.com/gogits/gogs"><i class="fa fa-github-square"></i><span class="sr-only">GitHub</span></a> <a target="_blank" href="https://github.com/gogits/gogs"><i class="fa fa-github-square"></i><span class="sr-only">GitHub</span></a>
<a target="_blank" href="https://twitter.com/gogitservice"><i class="fa fa-twitter"></i><span class="sr-only">Twitter</span></a> <a target="_blank" href="https://twitter.com/gogitservice"><i class="fa fa-twitter"></i><span class="sr-only">Twitter</span></a>
<a target="_blank" href="https://plus.google.com/communities/115599856376145964459"><i class="fa fa-google-plus"></i><span class="sr-only">Google Plus</span></a> <a target="_blank" href="https://plus.google.com/communities/115599856376145964459"><i class="fa fa-google-plus"></i><span class="sr-only">Google Plus</span></a>
<a target="_blank" href="http://weibo.com/gogschina"><i class="fa fa-weibo"></i><span class="sr-only">Sina Weibo</span></a> <a target="_blank" href="http://weibo.com/gogschina"><i class="fa fa-weibo"></i><span class="sr-only">Sina Weibo</span></a>
{{end}}
<div class="ui language bottom pointing dropdown link item"> <div class="ui language bottom pointing dropdown link item">
<i class="world icon"></i> <i class="world icon"></i>
<div class="text">{{.LangName}}</div> <div class="text">{{.LangName}}</div>

View file

@ -10,9 +10,11 @@
</p> </p>
</div> </div>
{{if .ShowFooterBranding}}
<div class="col-md-2" style="margin: -5px;"> <div class="col-md-2" style="margin: -5px;">
<a target="_blank" href="https://github.com/gogits/gogs"><i class="fa fa-github fa-2x"></i></a> <a target="_blank" href="https://github.com/gogits/gogs"><i class="fa fa-github fa-2x"></i></a>
</div> </div>
{{end}}
<div class="col-md-4"> <div class="col-md-4">
<p class="desc"> <p class="desc">

View file

@ -5,10 +5,12 @@
{{.i18n.Tr "template"}}: <strong>{{call .TmplLoadTimes}}</strong></p> {{.i18n.Tr "template"}}: <strong>{{call .TmplLoadTimes}}</strong></p>
<div class="right" id="footer-links"> <div class="right" id="footer-links">
{{if .ShowFooterBranding}}
<a target="_blank" href="https://github.com/gogits/gogs"><i class="fa fa-github-square"></i></a> <a target="_blank" href="https://github.com/gogits/gogs"><i class="fa fa-github-square"></i></a>
<a target="_blank" href="https://twitter.com/gogitservice"><i class="fa fa-twitter"></i></a> <a target="_blank" href="https://twitter.com/gogitservice"><i class="fa fa-twitter"></i></a>
<a target="_blank" href="https://plus.google.com/communities/115599856376145964459"><i class="fa fa-google-plus"></i></a> <a target="_blank" href="https://plus.google.com/communities/115599856376145964459"><i class="fa fa-google-plus"></i></a>
<a target="_blank" href="http://weibo.com/gogschina"><i class="fa fa-weibo"></i></a> <a target="_blank" href="http://weibo.com/gogschina"><i class="fa fa-weibo"></i></a>
{{end}}
<div id="footer-lang" class="inline drop drop-top">{{.i18n.Tr "language"}} <div id="footer-lang" class="inline drop drop-top">{{.i18n.Tr "language"}}
<div class="drop-down"> <div class="drop-down">
<ul class="menu menu-vertical switching-list"> <ul class="menu menu-vertical switching-list">