Show login modal on header buttons if required
This commit is contained in:
parent
978785720a
commit
789289a290
|
@ -162,6 +162,12 @@ Discourse = Ember.Application.createWithMixins({
|
||||||
return loginController.authenticationComplete(options);
|
return loginController.authenticationComplete(options);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
loginRequired: function() {
|
||||||
|
return (
|
||||||
|
Discourse.SiteSettings.login_required && !Discourse.User.current()
|
||||||
|
);
|
||||||
|
}.property(),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Our own $.ajax method. Makes sure the .then method executes in an Ember runloop
|
Our own $.ajax method. Makes sure the .then method executes in an Ember runloop
|
||||||
for performance reasons. Also automatically adjusts the URL to support installs
|
for performance reasons. Also automatically adjusts the URL to support installs
|
||||||
|
|
|
@ -29,10 +29,34 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a class='icon expand' href='#' data-dropdown="search-dropdown" title='{{i18n search.title}}'><i class='icon-search'></i></a>
|
{{#if Discourse.loginRequired}}
|
||||||
|
<a class='icon expand' href='#' {{action showLogin}}>
|
||||||
|
<i class='icon-search'></i>
|
||||||
|
</a>
|
||||||
|
{{else}}
|
||||||
|
<a class='icon expand'
|
||||||
|
href='#'
|
||||||
|
data-dropdown="search-dropdown"
|
||||||
|
title='{{i18n search.title}}'>
|
||||||
|
<i class='icon-search'></i>
|
||||||
|
</a>
|
||||||
|
{{/if}}
|
||||||
</li>
|
</li>
|
||||||
<li class='categories dropdown'>
|
<li class='categories dropdown'>
|
||||||
<a class='icon' data-dropdown="site-map-dropdown" href="#" title='{{i18n site_map}}'><i class='icon-reorder'></i></a>
|
{{#if Discourse.loginRequired}}
|
||||||
|
<a class='icon'
|
||||||
|
href="#"
|
||||||
|
{{action showLogin}}>
|
||||||
|
<i class='icon-reorder'></i>
|
||||||
|
</a>
|
||||||
|
{{else}}
|
||||||
|
<a class='icon'
|
||||||
|
data-dropdown="site-map-dropdown"
|
||||||
|
href="#"
|
||||||
|
title='{{i18n site_map}}'>
|
||||||
|
<i class='icon-reorder'></i>
|
||||||
|
</a>
|
||||||
|
{{/if}}
|
||||||
{{#if currentUser.site_flagged_posts_count}}
|
{{#if currentUser.site_flagged_posts_count}}
|
||||||
<a href='/admin/flags/active' title='{{i18n notifications.total_flagged}}' class='badge-notification flagged-posts'>{{currentUser.site_flagged_posts_count}}</a>
|
<a href='/admin/flags/active' title='{{i18n notifications.total_flagged}}' class='badge-notification flagged-posts'>{{currentUser.site_flagged_posts_count}}</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
Loading…
Reference in New Issue