TanchoToplineCargo/public/assets/js/pages/team.init.js

1 line
11 KiB
JavaScript
Raw Normal View History

2024-05-05 04:47:49 +00:00
var buttonGroups,list=document.querySelectorAll(".team-list");function onButtonGroupClick(e){"list-view-button"===e.target.id||"list-view-button"===e.target.parentElement.id?(document.getElementById("list-view-button").classList.add("active"),document.getElementById("grid-view-button").classList.remove("active"),Array.from(list).forEach(function(e){e.classList.add("list-view-filter"),e.classList.remove("grid-view-filter")})):(document.getElementById("grid-view-button").classList.add("active"),document.getElementById("list-view-button").classList.remove("active"),Array.from(list).forEach(function(e){e.classList.remove("list-view-filter"),e.classList.add("grid-view-filter")}))}list&&(buttonGroups=document.querySelectorAll(".filter-button"))&&Array.from(buttonGroups).forEach(function(e){e.addEventListener("click",onButtonGroupClick)});var url="assets/json/",allmemberlist="";function loadTeamData(e){document.querySelector("#team-member-list").innerHTML="",Array.from(e).forEach(function(e,t){var r=e.bookmark?"active":"",m=e.memberImg?'<img src="'+e.memberImg+'" alt="" class="member-img img-fluid d-block rounded-circle" />':'<div class="avatar-title border bg-light text-primary rounded-circle text-uppercase">'+e.nickname+"</div>";document.querySelector("#team-member-list").innerHTML+='<div class="col"> <div class="card team-box"> <div class="team-cover"> <img src="'+e.coverImg+'" alt="" class="img-fluid" /> </div> <div class="card-body p-4"> <div class="row align-items-center team-row"> <div class="col team-settings"> <div class="row"> <div class="col"> <div class="flex-shrink-0 me-2"> <button type="button" class="btn btn-light btn-icon rounded-circle btn-sm favourite-btn '+r+'"> <i class="ri-star-fill fs-14"></i> </button> </div> </div> <div class="col text-end dropdown"> <a href="javascript:void(0);" data-bs-toggle="dropdown" aria-expanded="false"> <i class="ri-more-fill fs-17"></i> </a> <ul class="dropdown-menu dropdown-menu-end"> <li><a class="dropdown-item edit-list" href="#addmemberModal" data-bs-toggle="modal" data-edit-id="'+e.id+'"><i class="ri-pencil-line me-2 align-bottom text-muted"></i>Edit</a></li> <li><a class="dropdown-item remove-list" href="#removeMemberModal" data-bs-toggle="modal" data-remove-id="'+e.id+'"><i class="ri-delete-bin-5-line me-2 align-bottom text-muted"></i>Remove</a></li> </ul> </div> </div> </div> <div class="col-lg-4 col"> <div class="team-profile-img"> <div class="avatar-lg img-thumbnail rounded-circle flex-shrink-0">'+m+'</div> <div class="team-content"> <a class="member-name" data-bs-toggle="offcanvas" href="#member-overview" aria-controls="member-overview"> <h5 class="fs-16 mb-1">'+e.memberName+'</h5> </a> <p class="text-muted member-designation mb-0">'+e.position+'</p> </div> </div> </div> <div class="col-lg-4 col"> <div class="row text-muted text-center"> <div class="col-6 border-end border-end-dashed">