diff options
author | Daniel GarcĂa Moreno <danigm@soleta.eu> | 2021-06-01 11:44:09 +0200 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2021-06-01 18:25:49 +0200 |
commit | d4150080e3820e1f92137f5fc5c0985d366f29d7 (patch) | |
tree | e2240bbdddb38d7b217f0eedb43c473352cedb1d | |
parent | 3cfdfa3b12660a2e61801771e06f55348c7cf970 (diff) |
Use AdminLTE in base.html
This patch adds the css and js sources from the AdminLTE template to the
base template so it can be used in all templates.
There's also some flexbox bootstrap classes [1] to place the footer at
the bootom always, even when there's no content to fill the page.
[1] https://getbootstrap.com/docs/4.6/utilities/flex/
-rw-r--r-- | ogcp/static/css/soleta.css | 5 | ||||
-rw-r--r-- | ogcp/templates/base.html | 75 |
2 files changed, 49 insertions, 31 deletions
diff --git a/ogcp/static/css/soleta.css b/ogcp/static/css/soleta.css index d9a775b..d748f5b 100644 --- a/ogcp/static/css/soleta.css +++ b/ogcp/static/css/soleta.css @@ -1,3 +1,8 @@ .state--opg { background-color: rgb(252, 222, 66); } + +html, body { + width: 100%; + height: 100% !important; +} diff --git a/ogcp/templates/base.html b/ogcp/templates/base.html index e70e3fd..5fda82a 100644 --- a/ogcp/templates/base.html +++ b/ogcp/templates/base.html @@ -2,42 +2,55 @@ <html lang="en"> <head> {% block head %} - <script src="{{ url_for('static', filename='js/jquery.min.js') }}"></script> - <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}" /> - <link rel="stylesheet" href="{{ url_for('static', filename='css/soleta.css') }}" /> - <script src="{{ url_for('static', filename='js/bootstrap.bundle.min.js') }}"></script> <title>{% block title %}{% endblock %} - OpenGnsys</title> + + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <!-- Font Awesome Icons --> + <link rel="stylesheet" href="{{ url_for('static', filename='AdminLTE/plugins/fontawesome-free/css/all.min.css') }}"> + <!-- Theme style --> + <link rel="stylesheet" href="{{ url_for('static', filename='AdminLTE/dist/css/adminlte.min.css') }}"> + <link rel="stylesheet" href="{{ url_for('static', filename='css/soleta.css') }}" /> {% endblock %} </head> <body> - {% include 'nav.html' %} - {% block nav %}{% endblock %} - {% block flash %} - {% for category, message in get_flashed_messages(with_categories=True) %} - {% if category == 'info' %} - <div class="alert alert-info alert-dismissible fade show m-1" role="alert"> - {% elif category == 'error' %} - <div class="alert alert-danger alert-dismissible fade show m-1" role="alert"> - {% else %} - <div class="alert alert-warning alert-dismissible fade show m-1" role="alert"> - {% endif %} - {{ message }} - <button type="button" class="close" data-dismiss="alert" aria-label="{{ _('Close') }}"> - <span aria-hidden="true">×</span> - </button> - </div> - {% endfor %} - {% endblock %} + <div class="main d-flex flex-column align-items-stretch h-100"> + {% include 'nav.html' %} + {% block nav %}{% endblock %} + {% block flash %} + {% for category, message in get_flashed_messages(with_categories=True) %} + {% if category == 'info' %} + <div class="alert alert-info alert-dismissible fade show m-1" role="alert"> + {% elif category == 'error' %} + <div class="alert alert-danger alert-dismissible fade show m-1" role="alert"> + {% else %} + <div class="alert alert-warning alert-dismissible fade show m-1" role="alert"> + {% endif %} + {{ message }} + <button type="button" class="close" data-dismiss="alert" aria-label="{{ _('Close') }}"> + <span aria-hidden="true">×</span> + </button> + </div> + {% endfor %} + {% endblock %} - <div id="content">{% block content %}{% endblock %}</div> + <div id="content" class="container-fluid flex-grow-1">{% block content %}{% endblock %}</div> - {% block footer %} - <footer class="footer navbar-inverse bg-dark" role="contentinfo"> - <div class="text-center text-secondary mt-1 p-3"> - Powered by - <a class="text-light" href="https://opengnsys.soleta.eu/">Soleta Networks</a> - </div> - </footer> - {% endblock %} + {% block footer %} + <footer class="footer navbar-inverse bg-dark flex-shrink-0" role="contentinfo"> + <div class="text-center text-secondary mt-1 p-3"> + Powered by + <a class="text-light" href="https://opengnsys.soleta.eu/">Soleta Networks</a> + </div> + </footer> + {% endblock %} + </div> + + <!-- jQuery --> + <script src="{{ url_for('static', filename='AdminLTE/plugins/jquery/jquery.min.js') }}"></script> + <!-- Bootstrap 4 --> + <script src="{{ url_for('static', filename='AdminLTE/plugins/bootstrap/js/bootstrap.bundle.min.js') }}"></script> + <!-- AdminLTE App --> + <script src="{{ url_for('static', filename='AdminLTE/dist/js/adminlte.min.js') }}"></script> </body> </html> |