new xanalink template

This commit is contained in:
Edward Betts 2018-10-08 16:55:02 +01:00
parent 12f36e938d
commit 4948a16fe1
2 changed files with 45 additions and 0 deletions

View file

@ -0,0 +1,11 @@
$(function () {
$('#custom-field').hide();
$('.link-type-radio').click(function() {
if (this.id == 'btn-custom') {
$('#custom-field').show();
} else {
$('#custom-field').hide();
}
});
});

View file

@ -0,0 +1,34 @@
{% extends "base.html" %}
{% block title %}New xanalink {% endblock %}
{% set link_types = ['untyped', 'title', 'author', 'custom'] %}
{% block content %}
<h1 class="mt-3">{{ self.title() }}</h1>
<p>This is an empty link. You should add some facets.</p>
<h4>link type</h4>
<div class="btn-group btn-group-toggle" data-toggle="buttons">
{% for link_type in link_types %}
<label class="btn btn-info{% if loop.index == 1 %} active{% endif %} link-type-radio" id="btn-{{ link_type }}">
<input type="radio" class="link-type-radio2" id="radio-{{ link_type }}" autocomplete="off"{% if loop.index == 1 %} checked{% endif %}> {{ link_type }}
</label>
{% endfor %}
</div>
<p id="custom-field" class="mt-2">custom link type: <input type="text"></p>
<h4>new facet</h4>
<button class="btn btn-primary">add a facet</button>
<button class="btn btn-primary">save</button>
{% endblock %}
{% block scripts %}
<script src="{{ url_for('static', filename='js/new_xanalink.js') }}"></script>
{% endblock %}