我在下面使用顶部摘要链接-下拉框,然后提交更改类型。但是我想为每个圆创建链接,这些链接也使用下拉框中的值。我在活跃用户下尝试了以下方法。
<a href="{{ url_for('details', active='active', type=type) }}
但是,当我单击链接时,它没有类型信息。这可能吗?
<div class="container-fluid">
<form name="types" action ='{{ url_for('summary') }}' method="GET" >
<select name="type">
{% for type in types %}
<option value="{{ type }}">{{ type }}</option>
{% endfor %}
</select>
<button type="submit" class="btn btn-primary btn btn-primary-primary">Select Type</button></td>
</form>
<div class="circles">
<div class="row">
<div class="col-md-6">
<div class="circle-title">Total Users</div>
<a href="{{ url_for('details') }}"><div class="circle">{{ total_users }}</div></a>
</div>
<div class="col-md-6">
<div class="circle-title">Active Users</div>
<a href="{{ url_for('details', active='active', type=type) }}"><div class="circle">{{ total_active }}</div></a>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="circle-title">Total Logged</div>
<div class="circle">{{ '{:,}'.format(total) }}</div>
</div>
<div class="col-md-6">
<div class="circle-title">Attendence</div>
<div class="circle">{{ '{:.0%}'.format(attendance) }}</div>
</div>
</div>
</div>
</div>
答案 0 :(得分:0)
尝试一下:
{% for type in types %}
<a href="{{ url_for('details', active='active', type=type) }}"><div class="circle">{{ total_active }}</div></a>
{% endfor %}