Browse Source

Merge branch 'master' of bitbucket.org:lebouquetin/protov1

sferot 10 years ago
parent
commit
a08bc8b3b7

+ 37 - 28
pboard/pboard/templates/document-widgets-tabs.mak View File

@@ -6,7 +6,7 @@
6 6
   <h4>${_('Revisions')}</h4>
7 7
   <ul>
8 8
   % for version in poNode.getHistory():
9
-  	<li><a href="${tg.url('/document/%i/%i'%(version.node_id, version.version_id))}">${version.created_at.strftime("%a %x %X")}</a></li>
9
+  	<li><a href="${tg.url('/document/%i/%i#tab-history'%(version.node_id, version.version_id))}">${version.created_at.strftime("%a %x %X")}</a></li>
10 10
   % endfor
11 11
   </ul>
12 12
 </%def>
@@ -380,18 +380,18 @@
380 380
         <p style="list-style-type:none; margin-bottom: 0.5em;">
381 381
           <i class="fa fa-paperclip"></i>
382 382
           <a
383
-            href="${tg.url('/document/%i'%loFile.node_id)}"
384
-            title="${_('View the attachment')}: ${loFile.getTruncatedLabel(-1)}"
383
+            href="${tg.url('/api/get_file_content/%s'%(loFile.node_id))}"
384
+            title="${_('Download the file')}"
385 385
           >
386 386
             ${loFile.getTruncatedLabel(50)}
387 387
           </a>
388 388
           ## FIXME SHOW IMAGE THUMBNAIL <img src="${tg.url('/api/get_file_content_thumbnail/%i'%loFile.node_id)}"/>
389 389
           <a
390 390
             class="pull-right"
391
-            href="${tg.url('/api/get_file_content/%s'%(loFile.node_id))}"
392
-            title="${_('View the attachment')}"
391
+            href="${tg.url('/document/%i'%loFile.node_id)}"
392
+            title="${_('View the attachment')}: ${loFile.getTruncatedLabel(-1)}"
393 393
           >
394
-            <i class="fa fa-download"></i>
394
+            <i class="fa fa-edit"></i>
395 395
           </a>
396 396
         </p>
397 397
       % endfor
@@ -421,7 +421,7 @@
421 421
   % endif
422 422
 </%def>
423 423
 
424
-<%def name="EventTabContent(poNode)">
424
+<%def name="EventTabContent(current_user, poNode)">
425 425
   <h4>${_('Calendar')}</h4>
426 426
   
427 427
   % if len(poNode.getEvents())<=0:
@@ -446,15 +446,16 @@
446 446
         </tr>
447 447
       </thead>
448 448
       % for event in poNode.getEvents():
449
-        <tr class="item-with-data-popoverable" data-content="${event.data_content}" rel="popover" data-placement="left" data-trigger="hover">
450
-          <td>${event.getFormattedDate(event.data_datetime)}</td>
451
-          <td>${event.getFormattedTime(event.data_datetime)}</td>
452
-          <td>${event.data_label}</td>
453
-        </tr>
454
-  ## FIXME                    <script>
455
-  ##                      $('.item-with-data-popoverable').popover({ html: true});
456
-  ##                    </script>
457
-
449
+        % if event.is_shared or event.owner_id==current_user.user_id:
450
+##
451
+## TODO - D.A. - Sharing groups are not checked here : a shared event is share with everybody
452
+##
453
+          <tr class="item-with-data-popoverable" data-content="${event.data_content}" rel="popover" data-placement="left" data-trigger="hover">
454
+            <td>${event.getFormattedDate(event.data_datetime)}</td>
455
+            <td>${event.getFormattedTime(event.data_datetime)}</td>
456
+            <td>${event.data_label}</td>
457
+          </tr>
458
+        % endif
458 459
       % endfor
459 460
     </table>
460 461
   % endif
@@ -508,28 +509,36 @@
508 509
 ## We do not check specific rights on comment but on document instead
509 510
 ## In the future full-API architecture, it should be fixed
510 511
 ##
511
-          <p>
512
-            <a href="${tg.url('/api/toggle_share_status', dict(node_id=comment.node_id))}">
513
-              % if comment.is_shared:
514
-                <span class="label label-warning" title="${_('Shared comment. Click to make private.')}">${h.ICON.Shared|n}</span>
515
-              % else:
516
-                <span class="label label-info" title="${_('Private comment. Click to share.')}">${h.ICON.Private|n}</span>
517
-              % endif
518
-            </a>
519
-            <strong>${comment._oOwner.display_name}</strong>
512
+          <p style="margin-bottom: 1em;">
513
+            <i class="fa fa-comments-o"></i>
514
+            <strong class="pod-grey">${comment._oOwner.display_name}</strong>
515
+
520 516
             <i class="pull-right">
521
-              The ${comment.getFormattedDate(comment.updated_at)} 
522
-              at ${comment.getFormattedTime(comment.updated_at)}
517
+              <span class="pod-grey">${_('the')}</span>
518
+              ${comment.getFormattedDate(comment.updated_at)} 
519
+              <span class="pod-grey">${_('at')}</span>
520
+              ${comment.getFormattedTime(comment.updated_at)}
523 521
             </i>
524 522
             <br/>
523
+
524
+            % if comment.owner_id==current_user.user_id:
525
+              <a class="pull-right" href="${tg.url('/api/toggle_share_status', dict(node_id=comment.node_id))}">
526
+                % if comment.is_shared:
527
+                  <span class="label label-warning" title="${_('Shared comment. Click to make private.')}">${h.ICON.Shared|n}</span>
528
+                % else:
529
+                  <span class="label label-info" title="${_('Private comment. Click to share.')}">${h.ICON.Private|n}</span>
530
+                % endif
531
+              </a>
532
+            % endif
533
+
525 534
             ${comment.data_content|n}
526
-            <hr style="border-top: 1px dotted #ccc; margin: 0;"/>
527 535
           </p>
528 536
         % endif
529 537
       % endfor
530 538
     </div>
531 539
   % endif
532 540
 
541
+  <hr style="border-top: 1px dotted #ccc; margin: 0;"/>
533 542
   <form class="form" id="${h.ID.AddCommentInlineForm()}" action="${tg.url('/api/create_comment')}" method="POST">
534 543
     <input type="hidden" name='parent_id' value='${poNode.node_id}'/>
535 544
     <input type="hidden" name='data_label' value=""/>

+ 1 - 1
pboard/pboard/templates/document.mak View File

@@ -183,7 +183,7 @@
183 183
             ################################
184 184
             <div class="tab-content">
185 185
               <div class="tab-pane" id="subdocuments">${DOCTABS.SubdocumentContent(current_node)}</div>
186
-              <div class="tab-pane" id="events">${DOCTABS.EventTabContent(current_node)}</div>
186
+              <div class="tab-pane" id="events">${DOCTABS.EventTabContent(current_user, current_node)}</div>
187 187
               <div class="tab-pane" id="contacts">${DOCTABS.ContactTabContent(current_node)}</div>
188 188
               <div class="tab-pane active" id="comments">${DOCTABS.CommentTabContent(current_user, current_node)}</div>
189 189
               <div class="tab-pane" id="files">${DOCTABS.FileTabContent(current_node)}</div>