Skip to content

Commit

Permalink
πŸ”§ (src/templates/): adapt templates to redis db
Browse files Browse the repository at this point in the history
  • Loading branch information
ncvescera committed Sep 3, 2024
1 parent 98fc55e commit 38c4a57
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
10 changes: 5 additions & 5 deletions src/templates/users/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% endblock%}

{% block body %}
<h3>Welcome {{user['contact']['email']}} πŸ‘‹</h3>
<h3>Welcome {{user['username']}} πŸ‘‹</h3>
<p>Add some text to explain requests </p>

<h3 class="mt-5">Request status</h3>
Expand All @@ -22,14 +22,14 @@ <h3 class="mt-5">Request status</h3>
<tbody>
{% for req in user['request_data'] %}
<tr>
<td>{{req['start_date']}}</td>
<td>{{req['startdate']}}</td>
<td>{{req['user']}}</td>
<td>{{ 'Accepted' if req['state'] else 'Pending'}}</td>
<td>{{ req['end_date'] if req['end_date'] else '-'}}</td>
<td>{{req['status']}}</td>
<td>{{ req['enddate'] if req['enddate'] else '-'}}</td>
<td>
<form method="POST">
<input type="hidden" name="id" value="{{req['user']}}"/>
<input type="submit" class="btn btn-{{'danger' if req['state'] else 'primary'}} btn-sm" value="{{'Revoke' if req['state'] else 'Approve'}}"/>
<input type="submit" class="btn btn-{{'danger' if req['status']=='approved' else 'primary'}} btn-sm" value="{{'Revoke' if req['status']=='approved' else 'Approve'}}"/>
</form>
</td>
</tr>
Expand Down
12 changes: 5 additions & 7 deletions src/templates/users/user.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{% endblock %}

{% block body %}
<h3>Welcome {{user['contact']['email']}} πŸ‘‹</h3>
<h3>Welcome {{user['username']}} πŸ‘‹</h3>
<p>Add some text to explain requests </p>

<h3 class="mt-5">Request status</h3>
Expand All @@ -36,20 +36,18 @@ <h3 class="mt-5">Request status</h3>
<thead>
<tr>
<th>Date</th>
<th>User</th>
<th>State</th>
<th>Accepted Date</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td>{{user['request_data']['start_date']}}</td>
<td>{{user['request_data']['user']}}</td>
<td>{{ 'Accepted' if user['request_data']['state'] else 'Pending'}}</td>
<td>{{ user['request_data']['end_date'] if user['request_data']['end_date'] else '-'}}</td>
<td>{{user['request_data']['startdate']}}</td>
<td>{{user['request_data']['status']}}</td>
<td>{{ user['request_data']['enddate'] if user['request_data']['enddate'] else '-'}}</td>
<td>
{% if user['request_data']['state'] == 1 %}
{% if user['request_data']['status'] == 'approved' %}
<a href="https://uninuvola.fisgeo.unipg.it/"><button type="button" class="btn btn-primary btn-sm">πŸš€</button></a>

{% else %}
Expand Down

0 comments on commit 38c4a57

Please sign in to comment.