-{% for other_task_id, other_task in db.tasks.items() | sort(attribute='1.title') %}
-{% if task.id_ != other_task_id and other_task.visible and other_task_id in task.links %}
-<input name="link_{{other_task_id}}" type="checkbox" checked /> <a href="{{db.prefix}}/task?id={{ other_task_id }}">{{ other_task.title|e }}</a><br />
-{% endif %}
+<table>
+{% for task in linked_tasks %}
+<tr>
+<td><input name="link_task" type="checkbox" value="{{task.id_}}" checked/></td>
+<td><a href="task?id={{task.id_}}">{{task.title}}</a></td>
+</tr>