Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Thanks to maximest-pierre, Akuket and xet. Related #119
- Loading branch information
Showing
9 changed files
with
139 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
template(name='connectionMethod') | ||
div.at-form-connection | ||
label Authentication method | ||
select.select-connection | ||
each connections | ||
option(value="{{value}}") {{_ value}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Template.connectionMethod.onCreated(function() { | ||
this.connectionMethods = new ReactiveVar([]); | ||
|
||
Meteor.call('getConnectionsEnabled', (_, result) => { | ||
if (result) { | ||
// TODO : add a management of different languages | ||
// (ex {value: ldap, text: TAPi18n.__('ldap', {}, T9n.getLanguage() || 'en')}) | ||
this.connectionMethods.set([ | ||
{value: 'default'}, | ||
// Gets only the connection methods availables | ||
...Object.entries(result).filter((e) => e[1]).map((e) => ({value: e[0]})), | ||
]); | ||
} | ||
|
||
// If only the default authentication available, hides the select boxe | ||
const content = $('.at-form-connection'); | ||
if (!(this.connectionMethods.get().length > 1)) { | ||
content.hide(); | ||
} else { | ||
content.show(); | ||
} | ||
}); | ||
}); | ||
|
||
Template.connectionMethod.onRendered(() => { | ||
// Moves the select boxe in the first place of the at-pwd-form div | ||
$('.at-form-connection').detach().prependTo('.at-pwd-form'); | ||
}); | ||
|
||
Template.connectionMethod.helpers({ | ||
connections() { | ||
return Template.instance().connectionMethods.get(); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters