aboutsummaryrefslogtreecommitdiffstats
path: root/jm2l/templates/Staff/list.mako
diff options
context:
space:
mode:
Diffstat (limited to 'jm2l/templates/Staff/list.mako')
-rw-r--r--jm2l/templates/Staff/list.mako63
1 files changed, 33 insertions, 30 deletions
diff --git a/jm2l/templates/Staff/list.mako b/jm2l/templates/Staff/list.mako
index f8ddb4a..b2cbe5d 100644
--- a/jm2l/templates/Staff/list.mako
+++ b/jm2l/templates/Staff/list.mako
@@ -1,35 +1,45 @@
# -*- coding: utf-8 -*-
<%inherit file="jm2l:templates/layout.mako"/>
-
+<%
+from slugify import slugify
+%>
+<a style="float:right;" class="btn btn-mini btn-info" role="button" href="/Staff/poles">
+ <i class="icon-plus-sign icon-white"></i> Ajouter un Pôle d'activité
+</a>
<h3>Liste des tâches JM2L Staff</h3>
-
<div class="tabbable" id="main_tab">
<ul class="nav nav-tabs" style="margin-bottom: 5px;">
- % for Num, Entity_Type in enumerate(tasks.keys()):
+ % for Num, Entity in enumerate(sorted(tasks.keys(), key=lambda x:x.name)):
<li class="${["","active"][Num==0]}">
- <a href="#${Entity_Type}" id="Map_${Entity_Type}" data-toggle="tab">${Entity_Type}</a>
+ <a href="#${slugify(Entity.name)}" id="Map_Pole_${slugify(Entity.name)}" data-toggle="tab">${Entity.name}</a>
</li>
% endfor
</ul>
<div class="tab-content" style="padding:0 10px">
-% for Num, Entity_Type in enumerate(tasks.keys()):
- <div class="tab-pane fade ${["","active "][Num==0]} in" id="${Entity_Type}">
+% for Num, Entity in enumerate(sorted(tasks.keys(), key=lambda x:x.name)):
+ <div class="tab-pane fade ${["","active "][Num==0]} in" id="${slugify(Entity.name)}">
+ <a style="float:right;" class="btn btn-mini btn-info" role="button" href="/Staff/poles/${Entity.uid}">
+ <i class="icon-pencil icon-white"></i> Editer le pôle
+ </a>
+ <h4>${Entity.name}</h4>
+ <div>${Entity.description | n}</div>
<table width="100%" class="table table-striped table-bordered table-hover">
<thead>
<tr>
- <th colspan="2" style="text-align:center;">Nom
+ <th colspan="2" style="text-align:center;">
<a style="float:right;" class="btn btn-mini btn-info" role="button" href="/Staff/tasks">
<i class="icon-plus-sign icon-white"></i> Ajouter une tâche
</a>
+ Liste des tâches
</th>
</tr>
</thead>
<tbody>
- % for task in tasks[Entity_Type]:
+ % for task in tasks[Entity]:
<tr>
<td>
% if task.closed:
@@ -63,25 +73,18 @@
% endfor
</div>
-%if 0:
-<ul id="tasks">
-% if tasks:
- % for task in tasks:
- <li>
- <span class="name">${task.name}</span>
- <div class="actions">
- [ <a href="/Staff/tasks/${task.uid}">edit</a> - <a href="/Staff/close/${task.uid}">close</a> ]
- </div>
- %if task.description:
- ${task.description | n}
- %endif
- </li>
- % endfor
-% else:
- <li>Il n'y a pas de tâches ouverte.</li>
-% endif
- <li class="last">
- <a href="/Staff/new">Créer une nouvelle tâche</a>
- </li>
-</ul>
-%endif \ No newline at end of file
+
+<%def name="jsAddOn()">
+<script>
+ $('a[data-toggle="tab"]')
+ .on('shown', function(e) {
+ //stateObj = { tab: $(e.target).attr('href').substr(1) };
+ //history.replaceState(stateObj, "", "/Staff" + $(e.target).attr('href') );
+ location.hash = $(e.target).attr('href');
+ });
+
+ if (location.hash !== '') {
+ $('a[href="' + location.hash + '"]').tab('show');
+ }
+</script>
+</%def> \ No newline at end of file