FEATURE: show login and signup button on no-ember layout (#7867)
This commit is contained in:
parent
7b0517895e
commit
324e182842
|
@ -15,6 +15,23 @@
|
|||
display: flex;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
|
||||
.header-row {
|
||||
width: 100%;
|
||||
|
||||
.logo-wrapper {
|
||||
float: left;
|
||||
}
|
||||
.auth-buttons {
|
||||
float: right;
|
||||
margin-top: 0.4em;
|
||||
|
||||
.login-button,
|
||||
.signup-button {
|
||||
padding: 8px 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -501,4 +501,10 @@ module ApplicationHelper
|
|||
end
|
||||
absolute_url
|
||||
end
|
||||
|
||||
def can_sign_up?
|
||||
SiteSetting.allow_new_registrations &&
|
||||
!SiteSetting.invite_only &&
|
||||
!SiteSetting.enable_sso
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<header class="d-header">
|
||||
<div class="wrap">
|
||||
<div class="contents">
|
||||
<div class="row">
|
||||
<div class="header-row">
|
||||
<div class="logo-wrapper">
|
||||
<a href="<%= path "/" %>">
|
||||
<%- if application_logo_url.present? %>
|
||||
|
@ -12,6 +12,14 @@
|
|||
<%- end %>
|
||||
</a>
|
||||
</div>
|
||||
<%- unless current_user %>
|
||||
<div class='auth-buttons'>
|
||||
<%- if can_sign_up? %>
|
||||
<a href="<%= path "/signup"%>" class='btn btn-primary btn-small signup-button'><%= I18n.t('sign_up') %></a>
|
||||
<%- end %>
|
||||
<a href="<%= path "/login"%>" class='btn btn-primary btn-small login-button'><%= I18n.t('log_in') %></a>
|
||||
</div>
|
||||
<%- end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -64,6 +64,7 @@ en:
|
|||
posts: "posts"
|
||||
loading: "Loading"
|
||||
powered_by_html: 'Powered by <a href="https://www.discourse.org">Discourse</a>, best viewed with JavaScript enabled'
|
||||
sign_up: "Sign Up"
|
||||
log_in: "Log In"
|
||||
submit: "Submit"
|
||||
purge_reason: "Automatically deleted as abandoned, deactivated account"
|
||||
|
|
Loading…
Reference in New Issue