Merge pull request 'Update Menampilkan Git Commit' (#1) from mikael-zakaria/crm-summit:zaka into main
Reviewed-on: #1 Reviewed-by: mahdahar <89adham@gmail.com>
This commit is contained in:
commit
e68e39b3a8
@ -265,6 +265,22 @@ $routes->match(['get','post'],'/invtrans/edit/(:any)', 'InvTrans::edit/$1');
|
|||||||
$routes->match(['get','post'],'/invtrans/user/(:any)', 'InvTrans::index_user/$1');
|
$routes->match(['get','post'],'/invtrans/user/(:any)', 'InvTrans::index_user/$1');
|
||||||
$routes->match(['get','post'],'/invtrans/reportusage/', 'InvTrans::reportusage/$1');
|
$routes->match(['get','post'],'/invtrans/reportusage/', 'InvTrans::reportusage/$1');
|
||||||
|
|
||||||
|
// Khusus Untuk Gitea
|
||||||
|
$routes->get('/gitea', 'Gitea::index');
|
||||||
|
$routes->group('api/gitea', function($routes) {
|
||||||
|
// Mendapatkan detail user
|
||||||
|
$routes->get('getuser/(:segment)', 'Gitea::getUser/$1');
|
||||||
|
|
||||||
|
// Mendapatkan daftar repositori milik user
|
||||||
|
$routes->get('getrepos/(:segment)', 'Gitea::getRepositories/$1');
|
||||||
|
|
||||||
|
// Mendapatkan daftar branch dari sebuah repositori
|
||||||
|
$routes->get('getbranches/(:segment)/(:segment)', 'Gitea::getBranches/$1/$2');
|
||||||
|
|
||||||
|
// Mendapatkan daftar commit dari sebuah repositori
|
||||||
|
$routes->get('getcommits/(:segment)/(:segment)', 'Gitea::getCommits/$1/$2');
|
||||||
|
});
|
||||||
|
|
||||||
//LQMS
|
//LQMS
|
||||||
/*
|
/*
|
||||||
$routes->match(['get','post'],'/lqms', 'Lqms::index');
|
$routes->match(['get','post'],'/lqms', 'Lqms::index');
|
||||||
|
|||||||
136
app/Controllers/Gitea.php
Normal file
136
app/Controllers/Gitea.php
Normal file
@ -0,0 +1,136 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Controllers;
|
||||||
|
|
||||||
|
class Gitea extends BaseController
|
||||||
|
{
|
||||||
|
private $baseUrl = 'https://gitea.services-summit.my.id/api/v1';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method helper private untuk menangani semua request cURL ke Gitea
|
||||||
|
*/
|
||||||
|
private function fetchFromGitea(string $endpoint)
|
||||||
|
{
|
||||||
|
$token = env('GITEA_TOKEN') ?: '0eca3f7e42e0992ecc9af9d947bbbd7cfc6ce2e1';
|
||||||
|
$url = $this->baseUrl . $endpoint;
|
||||||
|
|
||||||
|
$client = \Config\Services::curlrequest();
|
||||||
|
|
||||||
|
try {
|
||||||
|
$response = $client->request('GET', $url, [
|
||||||
|
'headers' => [
|
||||||
|
'Authorization' => "token {$token}",
|
||||||
|
'Accept' => 'application/json',
|
||||||
|
],
|
||||||
|
'http_errors' => false,
|
||||||
|
]);
|
||||||
|
|
||||||
|
if ($response->getStatusCode() !== 200) {
|
||||||
|
// Return array dengan format error yang standar
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'message' => "Gagal mengambil data dari API. Status: " . $response->getStatusCode(),
|
||||||
|
'data' => null
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return sukses dengan data yang sudah di-decode
|
||||||
|
return [
|
||||||
|
'success' => true,
|
||||||
|
'message' => 'Data berhasil diambil',
|
||||||
|
'data' => json_decode($response->getBody(), true)
|
||||||
|
];
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'message' => "Terjadi kesalahan cURL: " . $e->getMessage(),
|
||||||
|
'data' => null
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mengambil daftar Commits
|
||||||
|
* Contoh penggunaan di routes: /gitea/commits/mikael-zakaria/cobazaka
|
||||||
|
*/
|
||||||
|
// public function getCommits(string $owner, string $repo)
|
||||||
|
// {
|
||||||
|
// // Tangkap parameter branch jika ada (misal: ?sha=main)
|
||||||
|
// $branch = $this->request->getGet('sha');
|
||||||
|
|
||||||
|
// $endpoint = "/repos/{$owner}/{$repo}/commits";
|
||||||
|
// if (!empty($branch)) {
|
||||||
|
// $endpoint .= "?sha=" . urlencode($branch);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// $result = $this->fetchFromGitea($endpoint);
|
||||||
|
// return $this->response->setJSON($result);
|
||||||
|
// }
|
||||||
|
public function getCommits(string $owner, string $repo)
|
||||||
|
{
|
||||||
|
// Tangkap parameter query string dari JavaScript
|
||||||
|
$branch = $this->request->getGet('sha');
|
||||||
|
|
||||||
|
// Atur default limit, misalnya 50 (maksimal biasanya tergantung setingan admin Gitea, umumnya 50-100)
|
||||||
|
$limit = $this->request->getGet('limit') ?? 50;
|
||||||
|
$page = $this->request->getGet('page') ?? 1;
|
||||||
|
|
||||||
|
// Susun parameter API
|
||||||
|
$queryParams = [
|
||||||
|
'limit' => $limit,
|
||||||
|
'page' => $page
|
||||||
|
];
|
||||||
|
|
||||||
|
// Jika branch dipilih, tambahkan ke parameter
|
||||||
|
if (!empty($branch)) {
|
||||||
|
$queryParams['sha'] = $branch;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Gabungkan endpoint dengan query string
|
||||||
|
$endpoint = "/repos/{$owner}/{$repo}/commits?" . http_build_query($queryParams);
|
||||||
|
|
||||||
|
$result = $this->fetchFromGitea($endpoint);
|
||||||
|
return $this->response->setJSON($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mengambil daftar Branches
|
||||||
|
* Contoh penggunaan di routes: /gitea/branches/mikael-zakaria/cobazaka
|
||||||
|
*/
|
||||||
|
public function getBranches(string $owner, string $repo)
|
||||||
|
{
|
||||||
|
$endpoint = "/repos/{$owner}/{$repo}/branches";
|
||||||
|
$result = $this->fetchFromGitea($endpoint);
|
||||||
|
|
||||||
|
return $this->response->setJSON($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mengambil detail User
|
||||||
|
* Contoh penggunaan di routes: /gitea/user/mikael-zakaria
|
||||||
|
*/
|
||||||
|
public function getUser(string $username)
|
||||||
|
{
|
||||||
|
$endpoint = "/users/{$username}";
|
||||||
|
$result = $this->fetchFromGitea($endpoint);
|
||||||
|
|
||||||
|
return $this->response->setJSON($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mengambil daftar Repositori milik User
|
||||||
|
* Contoh penggunaan di routes: /gitea/repos/mikael-zakaria
|
||||||
|
*/
|
||||||
|
public function getRepositories(string $username)
|
||||||
|
{
|
||||||
|
$endpoint = "/users/{$username}/repos";
|
||||||
|
$result = $this->fetchFromGitea($endpoint);
|
||||||
|
|
||||||
|
return $this->response->setJSON($result);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
return view('gitea_index');
|
||||||
|
}
|
||||||
|
}
|
||||||
313
app/Views/gitea_index.php
Normal file
313
app/Views/gitea_index.php
Normal file
@ -0,0 +1,313 @@
|
|||||||
|
<?= $this->extend('layouts/main.php') ?>
|
||||||
|
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
background-color: #f8f9fa;
|
||||||
|
}
|
||||||
|
.commit-card {
|
||||||
|
transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
|
||||||
|
border-left: 4px solid #0d6efd; /* Aksen warna biru di kiri */
|
||||||
|
}
|
||||||
|
.commit-card:hover {
|
||||||
|
transform: translateY(-3px);
|
||||||
|
box-shadow: 0 .5rem 1rem rgba(0,0,0,.1)!important;
|
||||||
|
}
|
||||||
|
.avatar {
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
.commit-message {
|
||||||
|
font-size: 1.1rem;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #212529;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
.commit-message:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
color: #0d6efd;
|
||||||
|
}
|
||||||
|
.file-list {
|
||||||
|
max-height: 200px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="page-wrapper">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row page-titles">
|
||||||
|
<div class="col-md-5 align-self-center">
|
||||||
|
<h4 class="text-themecolor">Commit History</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row mb-4 bg-light p-3 rounded shadow-sm">
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form-label fw-bold">1. Select User</label>
|
||||||
|
<select id="selectUser" class="form-select">
|
||||||
|
<option value="">-- Select User --</option>
|
||||||
|
<option value="alamdh22">alamdh22</option>
|
||||||
|
<option value="faiztyanirh">faiztyanirh</option>
|
||||||
|
<option value="mahdahar">mahdahar</option>
|
||||||
|
<option value="mikael-zakaria">mikael-zakaria</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form-label fw-bold">2. Select Repository</label>
|
||||||
|
<select id="selectRepo" class="form-select" disabled>
|
||||||
|
<option value="">-- Select Repository --</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form-label fw-bold">3. Select Branch</label>
|
||||||
|
<select id="selectBranch" class="form-select" disabled>
|
||||||
|
<option value="">-- Select Branch --</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3 d-flex align-items-end">
|
||||||
|
<button id="btnLoadCommits" class="btn btn-success w-100" disabled>
|
||||||
|
Show All Commit
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row justify-content-center">
|
||||||
|
<div class="col-12" id="commits-container">
|
||||||
|
<div class="alert alert-secondary text-center">
|
||||||
|
Please select a User -> Repository -> Branch first
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
|
<?= $this->section('script') ?>
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
// Ambil elemen
|
||||||
|
const selectUser = document.getElementById('selectUser');
|
||||||
|
const selectRepo = document.getElementById('selectRepo');
|
||||||
|
const selectBranch = document.getElementById('selectBranch');
|
||||||
|
const btnLoadCommits = document.getElementById('btnLoadCommits');
|
||||||
|
const commitsContainer = document.getElementById('commits-container');
|
||||||
|
|
||||||
|
// 1. Cari Repo otomatis saat User dipilih di Dropdown
|
||||||
|
selectUser.addEventListener('change', async () => {
|
||||||
|
const username = selectUser.value;
|
||||||
|
|
||||||
|
// Reset pilihan di bawahnya jika user kembali memilih "-- Select User --"
|
||||||
|
if (!username) {
|
||||||
|
selectRepo.innerHTML = '<option value="">-- Select Repository --</option>';
|
||||||
|
selectRepo.disabled = true;
|
||||||
|
selectBranch.innerHTML = '<option value="">-- Select Branch --</option>';
|
||||||
|
selectBranch.disabled = true;
|
||||||
|
btnLoadCommits.disabled = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tampilkan loading
|
||||||
|
selectRepo.innerHTML = '<option value="">Loading...</option>';
|
||||||
|
selectRepo.disabled = true;
|
||||||
|
selectBranch.innerHTML = '<option value="">-- Select Branch --</option>';
|
||||||
|
selectBranch.disabled = true;
|
||||||
|
btnLoadCommits.disabled = true;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// PERBAIKAN: Menggunakan getrepos sesuai route kamu
|
||||||
|
const url = `<?= base_url('api/gitea/getrepos') ?>/${username}`;
|
||||||
|
const res = await fetch(url);
|
||||||
|
|
||||||
|
if (!res.ok) {
|
||||||
|
throw new Error(`HTTP error! status: ${res.status}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await res.json();
|
||||||
|
|
||||||
|
if (response.success && response.data.length > 0) {
|
||||||
|
selectRepo.innerHTML = '<option value="">-- Select Repository --</option>';
|
||||||
|
response.data.forEach(repo => {
|
||||||
|
selectRepo.innerHTML += `<option value="${repo.name}">${repo.name}</option>`;
|
||||||
|
});
|
||||||
|
selectRepo.disabled = false;
|
||||||
|
} else {
|
||||||
|
selectRepo.innerHTML = '<option value="">Repository not found</option>';
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error fetching repos:', error);
|
||||||
|
selectRepo.innerHTML = '<option value="">Error loading repository</option>';
|
||||||
|
alert('Failed to fetch repository data from the server.');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 2. Ambil Branch ketika Repo dipilih
|
||||||
|
selectRepo.addEventListener('change', async () => {
|
||||||
|
const username = selectUser.value;
|
||||||
|
const repo = selectRepo.value;
|
||||||
|
if (!repo) return;
|
||||||
|
|
||||||
|
selectBranch.innerHTML = '<option value="">Loading...</option>';
|
||||||
|
selectBranch.disabled = true;
|
||||||
|
btnLoadCommits.disabled = true;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// PERBAIKAN: Menggunakan getbranches sesuai route kamu
|
||||||
|
const url = `<?= base_url('api/gitea/getbranches') ?>/${username}/${repo}`;
|
||||||
|
const res = await fetch(url);
|
||||||
|
const response = await res.json();
|
||||||
|
|
||||||
|
if (response.success && response.data.length > 0) {
|
||||||
|
selectBranch.innerHTML = '<option value="">-- Select Branch --</option>';
|
||||||
|
response.data.forEach(branch => {
|
||||||
|
selectBranch.innerHTML += `<option value="${branch.name}">${branch.name}</option>`;
|
||||||
|
});
|
||||||
|
selectBranch.disabled = false;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error fetching branches:', error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 3. Enable tombol Commit ketika branch dipilih
|
||||||
|
selectBranch.addEventListener('change', () => {
|
||||||
|
btnLoadCommits.disabled = !selectBranch.value;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 4. Ambil Commits dan Render HTML
|
||||||
|
btnLoadCommits.addEventListener('click', async () => {
|
||||||
|
const username = selectUser.value;
|
||||||
|
const repo = selectRepo.value;
|
||||||
|
const branch = selectBranch.value;
|
||||||
|
|
||||||
|
commitsContainer.innerHTML = '<div class="text-center"><div class="spinner-border text-primary" role="status"></div><p>Fetching commits...</p></div>';
|
||||||
|
|
||||||
|
try {
|
||||||
|
// set limit=50
|
||||||
|
const limit = 50;
|
||||||
|
const url = `<?= base_url('api/gitea/getcommits') ?>/${username}/${repo}?sha=${encodeURIComponent(branch)}&limit=${limit}`;
|
||||||
|
const res = await fetch(url);
|
||||||
|
const response = await res.json();
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
renderCommits(response.data);
|
||||||
|
} else {
|
||||||
|
commitsContainer.innerHTML = `<div class="alert alert-danger">${response.message}</div>`;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
commitsContainer.innerHTML = `<div class="alert alert-danger">Failed to contact the server.</div>`;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Fungsi untuk me-render HTML persis seperti template PHP yang kamu buat
|
||||||
|
function renderCommits(commits) {
|
||||||
|
if (!commits || commits.length === 0) {
|
||||||
|
commitsContainer.innerHTML = `
|
||||||
|
<div class="alert alert-info text-center shadow-sm">
|
||||||
|
<i class="bi bi-info-circle me-2"></i> No commit history available for this branch.
|
||||||
|
</div>`;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let html = '';
|
||||||
|
commits.forEach((item, index) => {
|
||||||
|
const message = item.commit?.message || 'No commit message';
|
||||||
|
const authorName = item.author?.username || item.commit?.author?.name || 'Unknown';
|
||||||
|
const avatar = item.author?.avatar_url || `https://ui-avatars.com/api/?name=${encodeURIComponent(authorName)}&background=random`;
|
||||||
|
|
||||||
|
const dateObj = new Date(item.commit?.author?.date);
|
||||||
|
const dateStr = dateObj.toLocaleDateString('id-ID', { day: '2-digit', month: 'short', year: 'numeric' }) + ', ' +
|
||||||
|
dateObj.toLocaleTimeString('id-ID', { hour: '2-digit', minute: '2-digit' });
|
||||||
|
|
||||||
|
const shaShort = item.sha ? item.sha.substring(0, 10) : '';
|
||||||
|
const commitUrl = item.html_url || '#';
|
||||||
|
|
||||||
|
const additions = item.stats?.additions || 0;
|
||||||
|
const deletions = item.stats?.deletions || 0;
|
||||||
|
const files = item.files || [];
|
||||||
|
|
||||||
|
html += `
|
||||||
|
<div class="card shadow-sm mb-3 border-0 commit-card">
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="d-flex justify-content-between align-items-start gap-3 flex-sm-row flex-column">
|
||||||
|
|
||||||
|
<div class="d-flex align-items-start flex-grow-1 overflow-hidden w-100">
|
||||||
|
<img src="${avatar}" class="rounded-circle avatar border me-3 flex-shrink-0" alt="Avatar ${authorName}" width="40" height="40">
|
||||||
|
|
||||||
|
<div class="overflow-hidden w-100">
|
||||||
|
<a href="${commitUrl}" target="_blank" class="commit-message text-truncate d-block fw-bold text-decoration-none text-dark" title="${escapeHtml(message)}">
|
||||||
|
${escapeHtml(message)}
|
||||||
|
</a>
|
||||||
|
<div class="text-muted small mt-1 text-truncate">
|
||||||
|
<i class="bi bi-person-fill"></i> <strong>${escapeHtml(authorName)}</strong> melakukan commit pada ${dateStr}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="text-sm-end flex-shrink-0 mt-3 mt-sm-0">
|
||||||
|
<a href="${commitUrl}" target="_blank" class="badge bg-light text-dark border font-monospace text-decoration-none fs-6 mb-2 d-inline-block">
|
||||||
|
<i class="bi bi-hash"></i>${shaShort}
|
||||||
|
</a>
|
||||||
|
<div class="stats small font-monospace fw-bold">
|
||||||
|
<span class="text-success me-2" title="Additions"><i class="bi bi-plus-square-fill"></i> ${additions}</span>
|
||||||
|
<span class="text-danger" title="Deletions"><i class="bi bi-dash-square-fill"></i> ${deletions}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>`;
|
||||||
|
|
||||||
|
if (files.length > 0) {
|
||||||
|
html += `
|
||||||
|
<div class="mt-3 border-top pt-2 d-flex justify-content-between align-items-center">
|
||||||
|
<span class="text-muted small"><i class="bi bi-files"></i> Mengubah ${files.length} file</span>
|
||||||
|
<button class="btn btn-sm btn-outline-secondary rounded-pill" type="button" data-bs-toggle="collapse" data-bs-target="#files-${index}" aria-expanded="false">
|
||||||
|
Lihat Detail File <i class="bi bi-chevron-down"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="collapse mt-2" id="files-${index}">
|
||||||
|
<div class="card card-body bg-light border-0 p-3 file-list">
|
||||||
|
<ul class="list-unstyled mb-0 small font-monospace">`;
|
||||||
|
|
||||||
|
files.forEach(file => {
|
||||||
|
let statusClass = 'text-secondary';
|
||||||
|
let icon = 'bi-file-earmark';
|
||||||
|
if (file.status === 'added') { statusClass = 'text-success'; icon = 'bi-file-earmark-plus-fill'; }
|
||||||
|
else if (file.status === 'modified') { statusClass = 'text-warning'; icon = 'bi-file-earmark-diff-fill'; }
|
||||||
|
else if (file.status === 'removed' || file.status === 'deleted') { statusClass = 'text-danger'; icon = 'bi-file-earmark-minus-fill'; }
|
||||||
|
|
||||||
|
html += `
|
||||||
|
<li class="mb-1 d-flex align-items-center">
|
||||||
|
<i class="bi ${icon} ${statusClass} me-2 fs-6"></i>
|
||||||
|
<span class="text-truncate" title="${escapeHtml(file.filename)}">
|
||||||
|
${escapeHtml(file.filename)}
|
||||||
|
</span>
|
||||||
|
</li>`;
|
||||||
|
});
|
||||||
|
|
||||||
|
html += ` </ul>
|
||||||
|
</div>
|
||||||
|
</div>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
html += `
|
||||||
|
</div>
|
||||||
|
</div>`;
|
||||||
|
});
|
||||||
|
|
||||||
|
commitsContainer.innerHTML = html;
|
||||||
|
}
|
||||||
|
|
||||||
|
function escapeHtml(unsafe) {
|
||||||
|
if(!unsafe) return '';
|
||||||
|
return unsafe
|
||||||
|
.replace(/&/g, "&")
|
||||||
|
.replace(/</g, "<")
|
||||||
|
.replace(/>/g, ">")
|
||||||
|
.replace(/"/g, """)
|
||||||
|
.replace(/'/g, "'");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
@ -113,9 +113,10 @@
|
|||||||
<li><a href="<?=base_url();?>acttext">Activity Text</a></li>
|
<li><a href="<?=base_url();?>acttext">Activity Text</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
<li> <a class="waves-effect waves-dark" href='<?=base_url();?>gitea' aria-expanded="false"> <i class="fa-brands fa-git-alt"></i><span class='hide-menu'>Commits</span></a></li>
|
||||||
|
|
||||||
<?php elseif ($isPS): ?>
|
<?php elseif ($isPS): ?>
|
||||||
<li> <a class="has-arrow waves-effect waves-dark" href="javascript:void(0)" aria-expanded="false"> <i class="fas fa-user"></i><span class="hide-menu">User</span> </a>
|
<!-- <li> <a class="has-arrow waves-effect waves-dark" href="javascript:void(0)" aria-expanded="false"> <i class="fas fa-user"></i><span class="hide-menu">User</span> </a>
|
||||||
<ul aria-expanded="false" class="collapse">
|
<ul aria-expanded="false" class="collapse">
|
||||||
<li><a href="<?=base_url();?>contacts">Contacts</a></li>
|
<li><a href="<?=base_url();?>contacts">Contacts</a></li>
|
||||||
<li><a href="<?=base_url();?>mailgroups">Mail Group</a></li>
|
<li><a href="<?=base_url();?>mailgroups">Mail Group</a></li>
|
||||||
@ -136,7 +137,7 @@
|
|||||||
<li><a href="<?=base_url();?>accounts">Accounts</a></li>
|
<li><a href="<?=base_url();?>accounts">Accounts</a></li>
|
||||||
<li><a href="<?=base_url();?>sites">Sites</a></li>
|
<li><a href="<?=base_url();?>sites">Sites</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li> -->
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user