3
1

header.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. $_title = $this->render("header/title", [
  3. "project" => isset($project) ? $project : null,
  4. "task" => isset($task) ? $task : null,
  5. "description" => isset($description) ? $description : null,
  6. "title" => $title,
  7. ]);
  8. $_top_right_corner = implode("&nbsp;", [
  9. $this->render("header/user_notifications"),
  10. $this->render("header/creation_dropdown"),
  11. $this->render("header/user_dropdown")
  12. ]);
  13. $branding = null;
  14. if (isset($project) && isset($project["id"])) {
  15. $branding = $this->projectBrandingHelper->getBrandingByProjectId($project["id"]);
  16. }
  17. ?>
  18. <?php if (isset($branding["enabled"]) && $branding["enabled"] == 1 && !empty($branding["logo_url"])): ?>
  19. <style>
  20. .page {
  21. margin:0 auto;
  22. }
  23. header{
  24. background-color:<?= !empty($branding["background_color"]) ? $branding["background_color"] : "transparent" ?> !important;
  25. margin-bottom:0;
  26. }
  27. .project-header{
  28. background-color:<?= !empty($branding["second_background_color"]) ? $branding["second_background_color"] : "transparent" ?>;
  29. padding:.5em .5em .8em .5em;
  30. height: 1.5em;
  31. }
  32. h1 {
  33. color:<?= !empty($branding["foreground_color"]) ? $branding["foreground_color"] : "initial" ?>;
  34. background-color:<?= !empty($branding["background_color"]) ? $branding["background_color"] : "transparent" ?>;
  35. }
  36. span.logo a{
  37. vertical-align: middle;
  38. margin-right:5px;
  39. opacity:1;
  40. }
  41. a .fa {
  42. color:<?= !empty($branding["foreground_color"]) ? $branding["foreground_color"] : "initial" ?>;
  43. }
  44. </style>
  45. <?php endif ?>
  46. <header>
  47. <div class="title-container">
  48. <h1>
  49. <span class="logo">
  50. <?php if (isset($branding["enabled"]) && $branding["enabled"] == 1 && !empty($branding["logo_url"])): ?>
  51. <a href="<?= $this->url->to('DashboardController', 'show') ?>">
  52. <img src="<?= $branding['logo_url'] ?>" alt="<?= t('Logo') ?>" height="32">
  53. </a>
  54. <?php else: ?>
  55. <?= $this->url->link("K<span>B</span>", "DashboardController", "show", [], false, "", t("Dashboard")) ?>
  56. <?php endif ?>
  57. </span>
  58. <span class="title">
  59. <?php if (! empty($project) && ! empty($task)): ?>
  60. <?= $this->url->link($this->text->e($project["name"]), "BoardViewController", "show", ["project_id" => $project["id"]]) ?>
  61. <?php else: ?>
  62. <?= $this->text->e($title) ?>
  63. <?php if (! empty($project) && $project["task_limit"] && array_key_exists("nb_active_tasks", $project)): ?>
  64. (<span><?= intval($project["nb_active_tasks"]) ?></span> / <span title="<?= t('Task limit') ?>"><span class="ui-helper-hidden-accessible"><?= t("Task limit") ?> </span><?= $this->text->e($project["task_limit"]) ?></span>)
  65. <?php endif ?>
  66. <?php endif ?>
  67. </span>
  68. <?php if (! empty($description)): ?>
  69. <?= $this->app->tooltipHTML($description) ?>
  70. <?php endif ?>
  71. </h1>
  72. </div>
  73. <div class="board-selector-container">
  74. <?php if (! empty($board_selector)): ?>
  75. <?= $this->render("header/board_selector", ["board_selector" => $board_selector]) ?>
  76. <?php endif ?>
  77. </div>
  78. <div class="menus-container">
  79. <?= $_top_right_corner ?>
  80. </div>
  81. </header>