Server OAPIF template enhancements: links and buttons

This commit is contained in:
Alessandro Pasotti 2019-11-07 14:54:34 +01:00
parent 814d5be0ff
commit 9188d4b539
5 changed files with 35 additions and 6 deletions

View File

@ -53,3 +53,23 @@ table.table-params td.small
{
font-size: 90%;
}
.btn-post, .btn-post:hover {
background-color: green;
border-color: green;
}
.btn-put, btn-put:hover {
background-color: orange;
border-color: orange;
}
.btn-patch, .btn-patch:hover {
background-color: magenta;
border-color: magenta;
}
.btn-delete, .btn-delete:hover {
background-color: red;
border-color: red;
}

View File

@ -27,6 +27,15 @@
<dt>{{ extent.spatial.bbox.0.3 }}</dt>
</dl>
<h3>Links</h3>
<ul>
{% for link in links %}
{% if link.rel != "self" %}
<li><a rel="{{ link.rel }}" href="{{ link.href }}">{{ link.title }}</a></li>
{% endif %}
{% endfor %}
</ul>
</div>
<div class="col-md-6">

View File

@ -27,7 +27,7 @@
{% for method, method_data in path_info %}
<div class="card-header" id="heading_{{ method_data.operationId }}">
<h5 class="mb-0">
<span class="path-button btn btn-primary" data-toggle="collapse"
<span class="path-button btn btn-primary btn-{{ method }}" data-toggle="collapse"
data-target="#collapse_{{ method_data.operationId }}"
aria-expanded="true"
aria-controls="collapse_{{ method_data.operationId }}">{{ method }}</span>

View File

@ -14,9 +14,11 @@
<script src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>
<link rel="stylesheet" href="{{ static( "jsonFormatter.min.css" ) }}" crossorigin="anonymous"></script>
<link rel="stylesheet" href="{{ static( "jsonFormatter.min.css" ) }}" crossorigin="anonymous">
<script src="{{ static( "jsonFormatter.min.js" ) }}" crossorigin="anonymous"></script>
{% include "links.html" %}
<title>{{ metadata.pageTitle }}</title>
</head>
<body>

View File

@ -1,6 +1,4 @@
<!-- template for the WFS3 API links list -->
<ul>
<!-- template for the WFS3 API links list, to be included in HEAD -->
{% for link in links %}
<li><a rel="{{ link.rel }}" href="{{ link.href }}">{{ link.title }}</a></li>
<link rel="{{ link.rel }}" href="{{ link.href }}" title="{{ link.title }}" type="{{ link.type }}">
{% endfor %}
</ul>