Browse Source

improved user interface

Damien Accorsi 11 years ago
parent
commit
743fb75fa7

+ 41 - 0
pboard/pboard/lib/helpers.py View File

@@ -39,3 +39,44 @@ def getExplanationAboutStatus(psStatusId, psCurrentStatusId):
39 39
       return _("Close the item if you want not to see it anymore. The data won't be deleted")
40 40
     if psStatusId=='deleted':
41 41
       return _("This status tells that the item has been deleted.")
42
+
43
+class ID(object):
44
+  """ Helper class that will manage html items ids that need to be shared"""
45
+
46
+  @classmethod
47
+  def AddDocumentModalForm(cls, poNode=None):
48
+    if poNode:
49
+      return 'add-document-modal-form-%d'%poNode.node_id
50
+    else:
51
+      return 'add-document-modal-form'
52
+
53
+  @classmethod
54
+  def AddContactModalForm(cls, poNode=None):
55
+    if poNode:
56
+      return 'add-contact-modal-form-%d'%poNode.node_id
57
+    else:
58
+      return 'add-contact-modal-form'
59
+
60
+  @classmethod
61
+  def AddFileModalForm(cls, poNode=None):
62
+    if poNode:
63
+      return 'add-file-modal-form-%d'%poNode.node_id
64
+    else:
65
+      return 'add-file-modal-form'
66
+
67
+  @classmethod
68
+  def AddEventModalForm(cls, poNode=None):
69
+    if poNode:
70
+      return 'add-event-modal-form-%d'%poNode.node_id
71
+    else:
72
+      return 'add-event-modal-form'
73
+    ## Original id is 'current-document-add-event-form'
74
+
75
+  @classmethod
76
+  def AddCommentInlineForm(cls):
77
+    return 'current-document-add-comment-form'
78
+
79
+class ICON(object):
80
+  Shared = '<i class="fa fa-group"></i>'
81
+  Private = '<i class="fa fa-key"></i>'
82
+

+ 1 - 144
pboard/pboard/public/javascript/pod.js View File

@@ -41,6 +41,7 @@
41 41
       $('#voiceBtn').hide();
42 42
     }
43 43
   };
