|
478 | 478 | autocompleteRenderItem: function(ul, item) { |
479 | 479 | var icon = 'icon-user'; |
480 | 480 | var text = item.label; |
| 481 | + var description = ''; |
| 482 | + var type = ''; |
| 483 | + var getTranslatedType = function(type) { |
| 484 | + switch (type) { |
| 485 | + case 'HOME': |
| 486 | + return t('core', 'Home'); |
| 487 | + case 'WORK': |
| 488 | + return t('core', 'Work'); |
| 489 | + case 'OTHER': |
| 490 | + return t('core', 'Other'); |
| 491 | + default: |
| 492 | + return '' + type; |
| 493 | + } |
| 494 | + }; |
| 495 | + if (typeof item.type !== 'undefined' && item.type !== null) { |
| 496 | + type = getTranslatedType(item.type) + ' '; |
| 497 | + } |
| 498 | + |
481 | 499 | if (typeof item.name !== 'undefined') { |
482 | 500 | text = item.name; |
483 | 501 | } |
484 | 502 | if (item.value.shareType === OC.Share.SHARE_TYPE_GROUP) { |
485 | 503 | icon = 'icon-contacts-dark'; |
486 | 504 | } else if (item.value.shareType === OC.Share.SHARE_TYPE_REMOTE) { |
487 | 505 | icon = 'icon-shared'; |
| 506 | + description += item.value.shareWith; |
488 | 507 | } else if (item.value.shareType === OC.Share.SHARE_TYPE_REMOTE_GROUP) { |
489 | 508 | text = t('core', '{sharee} (remote group)', { sharee: text }, undefined, { escape: false }); |
490 | 509 | icon = 'icon-shared'; |
| 510 | + description += item.value.shareWith; |
491 | 511 | } else if (item.value.shareType === OC.Share.SHARE_TYPE_EMAIL) { |
492 | 512 | icon = 'icon-mail'; |
| 513 | + description += item.value.shareWith; |
493 | 514 | } else if (item.value.shareType === OC.Share.SHARE_TYPE_CIRCLE) { |
494 | 515 | text = t('core', '{sharee} ({type}, {owner})', {sharee: text, type: item.value.circleInfo, owner: item.value.circleOwner}, undefined, {escape: false}); |
495 | 516 | icon = 'icon-circle'; |
496 | 517 | } else if (item.value.shareType === OC.Share.SHARE_TYPE_ROOM) { |
497 | 518 | icon = 'icon-talk'; |
498 | 519 | } |
499 | | - var description = ''; |
500 | | - var getTranslatedType = function(type) { |
501 | | - switch (type) { |
502 | | - case 'HOME': |
503 | | - return t('core', 'Home'); |
504 | | - case 'WORK': |
505 | | - return t('core', 'Home'); |
506 | | - case 'OTHER': |
507 | | - return t('core', 'Other'); |
508 | | - default: |
509 | | - return type; |
510 | | - } |
511 | | - }; |
512 | | - if (typeof item.type !== 'undefined' && item.type !== null) { |
513 | | - description = getTranslatedType(item.type); |
514 | | - } |
| 520 | + |
515 | 521 | var insert = $("<div class='share-autocomplete-item'/>"); |
516 | 522 | if (item.merged) { |
517 | 523 | insert.addClass('merged'); |
518 | 524 | text = item.value.shareWith; |
| 525 | + description = type; |
519 | 526 | } else { |
520 | 527 | var avatar = $("<div class='avatardiv'></div>").appendTo(insert); |
521 | 528 | if (item.value.shareType === OC.Share.SHARE_TYPE_USER || item.value.shareType === OC.Share.SHARE_TYPE_CIRCLE) { |
|
526 | 533 | } |
527 | 534 | avatar.imageplaceholder(item.uuid, text, 32); |
528 | 535 | } |
529 | | - description = item.value.shareWith; |
| 536 | + description = type + description; |
530 | 537 | } |
531 | 538 | if (description !== '') { |
532 | 539 | insert.addClass('with-description'); |
|
0 commit comments