From: stephen@cubedesigners.com Date: Mon, 18 Jul 2022 16:47:10 +0000 (+0000) Subject: Wait #5334 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=4d3524dceaa856016807784533cdbcb3266c0841;p=ccgm.git Wait #5334 @2 --- diff --git a/framework/application/views/helpers/Teams.php b/framework/application/views/helpers/Teams.php index 86eae83..888445b 100644 --- a/framework/application/views/helpers/Teams.php +++ b/framework/application/views/helpers/Teams.php @@ -20,7 +20,11 @@ class CCGM_View_Helper_Teams extends CubeIT_View_Helper_Abstract { $res = '
'; foreach ($teams as $team) { - $res .= ''. $team['name'] .''; + if (empty($team['members'])) { + continue; // Don't display empty teams + } + + $res .= ''. $team['name'] .''; } $res .= '
'; // .teams-list @@ -30,7 +34,7 @@ class CCGM_View_Helper_Teams extends CubeIT_View_Helper_Abstract { continue; } - $res .= '
'; + $res .= '
'; if (!empty($team['photo'])) { $res .= $this->imageCms($team['photo'], $team['name'], 770, null); } diff --git a/framework/application/views/scripts/templates/equipes.phtml b/framework/application/views/scripts/templates/equipes.phtml index 6e0e9ff..1a4a566 100644 --- a/framework/application/views/scripts/templates/equipes.phtml +++ b/framework/application/views/scripts/templates/equipes.phtml @@ -1,5 +1,4 @@ headScript()->addScriptAndStyle('equipes'); $this->sidebar_nav_depth = 0; // Don't show individual staff sub-pages in the sidebar ?> diff --git a/js/equipes.js b/js/equipes.js deleted file mode 100644 index a3ff045..0000000 --- a/js/equipes.js +++ /dev/null @@ -1,9 +0,0 @@ -TO_LOAD_ONCE[TO_LOAD_ONCE.length] = 'load_equipes();'; - -function load_equipes() { - $(".thumb").mouseenter(function() { - $(this).siblings(".big").show(); - }).mouseleave(function() { - $(this).siblings(".big").hide(); - }); -} \ No newline at end of file diff --git a/js/teams.js b/js/teams.js new file mode 100644 index 0000000..f8f0081 --- /dev/null +++ b/js/teams.js @@ -0,0 +1,21 @@ +TO_LOAD_ONCE.push('load_teams();'); + +function load_teams() { + show_team(); + $(window).on('hashchange', show_team); +} + +function reset_teams() { + $('.teams-team').hide(); + $('.teams-list a').removeClass('active'); +} + +function show_team() { + let team = window.location.hash || $('.teams-list a').first().attr('href'); + + reset_teams(); + $(`.teams-list a[href="${team}"]`).addClass('active'); + $(`.teams-team[data-team-slug="${team}"]`).show(); +} + + diff --git a/less/equipes.less b/less/equipes.less deleted file mode 100644 index 6b3b087..0000000 --- a/less/equipes.less +++ /dev/null @@ -1,72 +0,0 @@ -@import "constants.less"; - - -#equipes{ - .col{ - width: 334px; - display:inline-block; - &:first-child{ - margin:0 100px 0 0; - } - } - .equipe{ - h3{ - text-transform: none; - font-size: 16px; - font-weight: 500; - margin:20px 0; - } - img{ - border:1px solid #c7c5c5; - border-radius: 5px; - display: block; - } - >img{ - margin: 30px 0; - } - - .membre{ - margin: 15px 0; - position:relative; - .thumb{ - display:inline-block; - width: 44px; - margin:0 16px 0 0; - background-color: #e7e7e7; - } - .big{ - display:none; - position: absolute; - top:-54px; - left:52px; - z-index: 2; - background-color:#fff; - padding:6px; - box-shadow: 0 0 5px 2px rgba(0,0,0,0.3); - border-radius:7px; - img{ - border:0; - } - &:after{ - content:""; - width: 0; - height: 0; - position:absolute; - left:-10px; - top:62px; - border-top: 10px solid transparent; - border-bottom: 10px solid transparent; - border-right:10px solid #fff; - } - } - .infos{ - display:inline-block; - .role{ - font-weight: 300; - font-style: italic; - font-size: 13px; - } - } - } - } -} \ No newline at end of file diff --git a/less/teams.less b/less/teams.less index 99d59e2..7f581d0 100644 --- a/less/teams.less +++ b/less/teams.less @@ -26,11 +26,14 @@ &:hover, &.active { background-color: #57c1e6; + text-decoration: none; } } } &-team { + display: none; // Initially hidden, will be shown when user clicks the link or onload via URL hash + > * + * { margin-top: 1.5em; }