typeahead inputs for the main site

This commit is contained in:
Laura Klünder 2016-12-15 17:30:55 +01:00
parent feb8848fe0
commit 353535179f
27 changed files with 2986 additions and 17 deletions

View file

@ -9,13 +9,12 @@
<title>c3nav</title>
{% compress css %}
<link href="{% static 'bootstrap/css/bootstrap.css' %}" rel="stylesheet">
<link href="{% static 'site/css/c3nav.css' %}" rel="stylesheet">
{% endcompress %}
</head>
<body>
<div class="container" id="main">
<h1>c3nav</h1>
{% block content %}
@ -25,6 +24,8 @@
{% compress js %}
<script type="text/javascript" src="{% static 'jquery/jquery.js' %}"></script>
<script type="text/javascript" src="{% static 'bootstrap/js/bootstrap.js' %}"></script>
<script type="text/javascript" src="{% static 'site/js/typeahead.js' %}"></script>
<script type="text/javascript" src="{% static 'site/js/c3nav.js' %}"></script>
{% endcompress %}
</body>
</html>

View file

@ -0,0 +1,16 @@
{% load i18n %}
<div class="form-group col-md-6">
<label for="{ name }}_input">{{ heading }}</label>
<div class="locationselect{% if location %} selected{% endif %}">
<div class="locationselect-input">
<input type="text" class="form-control input-lg" id="{ name }}_input" name="{{ name }}_search" placeholder="{% trans 'Search any Location…' %}">
</div>
<div class="locationselect-selected">
<div class="location form-control input-lg">
<span class="title">{{ location.title }}</span>
<small class="subtitle">{{ location.subtitle }}</small>
</div>
<input type="hidden" name="{{ name }}" value="{{ location.name }}" class="name-field">
</div>
</div>
</div>

View file

@ -1,23 +1,17 @@
{% extends 'site/base.html' %}
{% load static %}
{% load i18n %}
{% block content %}
<form>
<div class="row">
<div class="form-group col-md-6">
<label for="from">From</label>
<input type="text" class="form-control input-lg" id="from">
</div>
<div class="form-group col-md-6">
<label for="to">To</label>
<input type="text" class="form-control input-lg" id="to">
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
</div>
<div class="form-group col-md-6">
<button type="submit" class="btn btn-primary btn-lg">Get me There</button>
</div>
{% trans "Origin" as heading %}
{% include 'site/fragment_location.html' with name='origin' location=origin heading=heading %}
{% trans "Destination" as heading %}
{% include 'site/fragment_location.html' with name='destination' location=destination heading=heading %}
</div>
</form>
{% endblock %}