Skip to content

Commit

Permalink
Add functionality for collective deletion of students and improve CSV…
Browse files Browse the repository at this point in the history
… file upload
  • Loading branch information
wolfganggreschus committed Jan 29, 2025
1 parent e39db47 commit 1fcb577
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
15 changes: 14 additions & 1 deletion static/scripts/management.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,17 @@ $(document).ready(() => {
})

document.querySelector('#policy-input').addEventListener('change', loadPolicyFile, false);
})
})

document.getElementById('batchDeletionFileInput').addEventListener('change', function(event) {
const file = event.target.files[0];
if (!file) return;

const reader = new FileReader();
reader.onload = function(e) {
const content = e.target.result;
console.log("CSV Inhalt:", content);
document.getElementById('output').textContent = content;
};
reader.readAsText(file);
});
14 changes: 14 additions & 0 deletions views/management/management.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@
</section>
</div>
{{/ifEnvNot}}
<div class="row">
<section class="section-school section-default">
<h2 class="h4">Sammellöschung von Schülern</h2>
<div class="container-fluid">
<div class="row">
<div class="col-sm-12 no-padding">
<input type="file" id="fileInput" accept=".csv">
<textarea id="csvContent" rows="10" cols="50" placeholder="CSV content will appear here..."></textarea>
<pre id="output"></pre>
</div>
</div>
</div>
</section>
</div>
</div>
{{#embed "lib/components/modal-form" action="/management/uploadConsent" method="post" class="add-modal--policy"}}
{{#content "fields"}}
Expand Down
8 changes: 4 additions & 4 deletions views/users/users.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
<input type="hidden" name="schoolId" value="{{schoolId}}">
<input type="text" class="form-control search-field" placeholder="Suche nach Nutzenden... (Vor-/Nachname/External Id)" name="q" />
<span class="input-group-btn">
<button type="submit" class="btn btn-secondary">
<i class="fa fa-search"></i>
</button>
</span>
<button type="submit" class="btn btn-secondary">
<i class="fa fa-search"></i>
</button>
</span>
</div>
</form>
</div>
Expand Down

0 comments on commit 1fcb577

Please sign in to comment.