44
+  
44 45
   function showErrorAlert (reason, detail) {
45 46
     var msg='';
46 47
     if (reason==='unsupported-file-type') { msg = "Unsupported format " +detail; }
@@ -53,53 +54,6 @@
53 54
 
54 55
   $(document).ready(function() {
55 56
 
56
-    $('#create_document_save_button').on('click', function(e){
57
-      // We don't want this to act as a link so cancel the link action
58
-      e.preventDefault();
59
-
60
-      // Find form and submit it
61
-      $('#create_document_form').submit();
62
-    });
63
-
64
-// ## FIXME                $('#current_node_textarea').wysihtml5({
65
-// ## FIXME                  "font-styles": true, //Font styling, e.g. h1, h2, etc. Default true
66
-// ## FIXME                  "emphasis": true, //Italics, bold, etc. Default true
67
-// ## FIXME                  "lists": true, //(Un)ordered lists, e.g. Bullets, Numbers. Default true
68
-// ## FIXME                  "html": true, //Button which allows you to edit the generated HTML. Default false
69
-// ## FIXME                  "link": true, //Button to insert a link. Default true
70
-// ## FIXME                  "image": true, //Button to insert an image. Default true,
71
-// ## FIXME                  // "color": true //Button to change color of font  
72
-// ## FIXME                });
73
-// ## FIXME                $('#current_node_textarea').css('margin-bottom', '0');
74
-// ## FIXME                $('#current_node_textarea').css("min-height", "12em");
75
-// ## FIXME                $('#current_node_textarea').addClass("span5");
76
-
77
-// ###################
78
-// ##
79
-// ## HERE
80
-// ##
81
-// ###################
82
-
83
-// ##
84
-// ## RE-IMPLEMENT THIS SOON !!!
85
-// ##
86
-// ##                /* Edit title form */
87
-// ##                $("#current-document-title-edit-form" ).css("display", "none");
88
-// ##                $("#current-document-title" ).dblclick(function() {
89
-// ##                  $("#current-document-title" ).css("display", "none");
90
-// ##                  $("#current-document-title-edit-form" ).css("display", "block");
91
-// ##                });
92
-// ##                $("#current-document-title-edit-cancel-button" ).click(function() {
93
-// ##                  $("#current-document-title" ).css("display", "block");
94
-// ##                  $("#current-document-title-edit-form" ).css("display", "none");
95
-// ##                });
96
-// ##                $('#current-document-title-save-cancel-button').on('click', function(e){
97
-// ##                  // We don't want this to act as a link so cancel the link action
98
-// ##                  e.preventDefault();
99
-// ##                  $('#current-document-title-edit-form').submit();
100
-// ##                });
101
-
102
-
103 57
     /* EDIT CONTENT FORM */
104 58
     $("#current-document-content-edit-form" ).css("display", "none");
105 59
     $("#current-document-content-edit-button" ).click(function() {
@@ -121,90 +75,6 @@
121 75
       $('#current-document-content-edit-form').submit();
122 76
     });
123 77
 
124
-    /* ADD EVENT => FORM */
125
-    $('#add_event_data_content_textarea').wysiwyg();
126
-    $('#add_event_data_content_textarea').css('margin-bottom', '0');
127
-    $('#add_event_data_content_textarea').css("height", "4em");
128
-    $('#add_event_data_content_textarea').addClass("span3");
129
-    /* ADD EVENT => SHOW/HIDE/SUBMIT BUTTONS */
130
-    $("#current-document-add-event-button" ).click(function() {
131
-      $("#current-document-add-event-form" ).css("display", "block");
132
-      $("#current-document-add-event-button" ).css("display", "none");
133
-    });
134
-    $('#current-document-add-event-cancel-button').on('click', function(e){
135
-      $("#current-document-add-event-form" ).css("display", "none");
136
-      $("#current-document-add-event-button" ).css("display", "block");
137
-    });
138
-    $('#current-document-add-event-save-button').on('click', function(e){
139
-      e.preventDefault(); // We don't want this to act as a link so cancel the link action
140
-      $('#add_event_data_content_textarea_wysiwyg').cleanHtml();
141
-      $('#add_event_data_content_textarea').val($('#add_event_data_content_textarea_wysiwyg').html());
142
-      $('#current-document-add-event-form').submit();
143
-    });
144
-
145
-    /* ADD CONTACT => FORM */
146
-    $('#add_contact_data_content_textarea').wysiwyg();
147
-    $('#add_contact_data_content_textarea').css('margin-bottom', '0');
148
-    $('#add_contact_data_content_textarea').css("height", "4em");
149
-    $('#add_contact_data_content_textarea').addClass("span3");
150
-    /* ADD CONTACT => SHOW/HIDE/SUBMIT BUTTONS */
151
-    $("#current-document-add-contact-button" ).click(function() {
152
-      $("#current-document-add-contact-form" ).css("display", "block");
153
-      $("#current-document-add-contact-button" ).css("display", "none");
154
-    });
155
-    $('#current-document-add-contact-cancel-button').on('click', function(e){
156
-      $("#current-document-add-contact-form" ).css("display", "none");
157
-      $("#current-document-add-contact-button" ).css("display", "block");
158
-    });
159
-    $('#current-document-add-contact-save-button').on('click', function(e){
160
-      e.preventDefault(); // We don't want this to act as a link so cancel the link action
161
-      $('#add_contact_data_content_textarea_wysiwyg').cleanHtml();
162
-      $('#add_contact_data_content_textarea').val($('#add_contact_data_content_textarea_wysiwyg').html());
163
-      $('#current-document-add-contact-form').submit();
164
-    });
165
-
166
-
167
-    /* ADD COMMENT => FORM */
168
-    $('#add_comment_data_content_textarea').wysiwyg();
169
-    $('#add_comment_data_content_textarea').css('margin-bottom', '0');
170
-    $('#add_comment_data_content_textarea').css("height", "4em");
171
-    $('#add_comment_data_content_textarea').addClass("span3");
172
-    /* ADD COMMENT => SHOW/HIDE/SUBMIT BUTTONS */
173
-    $("#current-document-add-comment-button" ).click(function() {
174
-      $("#current-document-add-comment-form" ).css("display", "block");
175
-      $("#current-document-add-comment-button" ).css("display", "none");
176
-    });
177
-    $('#current-document-add-comment-cancel-button').on('click', function(e){
178
-      $("#current-document-add-comment-form" ).css("display", "none");
179
-      $("#current-document-add-comment-button" ).css("display", "block");
180
-    });
181
-    $('#current-document-add-comment-save-button').on('click', function(e){
182
-      e.preventDefault(); // We don't want this to act as a link so cancel the link action
183
-      $('#add_comment_data_content_textarea_wysiwyg').cleanHtml();
184
-      $('#add_comment_data_content_textarea').val($('#add_comment_data_content_textarea_wysiwyg').html());
185
-      $('#current-document-add-comment-form').submit();
186
-    });
187
-
188
-    /* ADD FILE => FORM */
189
-    $('#add_file_data_content_textarea').wysiwyg();
190
-    $('#add_file_data_content_textarea').css('margin-bottom', '0');
191
-    $('#add_file_data_content_textarea').css("height", "4em");
192
-    $('#add_file_data_content_textarea').addClass("span3");
193
-    /* ADD FILE => SHOW/HIDE/SUBMIT BUTTONS */
194
-    $("#current-document-add-file-button" ).click(function() {
195
-      $("#current-document-add-file-form" ).css("display", "block");
196
-      $("#current-document-add-file-button" ).css("display", "none");
197
-    });
198
-    $('#current-document-add-file-cancel-button').on('click', function(e){
199
-      $("#current-document-add-file-form" ).css("display", "none");
200
-      $("#current-document-add-file-button" ).css("display", "block");
201
-    });
202
-    $('#current-document-add-file-save-button').on('click', function(e){
203
-      e.preventDefault(); // We don't want this to act as a link so cancel the link action
204
-      $('#add_file_data_content_textarea_wysiwyg').cleanHtml();
205
-      $('#add_file_data_content_textarea').val($('#add_file_data_content_textarea_wysiwyg').html());
206
-      $('#current-document-add-file-form').submit();
207
-    });
208 78
 
209 79
     $(function() {
210 80
       $('.datetime-picker-input-div').datetimepicker({
@@ -213,19 +83,6 @@
213 83
       });
214 84
     });
215 85
 
216
-/*
217
-    // Allow to go directly to required tab on load
218
-    // Javascript to enable link to tab
219
-    var url = document.location.toString();
220
-    if (url.match('#')) {
221
-      $('.nav-tabs a[href=#'+url.split('#')[1]+']').tab('show') ;
222
-    } 
223
-
224
-    // Change hash for page-reload
225
-    $('.nav-tabs a').on('shown', function (e) {
226
-      window.location.hash = e.target.hash;
227
-    })
228
-*/
229 86
     // #################################
230 87
     // ##
231 88
     // ## The following JS code allow t

+ 162 - 12
pboard/pboard/templates/document-widgets-tabs.mak View File

@@ -295,19 +295,16 @@
295 295
   </div>
296 296
 </%def>
297 297
 
298
-<%def name="FilesTabContent(poNode)">
299
-  <h4>${_('Attachments')}</h4> 
300
-% if len(poNode.getFiles())<=0:
301
-  <p class="pod-grey">${_("There is currently no attachment.")}<br/></p>
302
-  <p>${POD.OpenModalButton('create-new-file-modal-form', _(' Attach first file'))}</p>
303
-% else:
304
-  <p>${POD.OpenModalButton('create-new-file-modal-form', _(' Attach a file'))}</p>
305
-% endif
298
+<%def name="FileTabContent(poNode)">
299
+  <h4>${_('Attachments')}</h4>
300
+  
301
+  % if len(poNode.getFiles())<=0:
302
+    <p class="pod-grey">${_("There is currently no attachment.")}<br/></p>
303
+    <p>${POD.OpenModalButton(h.ID.AddFileModalForm(poNode), _(' Attach first file'))}</p>
304
+  % else:
305
+    <p>${POD.OpenModalButton(h.ID.AddFileModalForm(poNode), _(' Attach a file'))}</p>
306
+  % endif
306 307
 
307
-  ${DOC.FileEditModalDialog(poNode.node_id, None, tg.url('/api/create_file'), 'create-new-file-modal-form', 'Add a new file')}
308
-
309
-
310
-  <!-- LIST OF FILES -->
311 308
   <div>
312 309
     % if len(poNode.getFiles())>0:
313 310
       % for loFile in poNode.getFiles():
@@ -331,3 +328,156 @@
331 328
     % endif
332 329
   </div>
333 330
 </%def>
331
+
332
+<%def name="SubdocumentContent(poNode)">
333
+  <h4>${_('Sub-documents')}</h4>
334
+  
335
+  % if len(poNode.getChildren())<=0:
336
+    <p class="pod-grey">${_("There is currently no child documents.")}</p>
337
+  % endif
338
+  <p>${POD.OpenModalButton(h.ID.AddDocumentModalForm(poNode), _('Add a document'))}</p>
339
+
340
+  % if len(poNode.getChildren())>0:
341
+    <div>
342
+      % for subnode in poNode.getChildren():
343
+        <p style="list-style-type:none;">
344
+          <i class="fa-fw ${subnode.getIconClass()}"></i>
345
+            <a href="${tg.url('/document/%i'%subnode.node_id)}">
346
+              ${subnode.data_label}
347
+            </a>
348
+        </p>
349
+      % endfor
350
+    </div>
351
+  % endif
352
+</%def>
353
+
354
+<%def name="EventTabContent(poNode)">
355
+  <h4>${_('Calendar')}</h4>
356
+  
357
+  % if len(poNode.getEvents())<=0:
358
+    <p class="pod-grey">${_("The calendar is empty.")}<br/></p>
359
+    <p>${POD.OpenModalButton(h.ID.AddEventModalForm(poNode), _(' Add first event'))}</p>
360
+  % else:
361
+    <p>${POD.OpenModalButton(h.ID.AddEventModalForm(poNode), _(' Add an event'))}</p>
362
+  % endif
363
+
364
+  % if len(poNode.getEvents())>0:
365
+    <table class="table table-striped table-hover table-condensed">
366
+      <thead>
367
+        <tr>
368
+          <th>Date</th>
369
+          <th>Time</th>
370
+          <th>
371
+            Event
372
+          </th>
373
+          <th>
374
+            <a href="" title="Add an event"><i class="icon-g-plus"></i></a>
375
+          </th>
376
+        </tr>
377
+      </thead>
378
+      % for event in poNode.getEvents():
379
+        <tr class="item-with-data-popoverable" data-content="${event.data_content}" rel="popover" data-placement="left" data-trigger="hover">
380
+          <td>${event.getFormattedDate(event.data_datetime)}</td>
381
+          <td>${event.getFormattedTime(event.data_datetime)}</td>
382
+          <td>${event.data_label}</td>
383
+        </tr>
384
+  ## FIXME                    <script>
385
+  ##                      $('.item-with-data-popoverable').popover({ html: true});
386
+  ##                    </script>
387
+
388
+      % endfor
389
+    </table>
390
+  % endif
391
+</%def>
392
+
393
+<%def name="ContactTabContent(poNode)">
394
+  <h4>${_('Address book')}</h4> 
395
+  % if len(poNode.getContacts())<=0:
396
+    <p class="pod-grey">${_("The address book is empty.")}<br/></p>
397
+    <p>${POD.OpenModalButton(h.ID.AddContactModalForm(poNode), _('Add first contact'))}</p>
398
+  % else:
399
+    <p>${POD.OpenModalButton(h.ID.AddContactModalForm(poNode), _('Add a contact'))}</p>
400
+  % endif
401
+
402
+  <!-- LIST OF CONTACT NODES -->
403
+  % for contact in poNode.getContacts():
404
+    <div class="well">
405
+      <legend class="text-info">
406
+        ${contact.data_label}
407
+        ## TODO - 2013-11-20 - Use the right form in order to update meta-data
408
+        <a class="pull-right" href="${tg.url('/document/%i'%contact.node_id)}"><i class="fa fa-edit"></i></a>
409
+      </legend>
410
+      
411
+      <div>
412
+        ## FIXME - D.A. - 2013-11-15 - Implement localisation stuff <a style='float: right;' href="" title='${_('Search on google maps')}'><i class='icon-g-google-maps'></i></a>
413
+        ${contact.data_content|n}
414
+      </div>
415
+    </div>
416
+  % endfor
417
+</%def>
418
+
419
+<%def name="CommentTabContent(poNode)">
420
+  <h4>${_('Comment thread')}</h4>
421
+  
422
+  % if len(poNode.getComments())<=0:
423
+    <p class="pod-grey">${_("The comment thread is empty.")}<br/></p>
424
+  % endif
425
+
426
+  % if len(poNode.getComments())>0:
427
+    % if len(poNode.getComments())>5:
428
+      ##
429
+      ## We show a "direct down" button in case the page is too long
430
+      ##
431
+      <p>${POD.OpenLinkButton(h.ID.AddCommentInlineForm(), _('Add a comment'))}</p>
432
+    % endif
433
+    <div>
434
+      % for comment in poNode.getComments():
435
+        <p>
436
+          <a href="${tg.url('/api/toggle_share_status', dict(node_id=comment.node_id))}">
437
+            % if comment.is_shared:
438
+              <span class="label label-warning" title="${_('Shared comment. Click to make private.')}">${h.ICON.Shared|n}</span>
439
+            % else:
440
+              <span class="label label-info" title="${_('Private comment. Click to share.')}">${h.ICON.Private|n}</span>
441
+            % endif
442
+          </a>
443
+          <strong>${comment._oOwner.display_name}</strong>
444
+          <i class="pull-right">
445
+            The ${comment.getFormattedDate(comment.updated_at)} 
446
+            at ${comment.getFormattedTime(comment.updated_at)}
447
+          </i>
448
+          <br/>
449
+          ${comment.data_content|n}
450
+          <hr style="border-top: 1px dotted #ccc; margin: 0;"/>
451
+        </p>
452
+      % endfor
453
+    </div>
454
+  % endif
455
+
456
+  <form class="form" id="${h.ID.AddCommentInlineForm()}" action="${tg.url('/api/create_comment')}" method="POST">
457
+    <input type="hidden" name='parent_id' value='${poNode.node_id}'/>
458
+    <input type="hidden" name='data_label' value=""/>
459
+    <input type="hidden" id="add_comment_data_content_textarea" name='data_content' />
460
+    <label>
461
+      ${_('Write your comment below:')}
462
+      ${POD.RichTextEditor('add_comment_data_content_textarea_wysiwyg', '', 'boldanditalic')}
463
+    </label>
464
+    <label>
465
+      <input type="checkbox" name='is_shared'/> ${_('Share this comment')}
466
+    </label>
467
+    <span class="pull-right">
468
+      % if len(poNode.getComments())<=0:
469
+        ${POD.SaveButton('current-document-add-comment-save-button', True, _('Add first comment'))}
470
+      % else:
471
+        ${POD.SaveButton('current-document-add-comment-save-button', True, _('Comment'))}
472
+      % endif
473
+    </span>
474
+  </form>
475
+  <script>
476
+      $('#current-document-add-comment-save-button').on('click', function(e){
477
+      e.preventDefault(); // We don't want this to act as a link so cancel the link action
478
+      $('#add_comment_data_content_textarea_wysiwyg').cleanHtml();
479
+      $('#add_comment_data_content_textarea').val($('#add_comment_data_content_textarea_wysiwyg').html());
480
+      $('#current-document-add-comment-form').submit();
481
+    });
482
+  </script>
483
+</%def>

+ 213 - 54
pboard/pboard/templates/document-widgets.mak View File

@@ -24,6 +24,22 @@
24 24
   % endif
25 25
 </%def>
26 26
 
27
+<%def name="ToolbarMenuItemModal(psTargetModalId, psIconClasses, psMenuLabel)">
28
+  <li><a href="#${psTargetModalId}" role="button" data-toggle="modal"><i class="${psIconClasses}"></i> ${psMenuLabel}</a></li>
29
+</%def>
30
+
31
+<%def name="ToolbarMenuItemInline(psTargetId, psIconClasses, psMenuLabel)">
32
+  <li><a href="#${psTargetId}"><i class="${psIconClasses}"></i> ${psMenuLabel}</a></li>
33
+</%def>
34
+<%def name="ToolbarMenuItemLink(psTargetUrl, psIconClasses, psMenuLabel, psLinkCss='', psLinkTitle='')">
35
+  % if psTargetUrl=='#':
36
+    <li class="disabled"><a href="${psTargetUrl}" class="${psLinkCss}" title="${psLinkTitle}"><i class="${psIconClasses}"></i> ${psMenuLabel}</a></li>
37
+  % else:
38
+    <li><a href="${psTargetUrl}" class="${psLinkCss}" title="${psLinkTitle}"><i class="${psIconClasses}"></i> ${psMenuLabel}</a></li>
39
+  % endif
40
+</%def>
41
+
42
+        
27 43
 <%def name="Toolbar(poNode, plNodeStatusList, plRootNodes, psDivId)">
28 44
   <div id="${psDivId}">
29 45
     <div class="btn-group">
@@ -36,19 +52,22 @@
36 52
         <span class="caret"></span>
37 53
       </a>
38 54
       <ul class="dropdown-menu">
55
+        <li>
56
+          <div class="pod-grey strong" ><strong><i class="fa fa-magic"></i> ${_('Current status is...')}</strong><br/></div>
57
+        </li>
39 58
       % for node_status in plNodeStatusList:
40 59
         % if node_status.status_id==poNode.getStatus().status_id:
41
-        <li title="${h.getExplanationAboutStatus(node_status.status_id, current_node.getStatus().status_id)}">
42
-          <a class="${node_status.css}" href="#"  style="color: #999;">
43
-            <i class="${node_status.icon_id}"></i> ${node_status.label}
44
-          </a>
45
-        </li>
46
-        % else:
47
-        <li title="${h.getExplanationAboutStatus(node_status.status_id, current_node.getStatus().status_id)}">
48
-          <a class="${node_status.css}" href="${tg.url('/api/edit_status?node_id=%i&node_status=%s'%(current_node.node_id, node_status.status_id))}">
49
-            <i class="${node_status.icon_id}"></i> ${node_status.label}
50
-          </a>
60
+          ${ToolbarMenuItemLink('#', node_status.icon_id, node_status.label, 'disabled '+node_status.css, h.getExplanationAboutStatus(node_status.status_id, current_node.getStatus().status_id))}
61
+        % endif
62
+      % endfor
63
+        <li class="divider" role="presentation"></li>
64
+        <li>
65
+          <div class=" strong" ><strong><i class="fa fa-magic"></i> ${_('Change to...')}</strong><br/></div>
66
+          <div class="pod-grey"><i>${_('change the status to...')}</i></div>
51 67
         </li>
68
+      % for node_status in plNodeStatusList:
69
+        % if node_status.status_id!=poNode.getStatus().status_id:
70
+          ${ToolbarMenuItemLink(tg.url('/api/edit_status', dict(node_id=current_node.node_id, node_status=node_status.status_id)), node_status.icon_id, node_status.label, node_status.css, h.getExplanationAboutStatus(node_status.status_id, current_node.getStatus().status_id))}
52 71
         % endif
53 72
       % endfor
54 73
       </ul>
@@ -61,15 +80,18 @@
61 80
       <ul class="dropdown-menu">
62 81
       
63 82
         <li>
64
-          <div class="btn-success strong" ><strong><i class="fa fa-magic"></i> Add New...</strong><br/></div>
65
-          <div class="pod-grey"><i>create a totally new item...</i></div>
83
+          <div class="btn-success strong" ><strong><i class="fa fa-magic"></i> ${_('Add New...')}</strong><br/></div>
84
+          <div class="pod-grey"><i>${_('create a totally new item...')}</i></div>
66 85
         </li>
67 86
 
68
-        <li><a><i class="fa fa-file-text-o"></i> Document</a></li>
69
-        <li><a><i class="fa fa-paperclip"></i> File</a></li>
70
-        <li><a><i class="fa fa-calendar"></i> Event</a></li>
71
-        <li><a><i class="fa fa-user"></i> Contact</a></li>
72
-        <li><a><i class="fa fa-comments-o"></i> Comment</a></li>
87
+        ${ToolbarMenuItemModal(h.ID.AddDocumentModalForm(current_node), 'fa fa-file-text-o', _('Document'))}
88
+        ${ToolbarMenuItemModal(h.ID.AddFileModalForm(current_node), 'fa fa-paperclip', _('File'))}
89
+        ${ToolbarMenuItemModal(h.ID.AddEventModalForm(current_node), 'fa fa-calendar', _('Event'))}
90
+        ${ToolbarMenuItemModal(h.ID.AddContactModalForm(current_node), 'fa fa-user', _('Contact'))}
91
+##
92
+## FIXME - DA - 07-05-2014 - The link below is not working clean
93
+##
94
+        ${ToolbarMenuItemInline(h.ID.AddCommentInlineForm(), 'fa fa-comments-o', _('Comment'))}
73 95
 
74 96
         <li class="divider" role="presentation"></li>
75 97
 
@@ -77,12 +99,7 @@
77 99
           <div class="btn-warning strong" ><strong><i class="fa fa-link"></i> Add Existing...</strong><br/></div>
78 100
           <div class="pod-grey"><i>link to an existing item...</i></div>
79 101
         </li>
80
-        <li><a><i class="fa fa-file-text-o"></i> Document</a></li>
81
-        <li><a><i class="fa fa-paperclip"></i> File</a></li>
82
-        <li><a><i class="fa fa-calendar"></i> Event</a></li>
83
-        <li><a><i class="fa fa-user"></i> Contact</a></li>
84
-        <li><a><i class="fa fa-comments-o"></i> Comment</a></li>
85
-
102
+        <li><p class="pod-grey"><i class="fa fa-danger"></i> coming soon!</p></li>
86 103
       </ul>
87 104
     </div>
88 105
     <div class="btn-group ">
@@ -112,16 +129,20 @@
112 129
 <%def name="BreadCrumb(poNode)">
113 130
   <ul class="breadcrumb span12">
114 131
     <li>
115
-      <span class="divider"> / Documents /</span>
132
+      <span class="divider">/</span>
133
+      <a href="${tg.url('/document/')}">Documents</a>
116 134
     </li>
117 135
     % if poNode!=None:
118 136
       % for breadcrumb_node in poNode.getBreadCrumbNodes():
119 137
       <li>
120
-        <a href="${tg.url('/document/%s'%(breadcrumb_node.node_id))}">${breadcrumb_node.getTruncatedLabel(30)}</a>
121 138
         <span class="divider">/</span>
139
+        <a href="${tg.url('/document/%s'%(breadcrumb_node.node_id))}">${breadcrumb_node.getTruncatedLabel(30)}</a>
122 140
       </li>
123 141
       % endfor
124
-      <li class="active">${poNode.data_label}</li>
142
+      <li class="active">
143
+        <span class="divider">/</span>
144
+        ${poNode.data_label}
145
+      </li>
125 146
     % endif
126 147
   </ul>
127 148
 </%def>
@@ -140,13 +161,16 @@
140 161
     <div style="padding: 0.5em 0 0 0">
141 162
       <input type="hidden" name="node_id" value="${current_node.node_id}"/>
142 163
       <input type="hidden" name="data_content" id="current_node_textarea" />
143
-      <input
144
-        type="text"
145
-        name="data_label"
146
-        value="${current_node.data_label}"
147
-        class="span4"
148
-        placeholder="${_('document title')}"
149
-      />
164
+      <label>
165
+        ${_('Title')}
166
+        <input
167
+          type="text"
168
+          name="data_label"
169
+          value="${current_node.data_label}"
170
+          class="span4"
171
+          placeholder="${_('document title')}"
172
+        />
173
+      </label>
150 174
     </div>
151 175
     <div>
152 176
       ${POD.RichTextEditor('current_node_textarea_wysiwyg', current_node.data_content)}
@@ -220,26 +244,32 @@
220 244
 <%def name="FirstTimeFakeDocument()">
221 245
   <div id='application-document-panel' class="span5">
222 246
     <div id='current-document-content' class="">
223
-      <p class="alert alert-info">
224
-        <i class="fa  fa-smile-o"></i> <strong>${_('Welcome aboard.')}</strong>
225
-      </p>
226
-      <p>
227
-        ${_('It appears you do not have any document yet. We suggest you to start by creating a new document.')}
228
-      </p>
229
-      <p>
230
-        ${_('We suggest you to start by creating a new document.')}
231
-      </p>
232
-      <p class="alert alert-info">
233
-        <i class="fa fa-info-circle"></i> ${_('<strong>Note :</strong> You can even create a dummy document: you will be able to remove it later.')|n}
247
+      <p class="well">
248
+        <strong>${_('Welcome aboard')}</strong>
249
+        <i class="fa fa-smile-o fa-2x"></i>
234 250
       </p>
251
+      ${_('<p>We suggest you to...<br/><br/></p>')|n}
252
+      <h4>
253
+        <i class="fa fa-angle-double-left fa-3x fa-fw pod-blue" style="vertical-align: middle"></i>
254
+        ${_('work on existing documents')}
255
+      </h4>
256
+      <p class="text-center">${_('or')}</p>
257
+      <h4 class="text-right">
258
+        ${_('create a new document')}
259
+        <i class="fa fa-angle-double-down fa-3x fa-fw pod-blue" style="vertical-align: middle"></i>
260
+      </h4>
235 261
       <p class="pull-right">
236
-        <a href="#create-new-document-modal-form" role="button" class="btn btn-success" data-toggle="modal">
262
+        <a href="#${h.ID.AddDocumentModalForm()}" role="button" class="btn btn-success" data-toggle="modal">
237 263
           <i class="fa fa-plus"></i>
238
-          ${_('Create your first document')}
264
+          ${_('Create a new document')}
239 265
         </a>
240 266
       </p>
241 267
   
242
-      ${DocumentEditModalDialog(None, None, tg.url('/api/create_document'), 'create-new-document-modal-form', 'Create your first document')}
268
+      ${DocumentEditModalDialog(None, None, tg.url('/api/create_document'), h.ID.AddDocumentModalForm(), 'Create your first document')}
269
+      <div style="clear: both;"></div>
270
+      <p class="alert alert-info" style="margin-top: 2em;">
271
+        <i class="fa fa-info-circle"></i> ${_('<strong>Note :</strong> You can even create a dummy document: you will be able to remove it later.')|n}
272
+      </p>
243 273
     </div>
244 274
     <script>
245 275
     </script>
@@ -318,15 +348,15 @@
318 348
     aria-labelledby="myModalLabel"
319 349
     aria-hidden="true">
320 350
     
321
-   <div class="modal-header">
322
-## MODAL HEADER
351
+    <div class="modal-header">
352
+    ## MODAL HEADER
323 353
       <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
324 354
       <h3 id="myModalLabel">${psTitle}</h3>
325
-## MODAL HEADER [END]
355
+    ## MODAL HEADER [END]
326 356
     </div>
327 357
 
328 358
     <div class="modal-body">
329
-## MODAL BODY
359
+    ## MODAL BODY
330 360
       <form id='${psModalId}-form' method="POST" action="${psPostUrl}" enctype="multipart/form-data">
331 361
           % if poNode!=None:
332 362
             <input type="hidden" name="node_id" value="${poNode.node_id}"/>
@@ -355,19 +385,147 @@
355 385
           ${POD.RichTextEditor(psModalId+'-textarea-wysiwyg', poNode.data_content if poNode!=None else '', '')}
356 386
         </div>
357 387
       </form>
388
+    ## MODAL BODY [END]
389
+    </div>
390
+    
391
+    <div class="modal-footer">
392
+    ## MODAL FOOTER
393
+      <button class="btn" data-dismiss="modal" aria-hidden="true">
394
+        <i class="fa fa-ban"></i> ${_('Cancel')}
395
+      </button>
396
+      <button class="btn btn-success" id="${psModalId}-form-submit-button">
397
+        <i class="fa fa-check"></i> ${_('Save changes')}
398
+      </button>
399
+      <script>
400
+        $('#${psModalId}-form-submit-button').click(function(){
401
+          $('#${psModalId}-textarea-wysiwyg').cleanHtml();
402
+          $('#${psModalId}-textarea').val($('#${psModalId}-textarea-wysiwyg').html());
403
+          $('#${psModalId}-form')[0].submit();
404
+        });
405
+      </script>
406
+    ## MODAL FOOTER [END]
407
+    </div>
408
+  </div>
409
+</%def>
358 410
 
359
-## MODAL BODY [END]
411
+<%def name="EventEditModalDialog(piParentNodeId, poNode, psPostUrl, psModalId, psTitle)">
412
+  <div
413
+    id="${psModalId}"
414
+    class="modal hide"
415
+    tabindex="-1"
416
+    role="dialog"
417
+    aria-labelledby="myModalLabel"
418
+    aria-hidden="true">
419
+    
420
+    <div class="modal-header">
421
+    ## MODAL HEADER
422
+      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
423
+      <h3 id="myModalLabel">
424
+        ${psTitle}
425
+      </h3>
426
+    ## MODAL HEADER [END]
427
+    </div>
428
+
429
+    <div class="modal-body">
430
+    ###### MODAL BODY
431
+      <form id='${psModalId}-form' action='${psPostUrl}' method='POST'>
432
+        <input type="hidden" name='parent_id' value='${current_node.node_id}'/>
433
+        <fieldset>
434
+          <label>
435
+            ${_('Event')}
436
+            <input type="text" name='data_label' placeholder="Event"/>
437
+          </label>
438
+          <label>
439
+            ${_('Date and time')}
440
+            <div class="datetime-picker-input-div input-append date">
441
+              <input name='data_datetime' data-format="dd/MM/yyyy hh:mm" type="text" placeholder="date and time"/>
442
+              <span class="add-on"><i data-time-icon="icon-g-clock" data-date-icon="icon-g-calendar"></i></span>
443
+            </div>
444
+          </label>
445
+          <label>
446
+            ${_('Event description:')}
447
+            <div>
448
+              <input type="hidden" name="data_content" id="${psModalId}-textarea" />
449
+              ${POD.RichTextEditor(psModalId+'-textarea-wysiwyg', poNode.data_content if poNode!=None else '', 'boldanditalic')}
450
+            </div>
451
+          </label>
452
+        </fieldset>
453
+      </form>
454
+    ###### MODAL BODY [END]
360 455
     </div>
361 456
     
362 457
     <div class="modal-footer">
363
-## MODAL FOOTER
458
+    ###### MODAL FOOTER
459
+      <button class="btn" data-dismiss="modal" aria-hidden="true">
460
+        <i class="fa fa-ban"></i> ${_('Cancel')}
461
+      </button>
462
+      <button class="btn btn-success" id="${psModalId}-form-submit-button">
463
+        <i class="fa fa-check"></i> ${_('Save changes')}
464
+      </button>
465
+      <script>
466
+        $('#${psModalId}-form-submit-button').click(function(){
467
+          $('#${psModalId}-textarea-wysiwyg').cleanHtml();
468
+          $('#${psModalId}-textarea').val($('#${psModalId}-textarea-wysiwyg').html());
469
+          $('#${psModalId}-form')[0].submit();
470
+        });
471
+      </script>
472
+    ###### MODAL FOOTER [END]
473
+    </div>
474
+  </div>
475
+</%def>
476
+
477
+<%def name="ContactEditModalDialog(piParentNodeId, poNode, psPostUrl, psModalId, psTitle)">
478
+  <div
479
+    id="${psModalId}"
480
+    class="modal hide"
481
+    tabindex="-1"
482
+    role="dialog"
483
+    aria-labelledby="myModalLabel"
484
+    aria-hidden="true">
485
+    
486
+    <div class="modal-header">
487
+    ## MODAL HEADER
488
+      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
489
+      <h3 id="myModalLabel">${psTitle}</h3>
490
+    ## MODAL HEADER [END]
491
+    </div>
492
+
493
+    <div class="modal-body">
494
+    ## MODAL BODY
495
+      <form id='${psModalId}-form' method="POST" action="${psPostUrl}">
496
+          % if poNode!=None:
497
+            <input type="hidden" name="node_id" value="${poNode.node_id}"/>
498
+          % endif
499
+          <input type="hidden" name="parent_id" value="${piParentNodeId if piParentNodeId else 0}"/>
500
+          <input type="hidden" name="data_content" id="${psModalId}-textarea" />
501
+        <div>
502
+          <label>
503
+            ${_('Contact name and firstname')}
504
+            <input
505
+              type="text"
506
+              name="data_label"
507
+              value="${poNode.data_label if poNode!=None else ''}"
508
+              class="span4"
509
+              placeholder="${_('name, firstname, title...')}"
510
+            />
511
+          </label>
512
+        </div>
513
+        <div>
514
+          <label>${_('Address, phone, email, company...')}</label>
515
+          ${POD.RichTextEditor(psModalId+'-textarea-wysiwyg', poNode.data_content if poNode!=None else '', 'boldanditalic')}
516
+        </div>
517
+      </form>
518
+    ## MODAL BODY [END]
519
+    </div>
520
+    
521
+    <div class="modal-footer">
522
+    ## MODAL FOOTER
364 523
       <button class="btn" data-dismiss="modal" aria-hidden="true">
365 524
         <i class="fa fa-ban"></i> ${_('Cancel')}
366 525
       </button>
367 526
       <button class="btn btn-success" id="${psModalId}-form-submit-button">
368 527
         <i class="fa fa-check"></i> ${_('Save changes')}
369 528
       </button>
370
-## MODAL FOOTER [END]
371 529
       <script>
372 530
         $('#${psModalId}-form-submit-button').click(function(){
373 531
           $('#${psModalId}-textarea-wysiwyg').cleanHtml();
@@ -375,6 +533,7 @@
375 533
           $('#${psModalId}-form')[0].submit();
376 534
         });
377 535
       </script>
536
+    ## MODAL FOOTER [END]
378 537
     </div>
379 538
   </div>
380 539
 </%def>

+ 24 - 300
pboard/pboard/templates/document.mak View File

@@ -18,13 +18,14 @@
18 18
       <a href="${tg.url('/document')}" title="${_('Root')}">
19 19
         ${_('Root')}
20 20
       </a>
21
-      <div class="pod-toolbar">
22
-        <a href="${tg.url('/api/create_document?parent_id=0')}" title="${_('Add child document')}"><i class="fa fa-plus-circle"></i></a>
23
-      </div>
24 21
     </div>
25 22
     <div id="pod-menu-item-0-children">${node_treeview(node_list, 0)}</div>
26 23
     
27 24
   % else:
25
+    % if len(node_list)<=0 and indentation==0:
26
+      <p class="pod-grey">${_('You have no document yet.')}</p>
27
+    % endif
28
+    
28 29
     % if len(node_list)>0:
29 30
       % for node in node_list:
30 31
         <div id='pod-menu-item-${node.node_id}' class="pod-toolbar-parent ${'pod-status-active' if current_node!=None and node.node_id==current_node.node_id else ''}" style="padding-left: ${(indentation+2)*0.5}em; position: relative;">
@@ -41,7 +42,6 @@
41 42
           <div class="pod-toolbar">
42 43
             <a href="${tg.url('/api/move_node_upper?node_id=%i'%(node.node_id))}" title="${_('Move up')}"><i class="fa fa-arrow-up"></i></a>
43 44
             <a href="${tg.url('/api/move_node_lower?node_id=%i'%(node.node_id))}" title="${_('Move down')}"><i class="fa fa-arrow-down"></i></a>
44
-            <a href="${tg.url('/api/create_document?parent_id=%i'%(node.node_id))}" title="${_('Add child document')}"><i class="fa  fa-plus-circle"></i></a>
45 45
           </div>
46 46
           <div class="pod-status ${node.getStatus().css}" title='${node.getStatus().label}'>
47 47
              <i class='${node.getStatus().icon}'></i>
@@ -107,6 +107,15 @@
107 107
           ${DOC.EditForm(current_node)}
108 108
         </div>
109 109
         <div id='application-metadata-panel' class="span4">
110
+          ######
111
+          ##
112
+          ## HERE WE INCLUDE ALL MODAL DIALOG WHICH WILL BE ACCESSIBLE THROUGH TABS OR MENU
113
+          ##
114
+          ${DOC.DocumentEditModalDialog(current_node.node_id, None, tg.url('/api/create_document'), h.ID.AddDocumentModalForm(current_node), _('New Sub-document'))}
115
+          ${DOC.EventEditModalDialog(current_node.node_id, None, tg.url('/api/create_event'), h.ID.AddEventModalForm(current_node), _('Add an event'))}
116
+          ${DOC.ContactEditModalDialog(current_node.node_id, None, tg.url('/api/create_contact'), h.ID.AddContactModalForm(current_node), _('Add a new contact'))}
117
+          ${DOC.FileEditModalDialog(current_node.node_id, None, tg.url('/api/create_file'), h.ID.AddFileModalForm(current_node), _('Add a new file'))}
118
+          
110 119
           <div class="tabbable">
111 120
             <ul class="nav nav-tabs" style="margin-bottom: 0em;">
112 121
                 <li>${DOC.MetadataTab('#subdocuments', 'tab', _('Subdocuments'), 'fa-file-text-o', current_node.getChildren())}</li>
@@ -116,303 +125,18 @@
116 125
                 <li>${DOC.MetadataTab('#files', 'tab', _('Attachments'), 'fa-paperclip', current_node.getFiles())}</li>
117 126
                 <li class="pull-right">${DOC.MetadataTab('#accessmanagement', 'tab', _('Access Management'), 'fa-key', [])}</li>
118 127
             </ul>
128
+            ################################
129
+            ##
130
+            ## PANEL SHOWING ASSOCIATED DATA AND METADATA
131
+            ##
132
+            ################################
119 133
             <div class="tab-content">
120
-                ################################
121
-                ##
122
-                ## PANEL SHOWING LIST OF SUB DOCUMENTS
123
-                ##
124
-                ################################
125
-                <!-- DEBUG - D.A. - 2013-11-07 - Not using tags for th moment -->
126
-                <div class="tab-pane" id="subdocuments">
127
-                  <h4>${_('Sub-documents')}</h4>
128
-                  ${DOC.DocumentEditModalDialog(current_node.node_id, None, tg.url('/api/create_document'), 'add-subdocument-modal-%i'%current_node.node_id, _('New Sub-document'))}
129
-                  
130
-                % if len(current_node.getChildren())<=0:
131
-                  <p class="pod-grey">
132
-                    ${_("There is currently no child documents.")}<br/>
133
-                  </p>
134
-                  <p>
135
-                    <a href="#add-subdocument-modal-${current_node.node_id}" role="button" class="btn btn-success btn-small" data-toggle="modal">
136
-                      <i class="fa fa-plus"></i>
137
-                      ${_("Add one")}
138
-                    </a>
139
-                  </p>
140
-                % else:
141
-                  <p>
142
-                    <a href="#add-subdocument-modal-${current_node.node_id}" role="button" class="btn btn-success btn-small" data-toggle="modal">
143
-                      <i class="fa fa-plus"></i> ${_("Add one")}
144
-                    </a>
145
-                  </p>
146
-
147
-                  <div>
148
-                    % for subnode in current_node.getChildren():
149
-                      <p style="list-style-type:none;">
150
-                        <i class="fa-fw ${subnode.getIconClass()}"></i>
151
-                          <a href="${tg.url('/document/%i'%subnode.node_id)}">
152
-                            ${subnode.data_label}
153
-                          </a>
154
-                      </p>
155
-                    % endfor
156
-                  </div>
157
-                % endif
158
-                </div>
159
-                
160
-                ################################
161
-                ##
162
-                ## PANEL SHOWING LIST OF EVENTS
163
-                ##
164
-                ################################
165
-                <div class="tab-pane active" id="events">
166
-                  <h4>${_('Calendar')}</h4> 
167
-                % if len(current_node.getEvents())<=0:
168
-                  <p class="pod-grey">${_("The calendar is empty.")}<br/></p>
169
-                  <p>${POD.AddButton('current-document-add-event-button', True, _(' Add first event'))}</p>
170
-                % else:
171
-                  <p>${POD.AddButton('current-document-add-event-button', True, _(' Add an event'))}</p>
172
-                % endif
173
-                
174
-                  <form style='display: none;' id='current-document-add-event-form' action='${tg.url('/api/create_event')}' method='post' class="well">
175
-                    <input type="hidden" name='parent_id' value='${current_node.node_id}'/>
176
-                    <fieldset>
177
-                      <legend>Add an event</legend>
178
-                      <label>
179
-                        <input type="text" name='data_label' placeholder="Event"/>
180
-                      </label>
181
-                      <label>
182
-                        <div class="datetime-picker-input-div input-append date">
183
-                          <input name='data_datetime' data-format="dd/MM/yyyy hh:mm" type="text" placeholder="date and time"/>
184
-                          <span class="add-on"><i data-time-icon="icon-g-clock" data-date-icon="icon-g-calendar"></i></span>
185
-                        </div>
186
-                      </label>
187
-                      <label>
188
-                        <div>
189
-                          <input type="hidden" id="add_event_data_content_textarea" name='data_content' />
190
-                          ${POD.RichTextEditor('add_event_data_content_textarea_wysiwyg', '', 'boldanditalic|undoredo|fullscreen')}
191
-                        </div>
192
-                      </label>
193
-                      <label class="checkbox">
194
-                        <input disabled name='add_reminder' type="checkbox"> add a reminder
195
-                      </label>
196
-                      <label>
197
-                        <div class="datetime-picker-input-div input-append date">
198
-                          <input disabled name='data_reminder_datetime' data-format="dd/MM/yyyy hh:mm" type="text" placeholder="date and time"/>
199
-                          <span class="add-on"><i data-time-icon="icon-g-clock" data-date-icon="icon-g-calendar"></i></span>
200
-                        </div>
201
-                      </label>
202
-
203
-
204
-                      ${POD.CancelButton('current-document-add-event-cancel-button', True)}
205
-                      ${POD.SaveButton('current-document-add-event-save-button', True)}
206
-                    </fieldset>
207
-                  </form>
208
-
209
-                % if len(current_node.getEvents())>0:
210
-                  <table class="table table-striped table-hover table-condensed">
211
-                    <thead>
212
-                      <tr>
213
-                        <th>Date</th>
214
-                        <th>Time</th>
215
-                        <th>
216
-                          Event
217
-                        </th>
218
-                        <th>
219
-                          <a href="" title="Add an event"><i class="icon-g-plus"></i></a>
220
-                        </th>
221
-                      </tr>
222
-                    </thead>
223
-                    % for event in current_node.getEvents():
224
-                      <tr class="item-with-data-popoverable" data-content="${event.data_content}" rel="popover" data-placement="left" data-trigger="hover">
225
-                        <td>${event.getFormattedDate(event.data_datetime)}</td>
226
-                        <td>${event.getFormattedTime(event.data_datetime)}</td>
227
-                        <td>${event.data_label}</td>
228
-                      </tr>
229
-  ## FIXME                    <script>
230
-  ##                      $('.item-with-data-popoverable').popover({ html: true});
231
-  ##                    </script>
232
-
233
-                    % endfor
234
-                  </table>
235
-                % endif
236
-                </div>
237
-                ##############################
238
-                ## 
239
-                ## PANEL SHOWING LIST OF CONTACTS
240
-                ##
241
-                ##############################
242
-                <div class="tab-pane" id="contacts">
243
-                  <h4>${_('Address book')}</h4> 
244
-                % if len(current_node.getContacts())<=0:
245
-                  <p class="pod-grey">${_("The address book is empty.")}<br/></p>
246
-                  <p>${POD.AddButton('current-document-add-contact-button', True, _(' Add first contact'), True)}</p>
247
-                % else:
248
-                  <p>${POD.AddButton('current-document-add-contact-button', True, _(' Add a contact'))}</p>
249
-                % endif
250
-
251
-                  <!-- ADD CONTACT FORM -->
252
-                  <form style='display: none;' id='current-document-add-contact-form' action='${tg.url('/api/create_contact')}' method='post' class="well">
253
-                    <input type="hidden" name='parent_id' value='${current_node.node_id}'/>
254
-                    <fieldset>
255
-                      <legend>${_('Add a contact')}</legend>
256
-                      <label>
257
-                        <input type="text" name='data_label' placeholder="Title"/>
258
-                      </label>
259
-                      <label>
260
-                        <div>
261
-                          <input type="hidden" id="add_contact_data_content_textarea" name='data_content' />
262
-                          ${POD.RichTextEditor('add_contact_data_content_textarea_wysiwyg', '', 'boldanditalic|undoredo|fullscreen')}
263
-                        </div>
264
-                      </label>
265
-                      ${POD.CancelButton('current-document-add-contact-cancel-button', True)}
266
-                      ${POD.SaveButton('current-document-add-contact-save-button', True)}
267
-                    </fieldset>
268
-                  </form>
269
-
270
-                  <!-- LIST OF CONTACT NODES -->
271
-                  % for contact in current_node.getContacts():
272
-                    <div class="well">
273
-                      <legend class="text-info">
274
-                        ${contact.data_label}
275
-                        ## TODO - 2013-11-20 - Use the right form in order to update meta-data
276
-                        <a class="pull-right" href="${tg.url('/document/%i'%contact.node_id)}"><i class="fa fa-edit"></i></a>
277
-                      </legend>
278
-                      
279
-                      <div>
280
-                        ## FIXME - D.A. - 2013-11-15 - Implement localisation stuff <a style='float: right;' href="" title='${_('Search on google maps')}'><i class='icon-g-google-maps'></i></a>
281
-                        ${contact.data_content|n}
282
-                      </div>
283
-                    </div>
284
-                  % endfor
285
-                </div>
286
-                ################################
287
-                ##
288
-                ## PANEL SHOWING LIST OF COMMENTS
289
-                ##
290
-                ################################
291
-                <div class="tab-pane" id="comments" style="margin: 0;">
292
-                  <h4>${_('Comment thread')}</h4>
293
-                % if len(current_node.getComments())<=0:
294
-                  <p class="pod-grey">${_("The comment thread is empty.")}<br/></p>
295
-                % endif
296
-                  <!-- LIST OF COMMENTS -->
297
-                % if len(current_node.getComments())>0:
298
-                  <div>
299
-                    % for comment in current_node.getComments():
300
-                      <p>
301
-                        <a href="${tg.url('/api/toggle_share_status', dict(node_id=comment.node_id))}">
302
-                          % if comment.is_shared:
303
-                            <span class="label label-warning" title="${_('Shared comment. Click to make private.')}"><i class="fa fa-group"></i></span>
304
-                          % else:
305
-                            <span class="label label-info" title="${_('Private comment. Click to share.')}"><i class="fa fa-key"></i></span>
306
-                          % endif
307
-                        </a>
308
-                        <strong>${comment._oOwner.display_name}</strong>
309
-                        <i class="pull-right">
310
-                          The ${comment.getFormattedDate(comment.updated_at)} 
311
-                          at ${comment.getFormattedTime(comment.updated_at)}
312
-                        </i>
313
-                        <br/>
314
-                        ${comment.data_content|n}
315
-                        <hr style="border-top: 1px dotted #ccc; margin: 0;"/>
316
-                      </p>
317
-                    % endfor
318
-                  </div>
319
-                % endif
320
-
321
-                  <!-- ADD COMMENT FORM -->
322
-                  <form class="form" id='current-document-add-comment-form' action='${tg.url('/api/create_comment')}' method='post'>
323
-                    <input type="hidden" name='parent_id' value='${current_node.node_id}'/>
324
-                    <input type="hidden" name='data_label' value=""/>
325
-                    <input type="hidden" id="add_comment_data_content_textarea" name='data_content' />
326
-                    ${POD.RichTextEditor('add_comment_data_content_textarea_wysiwyg', '', '')}
327
-                    <label>
328
-                      <input type="checkbox" name='is_shared'/> ${_('Share this comment')}
329
-                    </label>
330
-                    <span class="pull-right">
331
-                      % if len(current_node.getComments())<=0:
332
-                        ${POD.SaveButton('current-document-add-comment-save-button', True, _('Add first comment'))}
333
-                      % else:
334
-                        ${POD.SaveButton('current-document-add-comment-save-button', True, _('Comment'))}
335
-                      % endif
336
-                    </span>
337
-                  </form>
338
-
339
-                </div>
340
-                ################################
341
-                ##
342
-                ## PANEL SHOWING LIST OF FILES
343
-                ##
344
-                ################################
345
-                <div class="tab-pane" id="files">
346
-                  ${DOCTABS.FilesTabContent(current_node)}
347
-                </div>
348
-
349
-                <div class="tab-pane" id="files">
350
-                  <h4>${_('Attachments')}</h4> 
351
-                % if len(current_node.getFiles())<=0:
352
-                  <p class="pod-grey">${_("There is currently no attachment.")}<br/></p>
353
-                  <p>${POD.AddButton('current-document-add-file-button', True, _(' Attach first file'))}</p>
354
-                % else:
355
-                  <p>${POD.AddButton('current-document-add-file-button', True, _(' Attach a file'))}</p>
356
-                % endif
357
-
358
-                  <!-- ADD FILE FORM -->
359
-                  <form style='display: none;' id='current-document-add-file-form' enctype="multipart/form-data" action='${tg.url('/api/create_file')}' method='post' class="well">
360
-                    <input type="hidden" name='parent_id' value='${current_node.node_id}'/>
361
-                    <fieldset>
362
-                      <legend>${_('Add a file')}</legend>
363
-                      <label>
364
-                        <input type="text" name='data_label' placeholder="Title"/>
365
-                      </label>
366
-                      <label>
367
-                        <input type="file" name='data_file' placeholder="choose a file..."/>
368
-                      </label>
369
-                      <label>
370
-                        <div>
371
-                          <input type="hidden" id="add_file_data_content_textarea" name='data_content' />
372
-                          ${POD.RichTextEditor('add_file_data_content_textarea_wysiwyg', '', 'boldanditalic|undoredo|fullscreen')}
373
-                        </div>
374
-                      </label>
375
-                      ${POD.CancelButton('current-document-add-file-cancel-button', True)}
376
-                      ${POD.SaveButton('current-document-add-file-save-button', True)}
377
-                    </fieldset>
378
-                  </form>
379
-
380
-                  <!-- LIST OF FILES -->
381
-                  <div>
382
-                % if len(current_node.getFiles())>0:
383
-                    % for current_file in current_node.getFiles():
384
-                      <p style="list-style-type:none; margin-bottom: 0.5em;">
385
-                        <i class="fa fa-paperclip"></i>
386
-                        <a
387
-                          href="${tg.url('/document/%i'%current_file.node_id)}"
388
-                          title="${_('View the attachment')}: ${current_file.data_label}"
389
-                        >
390
-                          ${current_file.getTruncatedLabel(50)}
391
-                        </a>
392
-                        <a
393
-                          class="pull-right"
394
-                          href="${tg.url('/api/get_file_content/%s'%(current_file.node_id))}"
395
-                          title="${_('View the attachment')}"
396
-                        >
397
-                          <i class="fa fa-download"></i>
398
-                        </a>
399
-                      </p>
400
-                    % endfor
401
-                % endif
402
-                  </div>
403
-                </div>
404
-                
405
-                
406
-                ################################
407
-                ##
408
-                ## PANEL SHOWING ACCESS MANAGEMENT
409
-                ##
410
-                ################################
411
-                
412
-                <div class="tab-pane" id="accessmanagement">
413
-                  ${DOCTABS.AccessManagementTab(current_node)}
414
-                </div>
415
-              </div>
134
+              <div class="tab-pane" id="subdocuments">${DOCTABS.SubdocumentContent(current_node)}</div>
135
+              <div class="tab-pane active" id="events">${DOCTABS.EventTabContent(current_node)}</div>
136
+              <div class="tab-pane" id="contacts">${DOCTABS.ContactTabContent(current_node)}</div>
137
+              <div class="tab-pane" id="comments">${DOCTABS.CommentTabContent(current_node)}</div>
138
+              <div class="tab-pane" id="files">${DOCTABS.FileTabContent(current_node)}</div>
139
+              <div class="tab-pane" id="accessmanagement">${DOCTABS.AccessManagementTab(current_node)}</div>
416 140
             </div>
417 141
           </div>
418 142
         </div>

+ 5 - 1
pboard/pboard/templates/master.mak View File

@@ -55,7 +55,11 @@
55 55
 
56 56
 <%def name="footer()">
57 57
   <div class="footer hidden-tablet hidden-phone text-center">
58
-    <p class="pod-blue"><i>${_("Using pod, you can: search a job, manage projects, track and manage clients and prospects, document processes and knowledge, ...")}</i></p>
58
+    <p class="pod-blue">
59
+      <i>${_("collaborative work  ♦  improved efficiency  ♦  full traceability")}</i>
60
+      <br/>
61
+      this is pod
62
+    </p>
59 63
     <hr style="width: 50%; margin: 0.5em auto;"/>
60 64
     <p>Copyright &copy; 2013 - ${h.current_year()} pod project.</p>
61 65
   </div>

+ 13 - 4
pboard/pboard/templates/pod.mak View File

@@ -52,11 +52,19 @@
52 52
   ${Button(piId, pbWithLabel, 'btn btn-small', psLabel or _('New'), 'fa fa-plus', psLabel or _('New'))}
53 53
 % endif
54 54
 </%def>
55
+
56
+###
57
+##
58
+## GREEN CALL-TO-ACTION BUTTONS IN THE INTERFACE
59
+##
60
+##
55 61
 <%def name="OpenModalButton(psModalAnchor, psLabel)">
56
-  <a href="#${psModalAnchor}" role="button" class="btn btn-success btn-small" data-toggle="modal">
57
-    <i class="fa fa-plus"></i>${psLabel}
58
-  </a>
62
+  <a href="#${psModalAnchor}" role="button" class="btn btn-success btn-small" data-toggle="modal"><i class="fa fa-plus"></i> ${psLabel}</a>
63
+</%def>
64
+<%def name="OpenLinkButton(psModalAnchor, psLabel)">
65
+  <a href="#${psModalAnchor}" class="btn btn-success btn-small"><i class="fa fa-plus"></i> ${psLabel}</a>
59 66
 </%def>
67
+## END OF GREEN CALL-TO-ACTION BUTTONS
60 68
 
61 69
 <%def name='Badge(psLabel, psCssClass="")'>
62 70
   <span class='badge ${psCssClass}'>${psLabel}</span>
@@ -160,7 +168,7 @@
160 168
       % endif
161 169
       % if psMenuOptions.find('fullscreen')>=0:
162 170
         <div class="btn-group">
163
-          <a class="btn btn-primary pod-toggle-full-screen-button"
171
+          <a class="btn btn-success pod-toggle-full-screen-button"
164 172
              title="Toggle fullscreen"
165 173
              onclick="toggleFullScreen('#${psRichTextEditorNodeId}-widget', '#${psRichTextEditorNodeId}-widget-inner')"
166 174
             >
@@ -214,3 +222,4 @@
214 222
 
215 223
 </%def>
216 224
 
225
+<%def name="AddDocumentModalFormId(poNode)">add-document-modal-form-${poNode.node_id if poNode!=None else ''}</%def>