فهرست منبع

Hide the registration button depending on the setting

Raphael Randschau 10 سال پیش
والد
کامیت
3c65265871
2فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 1 0
      routers/home.go
  2. 2 0
      templates/home.tmpl

+ 1 - 0
routers/home.go

@@ -41,6 +41,7 @@ func Home(ctx *middleware.Context) {
 		ctx.Data["OauthEnabled"] = true
 		ctx.Data["OauthService"] = setting.OauthService
 	}
+	ctx.Data["ShowRegistrationButton"] = setting.Service.ShowRegistrationButton
 
 	ctx.Data["PageIsHome"] = true
 	ctx.HTML(200, HOME)

+ 2 - 0
templates/home.tmpl

@@ -14,7 +14,9 @@
                 <input class="ipt ipt-large" name="password" type="password" placeholder="{{.i18n.Tr "home.password_holder"}}"/>
                 <input name="from" type="hidden" value="home">
                 <button class="btn btn-black btn-large">{{.i18n.Tr "sign_in"}}</button>
+                {{if .ShowRegistrationButton}}
                 <button class="btn btn-green btn-large" id="register-button">{{.i18n.Tr "register"}}</button>
+                {{end}}
             </form>
             <div id="promo-social" class="social-buttons">
                 {{template "ng/base/social" .}}