Author: Pedro Lucas Porcellis <pedrolucasporcellis@gmail.com>
Replace custom nav with a grid-based navigation bar
core/templates/layout.html | 79 +++++++++++++++++++++------------------
diff --git a/core/templates/layout.html b/core/templates/layout.html index da7b584dc87699a4c25ffda70cbe90db02db350c..26d3ddd73e10ac51cc82f3dd14a70c91aabe45ba 100644 --- a/core/templates/layout.html +++ b/core/templates/layout.html @@ -12,46 +12,53 @@ </head> <body> - {% if environment != "production" or - (current_user and current_user.is_admin() )%} - <div style=" - {% if environment == "production" %} - background: #cc0022; - {% else %} - background: #228800; - {% endif %} - color: white; font-weight: bold; width: 100%; text-align: center"> - {{environment.upper()}} ENVIRONMENT - </div> - {% endif %} + {% if environment != "production" or (current_user and current_user.is_admin()) %} + <div style=" + {% if environment == "production" %} + background: #cc0022; + {% else %} + background: #228800; + {% endif %} + color: white; font-weight: bold; width: 100%; text-align: center"> + {{environment.upper()}} ENVIRONMENT + </div> + {% endif %} - <nav class="navbar container"> - <a href="{{ url_for('basic.index') }}">Bem da Terra</a> - <ul> - <li> <a class="mr-5" href="{{ url_for('basic.about') }}">Sobre</a> </li> - <li> <a class="mr-5" href="#">Contato</a> </li> + <nav class=" container"> + <div class="row"> + <div class="col-xl-2 mb-15"> + <a href="/">Bem da Terra</a> + </div> + + <div class="col-xl-6"> + <ul class="main-links-nav"> + <li> <a class="mr-5" href="{{ url_for('basic.about') }}">Sobre</a> </li> + <li> <a class="mr-5" href="#">Contato</a> </li> + + {% if current_user.is_authenticated %} + <li> <a class="mr-5" href="{{ url_for('orders.index') }}">Seus Pedidos</a></li> + <li> <a class="mr-5" href="{{ url_for('cycles.index') }}">Ciclos</a></li> + {% if current_user.is_admin() %} + <li> <a class="mr-5" href="{{ url_for('reports.index') }}">Relatórios</a></li> + {% endif %} + {% endif %} + </ul> + </div> - {% if current_user.is_authenticated %} - <li> <a class="mr-5" href="{{ url_for('orders.index') }}">Seus Pedidos</a> </li> - <li> <a class="mr-5" href="{{ url_for('cycles.index') }}">Ciclos</a></li> - {% if current_user.is_admin() %} - <li> <a class="mr-5" href="#">Relatórios</a></li> - {% endif %} - {% endif %} - </ul> + <div class="col-xl-4"> + {% if current_user.is_authenticated %} + <span> + Logado como {{ current_user.username }} — <a href="{{ url_for('auth.logout') }}">Sair</a> + </span> + {% else %} + <a href="{{ url_for('auth.login') }}">Entrar</a> — <a href="{{ url_for('auth.sign_up') }}">Cadastrar</a> + {% endif %} + </div> + </div> + </nav> - <div class="login"> - {% if current_user.is_authenticated %} - <span> - Logado como {{ current_user.username }} — <a href="{{ url_for('auth.logout') }}">Sair</a> - </span> - {% else %} - <a href="{{ url_for('auth.login') }}">Entrar</a> — <a href="{{ url_for('auth.sign_up') }}">Cadastrar</a> - {% endif %} - </div> - </nav> - <div class='container container-content'> + <div class='container'> {% block body %} {% endblock %}