webui: add link to OTP token app

- display info message which points user to FreeOTP project page
- the link or the text can be easily changed by a plugin if needed

https://fedorahosted.org/freeipa/ticket/4469

Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
This commit is contained in:
Petr Vobornik 2014-08-05 17:00:01 +02:00 committed by Martin Kosek
parent 49fde3b047
commit 43d3593873
3 changed files with 11 additions and 1 deletions

View File

@ -37,7 +37,10 @@ define([
* @class
* @singleton
*/
var otptoken = IPA.otptoken = {};
var otptoken = IPA.otptoken = {
app_link: 'https://fedorahosted.org/freeotp/',
app_link_text: '@i18n:objects.otptoken.app_link'
};
var make_spec = function() {
return {
@ -523,6 +526,11 @@ otptoken.adder_dialog_qrcode_post_op = function(object) {
qr_dialog.open();
qr_dialog.show_message(text.get('@i18n:objects.otptoken.config_instructions'));
if (otptoken.app_link && otptoken.app_link_text) {
var app_text = text.get(otptoken.app_link_text);
app_text = app_text.replace('${link}', otptoken.app_link);
qr_dialog.show_message(app_text);
}
});

View File

@ -406,6 +406,7 @@
},
"otptoken": {
"add_token": "Add OTP Token",
"app_link": "You can use <a href=\"${link}\" target=\"_blank\">FreeOTP<a/> as a software OTP token application.",
"config_title": "Configure your token",
"config_instructions": "Configure your token by scanning the QR code below. Click on the QR code if you see this on the device you want to configure.",
"details": "OTP Token Settings",

View File

@ -550,6 +550,7 @@ class i18n_messages(Command):
},
"otptoken": {
"add_token": _("Add OTP Token"),
"app_link": _("You can use <a href=\"${link}\" target=\"_blank\">FreeOTP<a/> as a software OTP token application."),
"config_title": _("Configure your token"),
"config_instructions": _("Configure your token by scanning the QR code below. Click on the QR code if you see this on the device you want to configure."),
"details": _("OTP Token Settings"),