Session: Total cost: $5.44 (costs may be inaccurate due to usage of unknown models) Total duration (API): 50m 49s Total duration (wall): 1h 10m 53s Total code changes: 2972 lines added, 29 lines removed Usage by model: qwen/qwen3.6-35b-a3b: 287.3k input, 69.6k output, 11.5m cache read, 0 cache write ($5.37) claude-haiku-4-5: 9.4k input, 13.3k output, 8.3k cache read, 0 cache write ($0.0767) Runtime: llamacpp Model: Qwen 3.6 35B A3B Q4 K M Coding Agent: ClaudeCode
364 lines
12 KiB
PHP
364 lines
12 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>{{ $organization->name }} - TimeLog</title>
|
|
<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=Inter:wght@100..900&display=swap" rel="stylesheet">
|
|
<style>
|
|
:root {
|
|
--primary: #03a9f4;
|
|
--primary-dark: #0287c5;
|
|
--text-dark: #333;
|
|
--text-medium: #546e7a;
|
|
--text-muted: #9ba8b0;
|
|
--bg-light: #f2f6f8;
|
|
--bg-white: #fff;
|
|
--border-color: #e9e9ed;
|
|
}
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
body {
|
|
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
color: var(--text-dark);
|
|
background: var(--bg-light);
|
|
min-height: 100vh;
|
|
}
|
|
.topbar {
|
|
background: var(--bg-white);
|
|
border-bottom: 1px solid var(--border-color);
|
|
padding: 12px 24px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
}
|
|
.topbar .org-name {
|
|
font-size: 18px;
|
|
font-weight: 700;
|
|
color: var(--text-dark);
|
|
}
|
|
.topbar .logout {
|
|
font-size: 14px;
|
|
color: var(--primary);
|
|
text-decoration: none;
|
|
}
|
|
.topbar .logout:hover {
|
|
text-decoration: underline;
|
|
}
|
|
.dashboard {
|
|
max-width: 800px;
|
|
margin: 60px auto;
|
|
padding: 0 24px;
|
|
text-align: center;
|
|
}
|
|
.dashboard h1 {
|
|
font-size: 28px;
|
|
font-weight: 800;
|
|
margin-bottom: 8px;
|
|
}
|
|
.dashboard p {
|
|
font-size: 16px;
|
|
color: var(--text-medium);
|
|
margin-bottom: 32px;
|
|
}
|
|
.org-cards {
|
|
display: flex;
|
|
gap: 16px;
|
|
flex-wrap: wrap;
|
|
justify-content: center;
|
|
margin-bottom: 40px;
|
|
}
|
|
.org-card {
|
|
background: var(--bg-white);
|
|
border: 2px solid var(--primary);
|
|
border-radius: 8px;
|
|
padding: 20px 32px;
|
|
text-align: center;
|
|
}
|
|
.org-card h3 {
|
|
font-size: 16px;
|
|
font-weight: 600;
|
|
color: var(--text-dark);
|
|
}
|
|
.org-card .badge {
|
|
display: inline-block;
|
|
background: var(--primary);
|
|
color: white;
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
padding: 2px 8px;
|
|
border-radius: 4px;
|
|
margin-top: 6px;
|
|
}
|
|
.add-org-btn {
|
|
background: var(--bg-white);
|
|
border: 2px dashed var(--border-color);
|
|
border-radius: 8px;
|
|
padding: 20px 32px;
|
|
cursor: pointer;
|
|
transition: border-color 0.15s;
|
|
font-family: inherit;
|
|
font-size: 16px;
|
|
color: var(--text-medium);
|
|
}
|
|
.add-org-btn:hover {
|
|
border-color: var(--primary);
|
|
color: var(--primary);
|
|
}
|
|
.section-title {
|
|
font-size: 18px;
|
|
font-weight: 700;
|
|
color: var(--text-dark);
|
|
margin-bottom: 16px;
|
|
}
|
|
.org-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
max-width: 500px;
|
|
margin: 0 auto;
|
|
}
|
|
.org-list-item {
|
|
background: var(--bg-white);
|
|
border: 1px solid var(--border-color);
|
|
border-radius: 8px;
|
|
padding: 12px 16px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
}
|
|
.org-list-item .name {
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
}
|
|
.org-list-item .actions {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
}
|
|
.org-list-item .switch-btn {
|
|
font-size: 13px;
|
|
color: var(--primary);
|
|
background: none;
|
|
border: none;
|
|
cursor: pointer;
|
|
font-family: inherit;
|
|
}
|
|
.org-list-item .switch-btn:hover {
|
|
text-decoration: underline;
|
|
}
|
|
.org-list-item .del-btn {
|
|
font-size: 13px;
|
|
color: var(--error-color, #bf2600);
|
|
background: none;
|
|
border: none;
|
|
cursor: pointer;
|
|
font-family: inherit;
|
|
}
|
|
.org-list-item .del-btn:hover {
|
|
text-decoration: underline;
|
|
}
|
|
@media (max-width: 768px) {
|
|
.dashboard { margin-top: 30px; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="topbar">
|
|
<span class="org-name">{{ $organization->name }}</span>
|
|
<a href="{{ url('/') }}" class="logout">Log out</a>
|
|
</div>
|
|
|
|
<div class="dashboard">
|
|
<h1>Welcome to TimeLog</h1>
|
|
<p>Start tracking time in your organization.</p>
|
|
|
|
<div class="org-cards">
|
|
<div class="org-card">
|
|
<h3>{{ $organization->name }}</h3>
|
|
<span class="badge">Current</span>
|
|
</div>
|
|
<button class="add-org-btn" onclick="document.getElementById('org-modal').style.display='flex'">+ Add organization</button>
|
|
</div>
|
|
|
|
<h3 class="section-title">Your organizations</h3>
|
|
<div class="org-list">
|
|
@foreach(auth()->user()->organizations as $org)
|
|
<div class="org-list-item">
|
|
<span class="name">{{ $org->name }}{{ $org->id === $organization->id ? ' (current)' : '' }}</span>
|
|
<span class="actions">
|
|
@if($org->id !== $organization->id)
|
|
<form method="POST" action="{{ route('organizations.show', $org) }}" style="display:inline;">
|
|
@method('PUT')
|
|
@csrf
|
|
<button type="submit" class="switch-btn">Switch</button>
|
|
</form>
|
|
@endif
|
|
@if(auth()->user()->organizations->count() > 1 && $org->id !== $organization->id)
|
|
<form method="POST" action="{{ route('organizations.destroy', $org) }}" onsubmit="return confirm('Delete this organization?');">
|
|
@csrf
|
|
@method('DELETE')
|
|
<button type="submit" class="del-btn">Delete</button>
|
|
</form>
|
|
@endif
|
|
</span>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
|
|
<div id="org-modal" class="org-modal" style="display:none;">
|
|
<div class="org-modal-backdrop" data-close-modal></div>
|
|
<div class="org-modal-card">
|
|
<div class="org-modal__header">
|
|
<h2>Add an organization</h2>
|
|
</div>
|
|
<div class="org-modal__body">
|
|
<div class="form-control">
|
|
<label for="org-name">Organization name</label>
|
|
<input type="text" id="org-name" name="name" placeholder="e.g. My Company" maxlength="255">
|
|
</div>
|
|
<p id="org-error" class="org-error" style="display:none;"></p>
|
|
</div>
|
|
<div class="org-modal__footer">
|
|
<button type="button" class="btn-cancel" data-close-modal>Cancel</button>
|
|
<button type="button" class="btn-primary" id="org-create-btn" onclick="createOrganization()">Create</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function createOrganization() {
|
|
const name = document.getElementById('org-name').value.trim();
|
|
const errorEl = document.getElementById('org-error');
|
|
const btn = document.getElementById('org-create-btn');
|
|
|
|
if (!name) {
|
|
errorEl.textContent = 'Please enter an organization name.';
|
|
errorEl.style.display = 'block';
|
|
return;
|
|
}
|
|
|
|
btn.textContent = 'Creating...';
|
|
btn.disabled = true;
|
|
errorEl.style.display = 'none';
|
|
|
|
fetch('{{ route("organizations.store") }}', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
'X-CSRF-TOKEN': '{{ csrf_token() }}',
|
|
'Accept': 'application/json'
|
|
},
|
|
body: JSON.stringify({ name: name })
|
|
})
|
|
.then(res => res.json())
|
|
.then(data => {
|
|
if (data.redirect) {
|
|
window.location.href = data.redirect;
|
|
} else if (data.errors) {
|
|
const messages = Object.values(data.errors).flat().join('\n');
|
|
errorEl.textContent = messages;
|
|
errorEl.style.display = 'block';
|
|
}
|
|
})
|
|
.catch(err => {
|
|
errorEl.textContent = 'Something went wrong. Please try again.';
|
|
errorEl.style.display = 'block';
|
|
})
|
|
.finally(() => {
|
|
btn.textContent = 'Create';
|
|
btn.disabled = false;
|
|
});
|
|
}
|
|
|
|
document.querySelectorAll('[data-close-modal]').forEach(el => {
|
|
el.addEventListener('click', () => {
|
|
document.getElementById('org-modal').style.display = 'none';
|
|
});
|
|
});
|
|
|
|
document.getElementById('org-name').addEventListener('input', function () {
|
|
document.getElementById('org-error').style.display = 'none';
|
|
});
|
|
|
|
document.getElementById('org-name').addEventListener('keydown', function (e) {
|
|
if (e.key === 'Enter') {
|
|
e.preventDefault();
|
|
createOrganization();
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<style>
|
|
.org-modal {
|
|
position: fixed;
|
|
top: 0; left: 0; right: 0; bottom: 0;
|
|
z-index: 200;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
.org-modal-backdrop {
|
|
position: absolute;
|
|
top: 0; left: 0; right: 0; bottom: 0;
|
|
background: rgba(0, 0, 0, 0.5);
|
|
cursor: pointer;
|
|
}
|
|
.org-modal-card {
|
|
position: relative;
|
|
background: var(--bg-white);
|
|
border-radius: 8px;
|
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
|
|
width: 100%;
|
|
max-width: 400px;
|
|
padding: 32px;
|
|
z-index: 1;
|
|
}
|
|
.org-modal__header { margin-bottom: 24px; }
|
|
.org-modal__header h2 { font-size: 20px; font-weight: 700; color: var(--text-dark); margin-bottom: 6px; }
|
|
.org-modal__body { margin-bottom: 24px; }
|
|
.org-modal__footer { display: flex; justify-content: flex-end; gap: 12px; }
|
|
.org-modal__footer .btn-primary {
|
|
padding: 10px 20px;
|
|
background: var(--primary);
|
|
color: white;
|
|
border: none;
|
|
border-radius: 8px;
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
font-family: inherit;
|
|
}
|
|
.org-modal__footer .btn-cancel {
|
|
padding: 10px 20px;
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
font-family: inherit;
|
|
color: var(--text-medium);
|
|
background: var(--bg-light);
|
|
border: 1px solid var(--border-color);
|
|
border-radius: 8px;
|
|
cursor: pointer;
|
|
}
|
|
.form-control { margin-bottom: 16px; }
|
|
.form-control label { display: block; font-size: 12px; font-weight: 500; color: var(--text-medium); margin-bottom: 4px; }
|
|
.form-control input {
|
|
width: 100%;
|
|
height: 40px;
|
|
padding: 8px 12px;
|
|
font-size: 14px;
|
|
font-family: inherit;
|
|
border: 1px solid var(--border-color);
|
|
border-radius: 4px;
|
|
background: var(--bg-light);
|
|
outline: none;
|
|
}
|
|
.org-error { color: #bf2600; font-size: 13px; margin-top: 8px; line-height: 1.4; }
|
|
@media (max-width: 480px) {
|
|
.org-modal-card { margin: 16px; padding: 24px; }
|
|
}
|
|
</style>
|
|
</body>
|
|
</html>
|