Commit 31ed1c20 authored by Arnaud Bey's avatar Arnaud Bey
Browse files

fix view for massive summary

parent 376e6cf8
......@@ -48,13 +48,11 @@
{% macro foundableShort(foundable, activities) %}
{% import _self as my_macros %}
{% set percent = my_macros.percent(foundable, activities) %}
<div class="sortable" style="margin-bottom:2px" data-form="{{ foundable.form }}" data-points="{{ foundable.points }}" data-percent="{{ percent }}" data-length="{{ foundable.form|length }}">
<div style="float:left; width:80px">
<div class="label label-default">{{ percent }}</div> &nbsp;
<span class="btn btn-sm" onClick="wiktionnary.getDef('{{ foundable.words[0].root.value }}', '{{ foundable.grid.language.value |slice(0,2) }}')">
<i class="fab fa-wikipedia-w"></i>
</span>
</div>
<div class="list-group-item sortable" data-form="{{ foundable.form }}" data-points="{{ foundable.points }}" data-percent="{{ percent }}" data-length="{{ foundable.form|length }}">
<div class="badge badge-secondary">{{ percent }}</div> &nbsp;
<span class="btn btn-sm btn-secondary" onClick="wiktionnary.getDef('{{ foundable.words[0].root.value }}', '{{ foundable.grid.language.value |slice(0,2) }}')">
<i class="fab fa-wikipedia-w"></i>
</span>
{{ foundable.form | upper }} <span class="text-muted">({{ foundable.points}}pts)</span>
</div>
{% endmacro %}
......@@ -5,35 +5,35 @@
{% set activities = getActivities(round) %}
<div class="card">
<div class="card-header">
{{ round.displayOrder+1 }} {{ round.title }} - {{ round.discr | trans }}
<span class="float-right">
<button type="button" class="btn btn-outline-secondary btn-sm" data-order="asc" onclick="sorter.sort('percent', this, '#round-{{round.id}}', '#round-{{round.id}} div.sortable')">
<i class="fa fa-sort" aria-hidden="true"></i> %
</button>
{% if round.discr == "rush" %}
<button type="button" class="btn btn-outline-secondary btn-sm" data-order="asc" onclick="sorter.sort('form', this, '#round-{{round.id}}', '#round-{{round.id}} div.sortable')">
<i class="fa fa-sort" aria-hidden="true"></i> A-Z
</button>
<button type="button" class="btn btn-outline-secondary btn-sm" data-order="asc" onclick="sorter.sort('points', this, '#round-{{round.id}}', '#round-{{round.id}} div.sortable')">
<i class="fa fa-sort" aria-hidden="true"></i> Points
</button>
<button type="button" class="btn btn-outline-secondary btn-sm" data-order="asc" onclick="sorter.sort('length', this, '#round-{{round.id}}', '#round-{{round.id}} > div.sortable')">
<i class="fa fa-sort" aria-hidden="true"></i> Longueur
</button>
{% endif %}
</span>
{{ round.displayOrder+1 }} {{ round.title }} - {{ round.discr | trans }}
<span class="float-right">
<button type="button" class="btn btn-outline-secondary btn-sm" data-order="asc" onclick="sorter.sort('percent', this, '#round-{{round.id}}', '#round-{{round.id}} div.sortable')">
<i class="fa fa-sort" aria-hidden="true"></i> %
</button>
{% if round.discr == "rush" %}
<button type="button" class="btn btn-outline-secondary btn-sm" data-order="asc" onclick="sorter.sort('form', this, '#round-{{round.id}}', '#round-{{round.id}} div.sortable')">
<i class="fa fa-sort" aria-hidden="true"></i> A-Z
</button>
<button type="button" class="btn btn-outline-secondary btn-sm" data-order="asc" onclick="sorter.sort('points', this, '#round-{{round.id}}', '#round-{{round.id}} div.sortable')">
<i class="fa fa-sort" aria-hidden="true"></i> Points
</button>
<button type="button" class="btn btn-outline-secondary btn-sm" data-order="asc" onclick="sorter.sort('length', this, '#round-{{round.id}}', '#round-{{round.id}} > div.sortable')">
<i class="fa fa-sort" aria-hidden="true"></i> Longueur
</button>
{% endif %}
</span>
</div>
<div class="card-body" style="max-height:200px; overflow-y:auto">
<div id="round-{{round.id}}">
{% if round.discr == "rush" %}
{% for foundable in round.grid.foundableForms %}
{{ foundableMacros.foundableShort(foundable, activities) }}
{% endfor %}
{% elseif round.discr == "conquer" %}
{% for objective in round.objectives %}
{{ objectiveMacros.objectiveShort(objective, activities) }}
{% endfor %}
{% endif %}
<div class="card-body p-0" style="max-height:200px; overflow-y:auto">
<ul class="list-group" id="round-{{round.id}}">
{% if round.discr == "rush" %}
{% for foundable in round.grid.foundableForms %}
{{ foundableMacros.foundableShort(foundable, activities) }}
{% endfor %}
{% elseif round.discr == "conquer" %}
{% for objective in round.objectives %}
{{ objectiveMacros.objectiveShort(objective, activities) }}
{% endfor %}
{% endif %}
</div>
</div>
</div>
......
......@@ -4,17 +4,17 @@
{% for i in range(0,3) %}
<div class="row">
{% for j in range(0, 3) %}
{% set value = grid.squares[x] is defined ? grid.squares[x].letter.value|upper : "_" %}
<li class="col-3 col-3 col-3" id="li-square-{{ i }}-{{ j }}">
<p data-value="{{value}}" style="padding:1px" id="square-{{ i }}-{{ j }}" class="col {{ editable == false ? "read-only": "read-write"}}">
{% if editable %}
<input required id="square-{{ x }}" type="text" style="text-align:center;" name="squares[]" size="1" maxlength="1" value="{{ grid.squares[x] is defined ? grid.squares[x].letter.value : "_" }}" spellcheck=false />
{% else %}
{{ value }}
{% endif %}
</p>
</li>
{% set x = x + 1 %}
{% set value = grid.squares[x] is defined ? grid.squares[x].letter.value|upper : "_" %}
<li class="col-3 col-3 col-3" id="li-square-{{ i }}-{{ j }}">
<p data-value="{{value}}" style="padding:1px" id="square-{{ i }}-{{ j }}" class="col {{ editable == false ? "read-only": "read-write"}}">
{% if editable %}
<input required id="square-{{ x }}" type="text" style="text-align:center;" name="squares[]" size="1" maxlength="1" value="{{ grid.squares[x] is defined ? grid.squares[x].letter.value : "_" }}" spellcheck=false />
{% else %}
{{ value }}
{% endif %}
</p>
</li>
{% set x = x + 1 %}
{% endfor %}
</div>
{% endfor %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment