Skip to content
Snippets Groups Projects
Commit 80237a2b authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Update templates for bootstrap 4 beta

parent aebfdc6f
No related branches found
No related tags found
No related merge requests found
{% macro nav_li(active) -%} {% macro nav_a(active) -%}
<li {% if active %}class="active"{% endif %}> <a class="nav-item nav-link{% if active %} active{% endif %}"
{%- endmacro %} {%- endmacro %}
{%- extends "bootstrap/base.html" %} {%- extends "bootstrap/base.html" %}
{% import "bootstrap/utils.html" as utils %} {% import "bootstrap/utils.html" as utils %}
{% from "_helpers.html" import nav_li %} {% from "_helpers.html" import nav_a %}
{% block styles %} {% block styles %}
{{super()}} {{super()}}
...@@ -12,41 +12,38 @@ ...@@ -12,41 +12,38 @@
{% block navbar %} {% block navbar %}
<!-- Fixed navbar --> <!-- Fixed navbar -->
<div class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="navbar fixed-top navbar-expand-lg navbar-light bg-light" role="navigation">
<div class="container"> <a class="navbar-brand" href="{{ url_for('main.index') }}">Inventory</a>
<div class="navbar-header"> <button class="navbar-toggler" type="button" data-toggle="collapse"
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
<span class="sr-only">Toggle navigation</span> aria-expanded="false" aria-label="Toggle navigation">
<span class="icon-bar"></span> <span class="navbar-toggler-icon"></span>
<span class="icon-bar"></span> </button>
<span class="icon-bar"></span>
</button> <div class="collapse navbar-collapse" id="navbarSupportedContent">
<!--img class="navbar-brand" src="../../static/logo.png"--> <div class="navbar-nav mr-auto">
<a class="navbar-brand" href="{{ url_for('main.index') }}">Inventory</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
{% set path = request.path %} {% set path = request.path %}
{{ nav_li(path in ("/", "/index", "/index/")) }}<a href="{{ url_for('main.index') }}">Index</a></li> {{ nav_a(path in ("/", "/index", "/index/")) }} href="{{ url_for('main.index') }}">Index</a>
{{ nav_li(path == "/qrcodes") }}<a href="{{ url_for('main.qrcodes') }}">QR Codes</a></li> {{ nav_a(path == "/qrcodes") }} href="{{ url_for('main.qrcodes') }}">QR Codes</a>
{% if current_user.is_authenticated and current_user.is_admin %} {% if current_user.is_authenticated and current_user.is_admin %}
<li><a href="{{ url_for('admin.index') }}">Admin</a></li> <a class="nav-item nav-link" href="{{ url_for('admin.index') }}">Admin</a>
{% endif %} {% endif %}
</ul> </div>
<ul class="nav navbar-nav navbar-right"> <div class="navbar-nav">
{% if current_user.is_authenticated %} {% if current_user.is_authenticated %}
<li class="dropdown"> <div class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{current_user}} <span class="caret"></span></a> <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<ul class="dropdown-menu"> {{current_user}}
<li><a href="{{ url_for('users.profile') }}">Profile</a></li> </a>
<li><a href="{{ url_for('users.logout') }}">Logout</a></li> <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
</ul> <a class="dropdown-item" href="{{ url_for('users.profile') }}">Profile</a>
</li> <a class="dropdown-item" href="{{ url_for('users.logout') }}">Logout</a>
</div>
</div>
{% endif %} {% endif %}
{% block navbar_right %}{% endblock %} {% block navbar_right %}{% endblock %}
</ul> </div>
</div><!--/.nav-collapse --> </div>
</div>
</div> </div>
{% endblock %} {% endblock %}
......
{%- extends "base.html" %} {%- extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% block main %} {% block main %}
<div class="jumbotron"> <div class="jumbotron">
<h1>Welcome to the ICS Inventory!</h1> <h1 class="display-4">Welcome to the ICS Inventory!</h1>
</div> </div>
<table id="items_table" class="table table-bordered table-condensed"> <table id="items_table" class="table table-bordered table-hover table-sm">
<thead> <thead>
<tr> <tr>
<th>Id</th> <th>Id</th>
......
{%- extends "base.html" %} {%- extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% block title %}QR Codes{% endblock %} {% block title %}QR Codes{% endblock %}
...@@ -7,12 +6,14 @@ ...@@ -7,12 +6,14 @@
{% for name, images in codes.items() %} {% for name, images in codes.items() %}
<div class="row"> <div class="row">
<h2>{{ name }} codes</h2> <h2>{{ name }} codes</h2>
</div>
<div class="row">
{% for image in images %} {% for image in images %}
<div class="col-md-3"> <div class="col-md-3">
<div class="thumbnail"> <div class="card">
<img src="data:image/png;base64,{{ image.data }}"/> <img class="card-img-top" src="data:image/png;base64,{{ image.data }}">
<div class="caption"> <div class="card-body">
<h3>{{ image.name }}</h3> <h4 class="card-title">{{ image.name }}</h4>
</div> </div>
</div> </div>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment