Advanced search: I would like to dedicate this commit to my beloved colleague, eespie <3

SVN:b1162[5462]
This commit is contained in:
Guillaume Lajarige
2018-03-20 09:27:42 +00:00
parent a53a046351
commit 87c5ee67c0
3 changed files with 41 additions and 3 deletions

View File

@@ -1372,12 +1372,22 @@ When associated with a trigger, each action is given an "order" number, specifyi
'UI:UploadNotSupportedInThisMode' => 'The modification of images or files is not supported in this mode.',
// TODO: Reorganize those entries with other search entries and make entries for other languages.
// Search form
'UI:Search:Toggle' => 'Minimize / Expand',
'UI:Search:Criterion:MoreMenu:AddCriteria' => 'Add new criteria',
// - Operators
'UI:Search:Criteria:Operator:Default:Empty' => 'Is empty',
'UI:Search:Criteria:Operator:Default:NotEmpty' => 'Is not empty',
'UI:Search:Criteria:Operator:Default:Equals' => 'Equals:',
'UI:Search:Criteria:Operator:String:Contains' => 'Contains:',
'UI:Search:Criteria:Operator:String:StartsWith' => 'Starts with:',
'UI:Search:Criteria:Operator:String:EndsWith' => 'Ends with:',
// - Criteria titles
'UI:Search:Criteria:Title:Default:Empty' => '%1$s is empty',
'UI:Search:Criteria:Title:Default:NotEmpty' => '%1$s is not empty',
'UI:Search:Criteria:Title:Default:Equals' => '%1$s equals %2$s',
'UI:Search:Criteria:Title:String:Contains' => '%1$s contains %2$s',
'UI:Search:Criteria:Title:String:StartsWith' => '%1$s starts with %2$s',
'UI:Search:Criteria:Title:String:EndsWith' => '%1$s ends with %2$s',
'UI:Search:Criteria:Title:Enum:In' => '%1$s in %2$s',
));

View File

@@ -1199,4 +1199,24 @@ Lors de l\'association à un déclencheur, on attribue à chaque action un numé
'UI:Button:ResetImage' => 'Récupérer l\'image initiale',
'UI:Button:RemoveImage' => 'Supprimer l\'image',
'UI:UploadNotSupportedInThisMode' => 'La modification d\'images ou de fichiers n\'est pas supportée dans ce mode.',
// TODO: Reorganize those entries with other search entries and make entries for other languages.
// Search form
'UI:Search:Toggle' => 'Réduire / Ouvrir',
'UI:Search:Criterion:MoreMenu:AddCriteria' => 'Ajouter un critère',
// - Operators
'UI:Search:Criteria:Operator:Default:Empty' => 'Vide',
'UI:Search:Criteria:Operator:Default:NotEmpty' => 'Non vide',
'UI:Search:Criteria:Operator:Default:Equals' => 'Egal :',
'UI:Search:Criteria:Operator:String:Contains' => 'Contient :',
'UI:Search:Criteria:Operator:String:StartsWith' => 'Commence par :',
'UI:Search:Criteria:Operator:String:EndsWith' => 'Fini par :',
// - Criteria titles
'UI:Search:Criteria:Title:Default:Empty' => '%1$s vide',
'UI:Search:Criteria:Title:Default:NotEmpty' => '%1$s non vide',
'UI:Search:Criteria:Title:Default:Equals' => '%1$s égal %2$s',
'UI:Search:Criteria:Title:String:Contains' => '%1$s contient %2$s',
'UI:Search:Criteria:Title:String:StartsWith' => '%1$s commence par %2$s',
'UI:Search:Criteria:Title:String:EndsWith' => '%1$s fini par %2$s',
'UI:Search:Criteria:Title:Enum:In' => '%1$s parmi %2$s',
));

View File

@@ -440,11 +440,19 @@ $(function()
{
if(sTitle === undefined)
{
// TODO: Make nice label
sTitle = this.options.field.label + ' ' + this.operators[this.options.operator].label + ' ' + this._getValuesAsText();
var sOperator = this.operators[this.options.operator].code;
var sDictEntry = 'UI:Search:Criteria:Title:' + this._toCamelCase(this.options.field.widget) + ':' + this._toCamelCase(sOperator);
// Fallback to default widget dict entry if none exists for the current widget
if(Dict.S(sDictEntry) === sDictEntry)
{
sDictEntry = 'UI:Search:Criteria:Title:Default:' + this._toCamelCase(sOperator);
}
sTitle = Dict.Format(sDictEntry, this.options.field.label, this._getValuesAsText());
}
this.element.find('.sfc_title')
.text(sTitle)
.html(sTitle)
.attr('title', sTitle);
},