]> source.dussan.org Git - gitea.git/commitdiff
Hide the registration button depending on the setting
authorRaphael Randschau <nicolai86@me.com>
Thu, 5 Feb 2015 16:09:38 +0000 (17:09 +0100)
committerRaphael Randschau <nicolai86@me.com>
Thu, 5 Feb 2015 17:15:00 +0000 (18:15 +0100)
routers/home.go
templates/home.tmpl

index dd604ec7e340d6e6bf85ccbf427e77b5d40b5945..24fc77e12a615a87f6844a7fe4ddff76d3a445b1 100644 (file)
@@ -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)
index 8603f26f416daff4d99bab23798f69a6c48c40ae..29865dbf9a20ae6c5b5f55fc3d543f437114ca7e 100644 (file)
@@ -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" .}}