Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {% extends "admin/work/work_menu.html" %}
- {% block task %}
- {% macro increment(dct, key, inc=1)%}
- {% if dct.update({key: dct[key] + inc}) %} {% endif %}
- {% endmacro %}
- {% macro decrement(dct, key, dec=1)%}
- {% if dct.update({key: dct[key] - dec}) %} {% endif %}
- {% endmacro %}
- {% macro clear(dct, key, default=0)%}
- {% if dct.update({key: default}) %} {% endif %}
- {% endmacro %}
- {% set counter = {
- 'task_done': 0,
- 'task_open': 0
- } %}
- <div class="panel-group" id="accordion">
- {% for work in wpackages %}
- {% clear(counter, 'task_done') %}
- {% clear(counter, 'task_open') %}
- {% for workt in wpackaget %}
- {% if workt.workp_id == work.id %}
- {% for task in tasks %}
- {% if task.id == workt.task_id %}
- {% increment(counter, 'task_open') %}
- {% if task.done %}
- {% increment(counter, 'task_done') %}
- {% endif %}
- {% endif %}
- {% endfor %}
- {% endif %}
- {% endfor %}
- <div class="panel panel-default">
- <div class="panel-heading">
- <h4 class="panel-title">
- <a data-toggle="collapse" data-parent="#accordion" href="#work{{work.id}}" class="collapsed">
- <i class="fa fa-chevron-up pull-right"></i>
- {{ work.name }} ({{ counter.task_done }} / {{ coutner.task_count }})
- </a>
- </h4>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement