training/views/feature.ejs

66 lines
2.6 KiB
Plaintext

<%- include('partials/header') %>
<h1>Feature-request</h1>
<% if (session.role === 'admin') { %>
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">
Neue Request
</button>
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="exampleModalLabel">Neues Feature</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form method="post" action="/feature">
<label class="form-label" for="title">Titel:</label>
<input class="form-control" name="title"></br>
<label class="form-label" for="body">Beschreibung:</label>
<textarea class="form-control" name="body"></textarea>
<label class="form-label" for="type">Typ:</label>
<select class="form-select" name="type">
<option value=1 > Feature</option>
<option value=2 > Bug</option>
<option value=3 > Design</option>
</select></br>
<label class="form-label" for="urgency">Dringlichkeit:</label>
<select class="form-select" name="urgency" >
<option value=1> Sehr dringend</option>
<option value=2> Dringend</option>
<option value=3> Mittel</option>
<option value=4> Wenig</option>
<option value=5> Nicht dringend</option>
</select></br>
<input type="hidden" name="user" value="<%= session.userName %>">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="submit" class="btn btn-success">Absenden</button>
</form>
</div>
</div>
</div>
</div>
<% } %>
<% features.forEach(feature => { %>
<% date = new Date(feature.datetime) %>
<div>
<strong><u> <%= feature.title %> </strong><%= date.getDate() %>.<%= date.getMonth() + 1 %>.<%= date.getFullYear() %> - <%= date.getHours() %>:<%= date.getMinutes() %> - ( <%= feature.type === 1 ? 'Feature' : feature.type === 2 ? 'Bug' : 'Design' %>)</u> <%= feature.done ? '(erledigt)' : '' %></br>
<p> <%= feature.body %> </p>
</div>
<% }) %>
</body>
</html>
<%- include('partials/footer') %>