mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 13:05:42 +00:00
Fix for SOCIALACCOUNT_PROVIDERS (#4124)
* Fix for SOCIALACCOUNT_PROVIDERS - Default (empty) setting should be dict, not list * Add extra examples to config template file * Add extra helper string * Re-implement brand icons for login screen
This commit is contained in:
@ -101,6 +101,18 @@ $(document).ready(function () {
|
||||
|
||||
showCachedAlerts();
|
||||
|
||||
// Add brand icons for SSO providers, if available
|
||||
$('.socialaccount_provider').each(function(i, obj) {
|
||||
var el = $(this);
|
||||
var tag = el.attr('brand_name');
|
||||
|
||||
var icon = window.FontAwesome.icon({prefix: 'fab', iconName: tag});
|
||||
|
||||
if (icon) {
|
||||
el.append(` <span class='fab fa-${tag}'></span>`);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
@ -38,7 +38,7 @@ for a account and sign in below:{% endblocktrans %}</p>
|
||||
{% if login_message %}
|
||||
<div>{{ login_message | safe }}<hr></div>
|
||||
{% endif %}
|
||||
<div class="btn-group float-right" role="group">
|
||||
<div class="btn-group" role="group">
|
||||
<button class="btn btn-success" type="submit">
|
||||
<span class='fas fa-sign-in-alt'></span> {% trans "Sign In" %}
|
||||
</button>
|
||||
@ -49,8 +49,8 @@ for a account and sign in below:{% endblocktrans %}</p>
|
||||
</form>
|
||||
|
||||
{% if enable_sso %}
|
||||
<br>
|
||||
<h4 class="text-center">{% trans 'or use SSO' %}</h4>
|
||||
<hr>
|
||||
<span class='float-right'>{% trans "Sign in using third-party SSO" %}</span>
|
||||
<div>
|
||||
{% include "socialaccount/snippets/provider_list.html" with process="login" %}
|
||||
</div>
|
||||
|
@ -5,13 +5,14 @@
|
||||
{% for provider in socialaccount_providers %}
|
||||
{% if provider.id == "openid" %}
|
||||
{% for brand in provider.get_brands %}
|
||||
<a title="{{brand.name}}"
|
||||
<a title="{{brand.name}}" brand_name='{{ provider.id }}'
|
||||
class="btn btn-primary socialaccount_provider {{provider.id}} {{brand.id}}"
|
||||
href="{% provider_login_url provider.id openid=brand.openid_url process=process %}"
|
||||
><span class='brand-icon' brand_name='{{provider.id}}'></span> {{brand.name}}</a>
|
||||
href="{% provider_login_url provider.id openid=brand.openid_url process=process %}">
|
||||
<span class='brand-icon' brand_name='{{provider.id}}'></span> {{brand.name}}</a>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<a title="{{provider.name}}" class="btn btn-primary socialaccount_provider {{provider.id}}"
|
||||
<a title="{{provider.name}}" brand_name='{{ provider.id }}'
|
||||
class="btn btn-primary socialaccount_provider {{provider.id}}"
|
||||
href="{% provider_login_url provider.id process=process scope=scope auth_params=auth_params %}"
|
||||
><span class='brand-icon' brand_name='{{provider.id}}'></span> {{provider.name}}</a>
|
||||
{% endfor %}
|
||||
|
Reference in New Issue
Block a user