diff --git a/public/apps/EmberApps/CSS/Custom/fotoliste.css b/public/apps/EmberApps/CSS/Custom/fotoliste.css index 96b1f32d..13f236d6 100644 --- a/public/apps/EmberApps/CSS/Custom/fotoliste.css +++ b/public/apps/EmberApps/CSS/Custom/fotoliste.css @@ -88,6 +88,10 @@ html { width: 3rem; } +#CLX_Root .formRow { + margin-bottom: 10px; +} + #CLX_Root .document { padding-bottom: 1rem; float: left; @@ -146,6 +150,9 @@ html { max-width: 100%; position: relative; z-index: 1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } #CLX_Root .photolist__placeholder { diff --git a/public/apps/EmberApps/Fotoliste/App/Components/photoListComponent.js b/public/apps/EmberApps/Fotoliste/App/Components/photoListComponent.js index e7e6c49c..9816ca18 100644 --- a/public/apps/EmberApps/Fotoliste/App/Components/photoListComponent.js +++ b/public/apps/EmberApps/Fotoliste/App/Components/photoListComponent.js @@ -48,6 +48,15 @@ define([ }, + keyUp: function() { + var listItems = document.getElementsByClassName('photolist__student'); + console.log(listItems); + var displayNone = Array.from(listItems).filter(f => f.innerText.toLowerCase().search(event.target.value.toLowerCase()) < 0) + setDisplayStyle(displayNone,'none'); + var displayBlock = Array.from(listItems).filter(f => f.innerText.toLowerCase().search(event.target.value.toLowerCase()) >= 0) + setDisplayStyle(displayBlock,'block'); + }, + actions: { // calculate how many columns there are and set // the 'columnCount' property @@ -81,4 +90,11 @@ define([ } } }); + + function setDisplayStyle(elements, disableStyle){ + + for (const item of elements) { + item.style.display = disableStyle; + } + } }); \ No newline at end of file diff --git a/public/apps/EmberApps/Fotoliste/App/HtmlTemplates/Components/photoListComponent.html b/public/apps/EmberApps/Fotoliste/App/HtmlTemplates/Components/photoListComponent.html index f8e2cfcf..aa515aa9 100644 --- a/public/apps/EmberApps/Fotoliste/App/HtmlTemplates/Components/photoListComponent.html +++ b/public/apps/EmberApps/Fotoliste/App/HtmlTemplates/Components/photoListComponent.html @@ -82,12 +82,21 @@

{{event.designation}}

{{/if}} +
+
+ search +
+ +
{{yield}} {{#each event.students as |student index|}} {{#link-to "photoDetail" student.idPerson class=(concat "photolist__student" " " (if (endOfLine index columnCount) "end-of-line"))}} {{student-photo student=student}} {{student.fullname}} + {{#if event.stg}} +
{{student.status}} + {{/if}} {{/link-to}} {{/each}}
diff --git a/public/apps/EmberApps/Fotoliste/App/Services/cacheService.js b/public/apps/EmberApps/Fotoliste/App/Services/cacheService.js index 52265499..eeb9b02d 100644 --- a/public/apps/EmberApps/Fotoliste/App/Services/cacheService.js +++ b/public/apps/EmberApps/Fotoliste/App/Services/cacheService.js @@ -104,7 +104,8 @@ define([ idEvent: subscriptionByEvent[0].EventId, designation: designation, //leadership: responses[1].Leadership, - dateString: responses[1].DateString + dateString: responses[1].DateString, + stg: responses[1].EventTypeId === 1 ? true : false }); //console.log(event); @@ -132,6 +133,7 @@ define([ subscriptionByEvent.forEach(function(subscription) { if(subscription.PersonId == item.Id) { item.IdSubscription = subscription.IdSubscription; + item.Status = subscription.Status; } }); @@ -159,6 +161,7 @@ define([ idPerson: item.Id, photo: api.getPersonPictureUrl(item.Id), fullname: item.Fullname, + status: item.Status }); return student; }), @@ -190,7 +193,6 @@ define([ getStudentData: function (idPerson) { var cache = this.get('cache').people; var studentData = this.get('cache').subscriptions[idPerson]; - //console.log(studentData); //Its important, if student ist not in cache if (studentData === undefined) { @@ -198,7 +200,6 @@ define([ } //console.log(this.get('cache')); //console.log(event); - //console.log(studentData); if (cache[idPerson] !== undefined) { return cache[idPerson]; } diff --git a/public/apps/EmberApps/Fotoliste/App/helpers.js b/public/apps/EmberApps/Fotoliste/App/helpers.js index 46a43559..4e9280af 100644 --- a/public/apps/EmberApps/Fotoliste/App/helpers.js +++ b/public/apps/EmberApps/Fotoliste/App/helpers.js @@ -21,7 +21,7 @@ define(['constants', 'translate', 'appConfig', 'api'], function (constants, tran var key = value; var items = subscriptionDetail.DropdownItems; for (var i = 0; i < items.length; i++) { - if (items[i].Key === key.toString()) { + if (items[i].Key.toString() === key.toString()) { return items[i].Value; } } diff --git a/public/apps/EmberApps/Locale/Custom/de-CH.js b/public/apps/EmberApps/Locale/Custom/de-CH.js index 91645bf3..f9c1b2b5 100644 --- a/public/apps/EmberApps/Locale/Custom/de-CH.js +++ b/public/apps/EmberApps/Locale/Custom/de-CH.js @@ -35,5 +35,6 @@ define(function() { 'contractDateFromTo': 'Lehrzeit', 'emailsToStudents': 'An alle Teilnehmenden', 'eventTypeNotSupported': 'Der Anlasstyp wird nicht unterstützt. Unterstütze Anlasstypen: Klasse, Modulanlass, Kurs, CASA', + 'search': 'Suche...' }; }); \ No newline at end of file diff --git a/public/apps/EmberApps/Locale/Custom/fr-CH.js b/public/apps/EmberApps/Locale/Custom/fr-CH.js index 4bc16869..e81af6c2 100644 --- a/public/apps/EmberApps/Locale/Custom/fr-CH.js +++ b/public/apps/EmberApps/Locale/Custom/fr-CH.js @@ -35,5 +35,6 @@ define(function() { 'noSubscriptionFound': 'Aucun commentaire trouvé pour l\'événement', 'contractDateFromTo': 'Durée de l\'apprentissage', 'eventTypeNotSupported': 'Le type d\'événement n\'est pas pris en charge. Types d\'événements pris en charge : classe, événement de module, cours, ECPG', + 'search': 'Recherche...' }; }); \ No newline at end of file