add support for displaying languages that administrators understand on the support panel
This commit is contained in:
parent
eb9edcb6f1
commit
7970f5026b
2 changed files with 30 additions and 1 deletions
|
@ -9,5 +9,7 @@ define(['/common/application_config_internal.js'], function (AppConfig) {
|
||||||
// Example: If you want to remove the survey link in the menu:
|
// Example: If you want to remove the survey link in the menu:
|
||||||
// AppConfig.surveyURL = "";
|
// AppConfig.surveyURL = "";
|
||||||
|
|
||||||
|
AppConfig.supportLanguages = [ 'en', 'fr' ]; // XXX
|
||||||
|
|
||||||
return AppConfig;
|
return AppConfig;
|
||||||
});
|
});
|
||||||
|
|
|
@ -11,6 +11,7 @@ define([
|
||||||
'/common/hyperscript.js',
|
'/common/hyperscript.js',
|
||||||
'/support/ui.js',
|
'/support/ui.js',
|
||||||
'/api/config',
|
'/api/config',
|
||||||
|
'/customize/application_config.js',
|
||||||
|
|
||||||
'css!/bower_components/bootstrap/dist/css/bootstrap.min.css',
|
'css!/bower_components/bootstrap/dist/css/bootstrap.min.css',
|
||||||
'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
|
'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
|
||||||
|
@ -27,7 +28,8 @@ define([
|
||||||
Messages,
|
Messages,
|
||||||
h,
|
h,
|
||||||
Support,
|
Support,
|
||||||
ApiConfig
|
ApiConfig,
|
||||||
|
AppConfig
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
var APP = window.APP = {};
|
var APP = window.APP = {};
|
||||||
|
@ -41,6 +43,7 @@ define([
|
||||||
'cp-support-list',
|
'cp-support-list',
|
||||||
],
|
],
|
||||||
'new': [
|
'new': [
|
||||||
|
'cp-support-language',
|
||||||
'cp-support-form',
|
'cp-support-form',
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
@ -132,6 +135,30 @@ define([
|
||||||
return $div;
|
return $div;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
create['language'] = function () {
|
||||||
|
if (!Array.isArray(AppConfig.supportLanguages)) { return $(h('div')); }
|
||||||
|
var languages = AppConfig.supportLanguages;
|
||||||
|
|
||||||
|
var list = h('li', languages
|
||||||
|
.map(function (lang) {
|
||||||
|
return Messages._languages[lang];
|
||||||
|
})
|
||||||
|
.filter(Boolean)
|
||||||
|
.map(function (lang) {
|
||||||
|
return h('li', lang);
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
var preamble = "This server's administrators speak the following languages:"; // XXX
|
||||||
|
var $div = $(
|
||||||
|
h('div.cp-support-language', [
|
||||||
|
preamble,
|
||||||
|
list,
|
||||||
|
])
|
||||||
|
);
|
||||||
|
return $div;
|
||||||
|
};
|
||||||
|
|
||||||
// Create a new tickets
|
// Create a new tickets
|
||||||
create['form'] = function () {
|
create['form'] = function () {
|
||||||
var key = 'form';
|
var key = 'form';
|
||||||
|
|
Loading…
Reference in a new issue