aboutsummaryrefslogtreecommitdiffstats
path: root/jm2l/templates/Staff
diff options
context:
space:
mode:
Diffstat (limited to 'jm2l/templates/Staff')
-rw-r--r--jm2l/templates/Staff/list.mako63
-rw-r--r--jm2l/templates/Staff/tasks.mako7
2 files changed, 37 insertions, 33 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
diff --git a/jm2l/templates/Staff/tasks.mako b/jm2l/templates/Staff/tasks.mako
index df0c255..d3d9ded 100644
--- a/jm2l/templates/Staff/tasks.mako
+++ b/jm2l/templates/Staff/tasks.mako
@@ -15,6 +15,7 @@
<noscript><link rel="stylesheet" href="/vendor/fileupload/css/jquery.fileupload-noscript.css"></noscript>
<noscript><link rel="stylesheet" href="/vendor/fileupload/css/jquery.fileupload-ui-noscript.css"></noscript>
</%def>
+<a style="float:right;" href="/Staff">Retour à la liste</a>
% if 'uid' in form._fields.keys():
<h3>Editer une tâche</h3>
% else:
@@ -24,9 +25,9 @@
DicForm = {
'name': {'PlaceHolder':u"Nom de la tâche", "FieldStyle":"width:90%;" },
'area_uid': {'PlaceHolder':u"Pôle", "FieldStyle":"width:16em;", 'ContainerStyle':"float:left;" },
- 'due_date': {'PlaceHolder':u"27/11/2015", "FieldStyle":"width:8em;", 'ContainerStyle':"float:left;"},
- 'closed_by': {'PlaceHolder':u"Assigné à", "FieldStyle":"width:16em;" },
- 'description': {'PlaceHolder':u"Description", "FieldStyle":"width:95%;min-height:150px;" },
+ 'closed_by': {'PlaceHolder':u"Assigné à", "FieldStyle":"width:16em;", 'ContainerStyle':"float:left;" },
+ 'due_date': {'PlaceHolder':u"27/11/2015", "FieldStyle":"width:8em;"},
+ 'description': {'PlaceHolder':u"Description", "FieldStyle":"width:95%;min-height:150px;", "ckeditor":"1" },
}
%>