Skip to content

Commit

Permalink
Merge pull request #191 from bkd-mba-fbi/feature/evt-28592-fotolist-s…
Browse files Browse the repository at this point in the history
…tg-suche-status

gem:28592 fix dropdown and stg status, search
  • Loading branch information
schefbi authored Jul 12, 2024
2 parents 90494f9 + befd87f commit 663b8eb
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 4 deletions.
7 changes: 7 additions & 0 deletions public/apps/EmberApps/CSS/Custom/fotoliste.css
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ html {
width: 3rem;
}

#CLX_Root .formRow {
margin-bottom: 10px;
}

#CLX_Root .document {
padding-bottom: 1rem;
float: left;
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -81,4 +90,11 @@ define([
}
}
});

function setDisplayStyle(elements, disableStyle){

for (const item of elements) {
item.style.display = disableStyle;
}
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,21 @@ <h1 class="photolist__header photolist__top">{{event.designation}}</h1>
</div>
{{/if}}
</div>
<div class="input-group formRow" id="searchRow">
<div class="input-group-text">
<span class="material-icons-outlined">search</span>
</div>
<input id="txtSearch" name="instanceSearch" type="text" placeholder="{{translate 'search'}}" autofocus>
</div>
<div class="photolist__container">
{{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}}
<span class="photolist__student__label" title={{student.fullname}}>{{student.fullname}}</span>
{{#if event.stg}}
<br><span class="photolist__student__label">{{student.status}}</span>
{{/if}}
{{/link-to}}
{{/each}}
</div>
Expand Down
7 changes: 4 additions & 3 deletions public/apps/EmberApps/Fotoliste/App/Services/cacheService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -132,6 +133,7 @@ define([
subscriptionByEvent.forEach(function(subscription) {
if(subscription.PersonId == item.Id) {
item.IdSubscription = subscription.IdSubscription;
item.Status = subscription.Status;
}
});

Expand Down Expand Up @@ -159,6 +161,7 @@ define([
idPerson: item.Id,
photo: api.getPersonPictureUrl(item.Id),
fullname: item.Fullname,
status: item.Status
});
return student;
}),
Expand Down Expand Up @@ -190,15 +193,13 @@ 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) {
location = location.href.substring(0,location.href.lastIndexOf('/'));
}
//console.log(this.get('cache'));
//console.log(event);
//console.log(studentData);
if (cache[idPerson] !== undefined) {
return cache[idPerson];
}
Expand Down
2 changes: 1 addition & 1 deletion public/apps/EmberApps/Fotoliste/App/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
1 change: 1 addition & 0 deletions public/apps/EmberApps/Locale/Custom/de-CH.js
Original file line number Diff line number Diff line change
Expand Up @@ -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...'
};
});
1 change: 1 addition & 0 deletions public/apps/EmberApps/Locale/Custom/fr-CH.js
Original file line number Diff line number Diff line change
Expand Up @@ -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...'
};
});

0 comments on commit 663b8eb

Please sign in to comment.