mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Añadida funcionalidad de marcar el menu que esta activo
This commit is contained in:
@ -152,7 +152,8 @@ $picture = "/assets/img/default-user.png";
|
||||
<div class="sidebar-body">
|
||||
<!-- Contacts -->
|
||||
<h6 id="chat-message-notification-title">
|
||||
<?= lang("Chat.no_messages_notification") ?> </h6>
|
||||
<?= lang("Chat.no_messages_notification") ?>
|
||||
</h6>
|
||||
<ul class="list-unstyled chat-contact-list mb-0"
|
||||
id="chat-notification-list">
|
||||
|
||||
@ -413,6 +414,31 @@ $picture = "/assets/img/default-user.png";
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
const browserUrl = window.location.pathname;
|
||||
|
||||
document.querySelectorAll('.menu-item a.menu-link').forEach(function (link) {
|
||||
const href = link.getAttribute('href');
|
||||
if (!href || href === 'javascript:void(0);') return;
|
||||
|
||||
const tempAnchor = document.createElement('a');
|
||||
tempAnchor.href = href;
|
||||
const linkPath = tempAnchor.pathname;
|
||||
|
||||
// Comparación exacta de ruta
|
||||
if (browserUrl === linkPath) {
|
||||
const menuItem = link.closest('.menu-item');
|
||||
menuItem.classList.add('active');
|
||||
|
||||
const parent = menuItem.closest('.menu-sub');
|
||||
if (parent) {
|
||||
const parentItem = parent.closest('.menu-item');
|
||||
if (parentItem) {
|
||||
parentItem.classList.add('active', 'open');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function adjustSidebar4ContentWrapper() {
|
||||
if ($('#sidebar').hasClass('d-none') && $(window).width() <= 768) {
|
||||
$('#contentWrapper').addClass('full-width');
|
||||
|
||||
@ -1,47 +0,0 @@
|
||||
<!-- Core JS -->
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/jquery/jquery.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/node-waves/node-waves.js') ?>"></script>
|
||||
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/i18n/i18n.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/typeahead-js/typeahead.js') ?>"></script>
|
||||
|
||||
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
|
||||
|
||||
|
||||
<!-- Vendors JS -->
|
||||
<script src="<?= site_url('themes/vuexy/vendor/timeago/jquery.timeago.js'); ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/timeago/locales/jquery.timeago.'.langJS().'.js'); ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/formvalidation/dist/js/FormValidation.min.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/Bootstrap5.min.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/AutoFocus.min.js') ?>"></script>
|
||||
|
||||
<!-- Main JS -->
|
||||
<script src="<?= site_url('themes/vuexy/js/main.js') ?>"></script>
|
||||
|
||||
<!-- Page JS -->
|
||||
|
||||
<!-- Custom JS -->
|
||||
<script>
|
||||
"use strict";
|
||||
$(document).ready(function () {
|
||||
let time_ago = document.getElementsByClassName("timeAgo");
|
||||
for (let i = 0; i < time_ago.length; i++) {
|
||||
time_ago[i].innerText = jQuery.timeago(time_ago[i].innerText)
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="footer">
|
||||
<div class="copyright">
|
||||
<p>Copyright © <a href="#" target="_blank">TBD</a> - Safekat v<?=version()?> </p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -1,189 +0,0 @@
|
||||
<?php
|
||||
$session = session();
|
||||
$token = $session->get('token') ?? '';
|
||||
$tfa = $session->get('tfa') ?? false;
|
||||
$settings = $session->get('settings');
|
||||
|
||||
// Legacy TODO: check?
|
||||
$picture = "/assets/img/default-user.png";
|
||||
$pulse = session()->get('pulse');
|
||||
$notification = session()->get('notification');
|
||||
|
||||
if (!empty($token) && $tfa == false) {
|
||||
//echo "<script>window.location.href = '/'; </script>";
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html
|
||||
lang="<?= $session->get('lang') ?>"
|
||||
class="h-100"
|
||||
class="dark-style customizer-hide"
|
||||
dir="ltr"
|
||||
data-theme="theme-default"
|
||||
data-assets-path="<?= site_url('themes/vuexy/') ?>"
|
||||
data-template="vertical-menu-template-no-customizer"
|
||||
>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
|
||||
/>
|
||||
|
||||
<title><?= lang("App.dashboard_title") ?> - <?= $settings['title']??'' ?></title>
|
||||
|
||||
<meta name="description" content="" />
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="icon" type="image/x-icon" href="<?= site_url('themes/vuexy/img/favicon/favicon.ico') ?>"/>
|
||||
<link rel="apple-touch-icon" sizes="57x57" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-57x57.png') ?>">
|
||||
<link rel="apple-touch-icon" sizes="60x60" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-60x60.png') ?>">
|
||||
<link rel="apple-touch-icon" sizes="72x72" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-72x72.png') ?>">
|
||||
<link rel="apple-touch-icon" sizes="76x76" href="<?= site_url('themes/vuexy/img/favicon/apple-icon-76x76.png') ?>">
|
||||
<link rel="apple-touch-icon" sizes="114x114"
|
||||
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-114x114.png') ?>">
|
||||
<link rel="apple-touch-icon" sizes="120x120"
|
||||
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-120x120.png') ?>">
|
||||
<link rel="apple-touch-icon" sizes="144x144"
|
||||
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-144x144.png') ?>">
|
||||
<link rel="apple-touch-icon" sizes="152x152"
|
||||
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-152x152.png') ?>">
|
||||
<link rel="apple-touch-icon" sizes="180x180"
|
||||
href="<?= site_url('themes/vuexy/img/favicon/apple-icon-180x180.png') ?>">
|
||||
<link rel="icon" type="image/png" sizes="192x192"
|
||||
href="<?= site_url('themes/vuexy/img/favicon/android-icon-192x192.png') ?>">
|
||||
<link rel="icon" type="image/png" sizes="32x32"
|
||||
href="<?= site_url('themes/vuexy/img/favicon/favicon-32x32.png') ?>">
|
||||
<link rel="icon" type="image/png" sizes="96x96"
|
||||
href="<?= site_url('themes/vuexy/img/favicon/favicon-96x96.png') ?>">
|
||||
<link rel="icon" type="image/png" sizes="16x16"
|
||||
href="<?= site_url('themes/vuexy/img/favicon/favicon-16x16.png') ?>">
|
||||
<link rel="manifest" href="<?= site_url('themes/vuexy/img/favicon/manifest.json') ?>">
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="preconnect" href="https:/fonts.googleapis.com"/>
|
||||
<link rel="preconnect" href="https:/fonts.gstatic.com" crossorigin/>
|
||||
<link
|
||||
href="https:/fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
|
||||
<!-- Icons -->
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/fontawesome.css') ?>"/>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/tabler-icons.css') ?>"/>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/flag-icons.css') ?>"/>
|
||||
|
||||
<!-- Core CSS -->
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/core-dark.css') ?>"/>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/theme-default-dark.css') ?>"/>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/safekat.css') ?>"/>
|
||||
|
||||
<!-- Vendors CSS -->
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.css') ?>"/>
|
||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/node-waves/node-waves.css') ?>"/>
|
||||
|
||||
<!-- Page CSS -->
|
||||
|
||||
<!-- Helpers -->
|
||||
<script src="<?= site_url('themes/vuexy/vendor/js/helpers.js') ?>"></script>
|
||||
<script src="<?= site_url('themes/vuexy/js/config.js') ?>"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!--Main Wrapper-->
|
||||
<div id="main-wrapper">
|
||||
<!--Nav Header-->
|
||||
<div class="nav-header">
|
||||
<a href="<?=site_url('home')?>" class="brand-logo">
|
||||
|
||||
</a>
|
||||
<div class="nav-control">
|
||||
<div class="hamburger">
|
||||
<span class="line"></span><span class="line"></span><span class="line"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--Header-->
|
||||
<div class="header">
|
||||
<div class="header-content">
|
||||
<nav class="navbar navbar-expand">
|
||||
<div class="collapse navbar-collapse justify-content-between">
|
||||
<div class="header-left"></div>
|
||||
<ul class="navbar-nav header-right">
|
||||
<!--- JJO
|
||||
<li class="nav-item dropdown notification_dropdown">
|
||||
<a class="nav-link" href="#" role="button" data-toggle="dropdown">
|
||||
<i class="fas fa-bell"></i>
|
||||
<?php if ($pulse > 0) : ?>
|
||||
<div class="pulse-css text-danger"></div>
|
||||
<?php endif; ?>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<ul class="list-unstyled">
|
||||
<?php foreach ($notification??[] as $item) : ?>
|
||||
<a href="<?=site_url('my/notification_view/'.$item['token'])?>">
|
||||
<li class="media dropdown-item">
|
||||
<?php if ($item['is_read']) : ?>
|
||||
<span class="success"><i class="far fa-envelope-open"></i> </span>
|
||||
<?php else : ?>
|
||||
<span class="primary"><i class="far fa-envelope"></i> </span>
|
||||
<?php endif; ?>
|
||||
<div class="media-body">
|
||||
<p><?=$item['title']?></p>
|
||||
</div>
|
||||
<span class="notify-time timeAgo"><?=$item['created_at']?></span>
|
||||
</li>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<a class="all-notification" href="<?=site_url('my/notification')?>"><?= lang("App.notification_bell_btn") ?> <i class="ti-arrow-right"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
--->
|
||||
<li class="nav-item dropdown header-profile">
|
||||
<a class="nav-link" href="#" role="button" data-toggle="dropdown">
|
||||
<i class="fas fa-globe-americas"></i>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a href="<?= site_url('lang/en'); ?>" class="dropdown-item">
|
||||
<img src="<?=site_url('assets/flags/us_32_circle.png')?>">
|
||||
<span class="ml-2"><?= lang("App.lang_en") ?></span>
|
||||
</a>
|
||||
<a href="<?= site_url('lang/es'); ?>" class="dropdown-item">
|
||||
<img src="<?=site_url('assets/flags/es_32_circle.png')?>">
|
||||
<span class="ml-2"><?= lang("App.lang_es") ?></span>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
<li class="nav-item dropdown header-profile">
|
||||
<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
||||
<img src="<?= $picture??''?>" class="btn-circle btn-circle-sm" style="width: 50px ; height: 50px;">
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<a href="<?= site_url('profile'); ?>" class="dropdown-item">
|
||||
<i class="fas fa-user"></i>
|
||||
<span class="ml-2"><?= lang("App.menu_profile") ?></span>
|
||||
</a>
|
||||
<!--- JJO
|
||||
<a href="<?= site_url('activity'); ?>" class="dropdown-item">
|
||||
<i class="fas fa-list"></i>
|
||||
<span class="ml-2"><?= lang("App.menu_activity") ?></span>
|
||||
</a>
|
||||
--->
|
||||
<a href="<?= site_url('logout'); ?>" class="dropdown-item">
|
||||
<i class="fas fa-sign-out-alt"></i>
|
||||
<span class="ml-2"><?= lang("App.menu_logout") ?></span>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<?php include "selector_menu.php" ?>
|
||||
|
||||
@ -22,7 +22,7 @@ $developmentClass = ($skEnv === 'development') ? 'env-bg' : '';
|
||||
|
||||
<ul class="menu-inner py-1">
|
||||
|
||||
<li class="menu-item active">
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("") ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-dashboard"></i>
|
||||
<div data-i18n="<?= lang("App.menu_dashboard") ?>"><?= lang("App.menu_dashboard") ?></div>
|
||||
|
||||
@ -22,7 +22,7 @@ $developmentClass = ($skEnv === 'development') ? 'env-bg' : '';
|
||||
|
||||
<ul class="menu-inner py-1">
|
||||
|
||||
<li class="menu-item active">
|
||||
<li class="menu-item">
|
||||
<a href="<?= site_url("") ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-dashboard"></i>
|
||||
<div data-i18n="<?= lang("App.menu_dashboard") ?>"><?= lang("App.menu_dashboard") ?></div>
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
|
||||
|
||||
<li class="menu-item active">
|
||||
<?php
|
||||
/**
|
||||
* MENU DASHBOARD
|
||||
*/
|
||||
?>
|
||||
<li class="menu-item <?= uri_string() === '' ? 'active' : '' ?>">
|
||||
<a href="<?= route_to("home") ?>" class="menu-link">
|
||||
<i class="menu-icon tf-icons ti ti-dashboard"></i>
|
||||
<div><?= lang("App.menu_dashboard") ?></div>
|
||||
|
||||
Reference in New Issue
Block a user