$res = '<div class="teams-list">';
foreach ($teams as $team) {
- $res .= '<span data-id="'. $team['id'] .'">'. $team['name'] .'</span>';
+ if (empty($team['members'])) {
+ continue; // Don't display empty teams
+ }
+
+ $res .= '<a href="#'. CubeIT_Text::str2URL($team['name']) .'">'. $team['name'] .'</a>';
}
$res .= '</div>'; // .teams-list
continue;
}
- $res .= '<div class="teams-team" data-team-id="'. $team['id'] .'">';
+ $res .= '<div class="teams-team" data-team-slug="#'. CubeIT_Text::str2URL($team['name']) .'">';
if (!empty($team['photo'])) {
$res .= $this->imageCms($team['photo'], $team['name'], 770, null);
}
<?php
-$this->headScript()->addScriptAndStyle('equipes');
$this->sidebar_nav_depth = 0; // Don't show individual staff sub-pages in the sidebar
?>
+++ /dev/null
-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
--- /dev/null
+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();
+}
+
+
+++ /dev/null
-@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
&: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;
}