mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 14:33:14 +00:00
handle language for multiselect
This commit is contained in:
@@ -189,6 +189,9 @@ class Login implements ControllerProviderInterface
|
|||||||
'validation_length_min' => _('This value is too short. It should have %s character or more'),
|
'validation_length_min' => _('This value is too short. It should have %s character or more'),
|
||||||
'password_match' => _('The passwords do not match.'),
|
'password_match' => _('The passwords do not match.'),
|
||||||
'accept_tou' => _('You must accept the terms of use.'),
|
'accept_tou' => _('You must accept the terms of use.'),
|
||||||
|
'none_selected' => _('None selected'),
|
||||||
|
'collections' => _('Collections'),
|
||||||
|
'collection' => _('Collection'),
|
||||||
));
|
));
|
||||||
|
|
||||||
$date = new \DateTime();
|
$date = new \DateTime();
|
||||||
|
@@ -10,10 +10,11 @@
|
|||||||
define([
|
define([
|
||||||
"jquery",
|
"jquery",
|
||||||
"underscore",
|
"underscore",
|
||||||
|
"i18n",
|
||||||
"backbone",
|
"backbone",
|
||||||
"bootstrap",
|
"bootstrap",
|
||||||
"multiselect"
|
"multiselect"
|
||||||
], function($, _, Backbone, bootstrap, multiselect) {
|
], function($, _, i18n, Backbone, bootstrap, multiselect) {
|
||||||
var initialize = function() {
|
var initialize = function() {
|
||||||
// close alerts
|
// close alerts
|
||||||
$(document).on("click", ".alert .alert-block-close a", function(e){
|
$(document).on("click", ".alert .alert-block-close a", function(e){
|
||||||
@@ -24,7 +25,22 @@ define([
|
|||||||
|
|
||||||
$("select[multiple='multiple']").multiselect({
|
$("select[multiple='multiple']").multiselect({
|
||||||
buttonWidth : "100%",
|
buttonWidth : "100%",
|
||||||
buttonClass: 'btn btn-inverse'
|
buttonClass: 'btn btn-inverse',
|
||||||
|
buttonText: function(options, select) {
|
||||||
|
if (options.length === 0) {
|
||||||
|
return i18n.t("none_selected") + '<b class="caret"></b>';
|
||||||
|
}
|
||||||
|
else if (options.length > 4) {
|
||||||
|
return options.length + (options.length > 1 ? i18n.t("collections") : i18n.t("collection")) + ' <b class="caret"></b>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var selected = '';
|
||||||
|
options.each(function() {
|
||||||
|
selected += $(this).text() + ', ';
|
||||||
|
});
|
||||||
|
return selected.substr(0, selected.length -2) + ' <b class="caret"></b>';
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user