Skip to content

Commit

Permalink
Merge pull request #36 from djpugh/feature/more-user-template-blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
djpugh authored Dec 15, 2020
2 parents 0c715ad + 9510a64 commit c9c79de
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
7 changes: 6 additions & 1 deletion src/fastapi_aad_auth/ui/error.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{% extends "fastapi_aad_auth.ui:base.html" %}
{% block Content %}
<main class='container' role="main">
{% block ContentHeader %}
{% if logo %}
{{logo | safe }}
{% endif %}
{% if appname %}
<h1 class="h1">{{appname}}</h1>
{% endif %}
{% endblock ContentHeader %}
{% block Error %}
<h2>Server Error {{status_code}}:</h2>
<h3> {{error_type}}</h3>
<p class="lead">{{error_description}}</p>
Expand All @@ -20,12 +23,14 @@ <h3> {{error_type}}</h3>
{{ error | safe }}
</code>
</div>
{% endblock Error %}
{% block ContentFooter %}
{% if copyright %}
<p class="mt-5 mb-3 lead text-muted">© {{ copyright }}</p>
{% endif %}
{% if explanation %}
<p class="mt-5 mb-3 lead text-muted">{{ explanation }}</p>
{% endif %}

{% endblock ContentFooter %}
</main>
{% endblock Content %}
18 changes: 12 additions & 6 deletions src/fastapi_aad_auth/ui/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,29 @@
<div class='container'>
<div class="cover-container d-flex h-100 p-3 mx-auto flex-column text-center justify-content-center">
<main class="inner-cover">
{% block ContentHeader %}
<p class="lead">
{% if logo %}
{{logo | safe }}
{% endif %}
{% if appname %}
<h1 class="h1">{{appname}}</h1>
{% endif %}
{% endblock ContentHeader %}
{% block Login %}
<br><br>
<h4 class="mb-3 font-weight-normal">Please sign in</h4>
{{ login | safe }}
</p>
{% if copyright %}
<p class="mt-5 mb-3 lead text-muted">© {{ copyright }}</p>
{% endif %}
{% if explanation %}
<p class="mt-5 mb-3 lead text-muted">{{ explanation }}</p>
{% endif %}
{% endblock Login %}
{% block ContentFooter %}
{% if copyright %}
<p class="mt-5 mb-3 lead text-muted">© {{ copyright }}</p>
{% endif %}
{% if explanation %}
<p class="mt-5 mb-3 lead text-muted">{{ explanation }}</p>
{% endif %}
{% endblock ContentFooter %}

</main>
</div>
Expand Down
9 changes: 9 additions & 0 deletions src/fastapi_aad_auth/ui/user.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

{% block Content %}
<div class='container'>
{% block ContentHeader %}
<div class="cover-container d-flex h-5 p-3 mx-auto flex-column text-center justify-content-center">
<main class="inner-cover">
<p class="lead">
Expand All @@ -20,9 +21,13 @@ <h1 class="h1">{{appname}}</h1>
</p>
</main>
</div>
{% endblock ContentHeader %}
{% block ContentSubHeader %}
<div class="row mb-md-3">
<h2>Current User</h2>
</div>
{% endblock ContentSubHeader %}
{% block ContentTable %}
<div class="row">
<table class="table">
<tbody>
Expand Down Expand Up @@ -75,14 +80,18 @@ <h2>Current User</h2>
</tbody>
</table>
</div>
{% endblock ContentTable %}
{% block ContentFooter %}
{% if copyright %}
<p class="mt-5 mb-3 lead text-muted">© {{ copyright }}</p>
{% endif %}
{% if explanation %}
<p class="mt-5 mb-3 lead text-muted">{{ explanation }}</p>
{% endif %}
{% endblock ContentFooter %}
</div>
{% endblock Content %}

{% block BodyScripts %}
<script>
$(document).ready(function(){
Expand Down

0 comments on commit c9c79de

Please sign in to comment.