Skip to content

Commit

Permalink
sort teilnehmer by last name (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
mo271 authored Dec 9, 2023
1 parent 4ebb526 commit 88f98d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
14 changes: 7 additions & 7 deletions js/data/teilnehmer.json
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@
]
},
"first": "Eduard ?",
"last": "?"
"last": "Langebeck"
},
"669": {
"name": "Conrad Müller",
Expand Down Expand Up @@ -3814,8 +3814,8 @@
"A[?] Gehring? "
]
},
"first": "A? ",
"last": ""
"first": "A?",
"last": "Gehring"
},
"525": {
"name": "Rudolph Hansen\\newline stud. math.",
Expand Down Expand Up @@ -5132,7 +5132,7 @@
"[Walther [von]] Dyck"
]
},
"first": "Walther Dyck",
"first": "Walther",
"last": "Dyck"
},
"730": {
Expand Down Expand Up @@ -6408,7 +6408,7 @@
]
},
"first": "Otto ",
"last": ""
"last": "Blumenthal"
},
"1098": {
"name": "Johannes Schröder, cand. math.",
Expand Down Expand Up @@ -6695,7 +6695,7 @@
]
},
"first": "Th? ?",
"last": "?"
"last": "Beschen?"
},
"242": {
"name": "Alfred Errara",
Expand Down Expand Up @@ -7590,7 +7590,7 @@
"Charles E[merson]. Curry"
]
},
"first": "Charles Curry",
"first": "Charles Emerson",
"last": "Curry"
},
"1124": {
Expand Down
8 changes: 5 additions & 3 deletions js/teilnehmer.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ function meinRowWriter(rowIndex, record, columns, cellWriter) {
const datum = protokolle[key] && protokolle[key].datum ? protokolle[key].datum : 'kein Datum';
return '<a href="../#id-' + key + '">' + datum + '</a>';
}).join(', ');
li = '<li class="' + cssClass + '"<div<p class="namep"><span id="namespan">' + record.name + '</span> <a href="#id-' + record.id + '" data-toggle="tooltip" data-placement="right" title="Einzelansicht"><i class="fa fa-link"></i></a></p><p class="linkp">' + talks + '</p></div></li>';
li = '<li class="' + cssClass + '"<div<p class="namep"> <span id="namespan">' + record.first+' '+record.last + '</span> <a href="#id-' + record.id + '" data-toggle="tooltip" data-placement="right" title="Einzelansicht"><i class="fa fa-link"></i></a></p><p class="linkp">' + talks + '</p></div></li>';
//li = '<li class="' + cssClass + '><div>hello!!</div></li>';
return li;
}
Expand Down Expand Up @@ -302,16 +302,18 @@ $(document).ready(function () {
return {
id: key,
name: item.name,
first: item.first,
last: item.last,
ids_to_signatures: item.ids_to_signatures
};
});
// Sorting the array alphabetically by name
// TODO: split first and last name and sort by last name...
teilnehmerArray.sort(function (a, b) {
if (a.name < b.name) {
if (a.last < b.last) {
return -1;
}
if (a.name > b.name) {
if (a.last > b.last) {
return 1;
}
return 0;
Expand Down

0 comments on commit 88f98d9

Please sign in to comment.