projectdynamicblock.html.php 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /**
  3. * The projectdynamic block view file of block module of ZenTaoPMS.
  4. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
  5. * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  6. * @author Yuting Wang <wangyuting@easycorp.ltd>
  7. * @package block
  8. * @link https://www.zentao.net
  9. */
  10. namespace zin;
  11. ?>
  12. <?php if(empty($actions)): ?>
  13. <div class='empty-tip'><?php echo $lang->block->emptyTip;?></div>
  14. <?php else:?>
  15. <style>
  16. .dynamic-block .timeline > li .timeline-text {max-width: 600px; display: block; white-space: nowrap; overflow: hidden; text-overflow: clip; max-height: 20px;}
  17. .dynamic-block .panel-body {padding-top: 0;}
  18. .dynamic-block .timeline-text {margin-left: -18px;}
  19. .dynamic-block .label-action {padding: 0 6px;}
  20. .dynamic-block .label-action + a {padding-left: 6px;}
  21. .timeline > li:before, .timeline > li > a:after, .timeline > li > div:after {position: absolute; left: -20px; display: block; width: 15px; height: 15px; content: ' '; border-radius: 50%;}
  22. .timeline > li > a:after, .timeline > li > div:after {position: absolute; content: ' '; top: 11px; left: -17px; display: block; z-index: 3; width: 9px; height: 9px; background-color: #2e7fff; border-radius: 50%; opacity: 0;}
  23. .timeline > li.active > a:after, .timeline > li.active > div:after {opacity: 1;}
  24. .timeline > li.active:before {top: 8px; left: -30px; width: 15px; z-index: 3; height: 15px; background-color: #FFF; border: none;}
  25. .timeline > li.collected > div:after {background-color: #FFAF65;}
  26. .timeline > li.releaseddoc > div:after {background-color: #66A2FF;}
  27. .timeline > li > div:after {left: -27px;}
  28. .timeline > li > div > .timeline-tag, .timeline > li > div > .timeline-text > .label-action {color: #838A9D;}
  29. .timeline-tag-left {padding-left: 115px;}
  30. .timeline > li {position: relative; list-style: none;}
  31. .timeline > li:before {position: absolute; content: ' '; border-radius: 50%; display: block; top: 12px; left: -26px; z-index: 3; width: 7px; height: 7px; background-color: #c4c4c4; border: none; border: 1px solid #c4c4c4;}
  32. .timeline > li > a, .timeline > li > div {display: block; padding: 5px; line-height: 20px;}
  33. .timeline > li + li:after {position: absolute; top: -12px; bottom: 20px; left: -23px; z-index: 1; display: block; content: ' '; border-left: 1px solid #eee;}
  34. .timeline-tag { position: absolute; top: 5px; left: -115px; font-size: 12px; }
  35. </style>
  36. <ul class="timeline timeline-tag-left no-margin">
  37. <?php
  38. $i = 0;
  39. foreach($actions as $action)
  40. {
  41. $user = zget($users, $action->actor);
  42. if($action->action == 'login' or $action->action == 'logout') $action->objectName = $action->objectLabel = '';
  43. $class = $action->major ? 'active' : '';
  44. if(in_array($action->action, array('releaseddoc', 'collected'))) $class .= " {$action->action}";
  45. echo "<li class='$class'><div>";
  46. if($action->objectLink) printf($lang->block->dynamicInfo, $action->date, $user, $action->actionLabel, $action->objectLabel, $action->objectLink, $action->objectName, $action->objectName);
  47. if(!$action->objectLink) printf($lang->block->noLinkDynamic, $action->date, $action->objectName, $user, $action->actionLabel, $action->objectLabel, ' ' . $action->objectName);
  48. echo "</div></li>";
  49. $i++;
  50. }
  51. ?>
  52. </ul>
  53. <?php endif;?>
  54. <?php
  55. panel
  56. (
  57. set('class', 'dynamic-block ' . ($longBlock ? 'block-long' : 'block-sm')),
  58. set::title($block->title),
  59. div(rawContent())
  60. );
  61. render();