First Commit

This commit is contained in:
marco
2026-09-01 10:46:29 -03:00
commit bf96b77e9c
10000 changed files with 3508600 additions and 0 deletions
+194
View File
@@ -0,0 +1,194 @@
{% extends "layouts/dashboard.twig" %}
{% block title %}{{ title }} - {{ platformName }}{% endblock %}
{% block head %}
<style>
.note-card {
transition: transform 0.2s, box-shadow 0.2s;
border-radius: 10px;
overflow: hidden;
height: 100%;
}
.note-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}
.note-content {
max-height: 200px;
overflow: hidden;
position: relative;
word-break: break-word;
overflow-wrap: break-word;
}
.note-content p {
margin-bottom: 0.5rem;
}
.note-content *:last-child {
margin-bottom: 0;
}
.pinned-badge {
position: absolute;
top: 10px;
right: 10px;
color: #ffc107;
font-size: 1.2rem;
}
</style>
{% endblock %}
{% block content %}
<div class="container-fluid px-4">
<div class="d-flex justify-content-between align-items-center mb-4">
<h1 class="mt-4">{{ title }}</h1>
<div class="d-flex gap-2">
<form action="{{ url('/admin/notes') }}" method="GET" class="d-flex gap-2 me-3">
<div class="input-group" style="min-width: 250px;">
<span class="input-group-text bg-white"><i class="bi bi-search"></i></span>
<input type="text" name="search" class="form-control" placeholder="{{ __('notes.search_placeholder') }}" value="{{ filters.search }}">
</div>
<select name="subject_id" class="form-select" style="min-width: 180px;" onchange="this.form.submit()">
<option value="">{{ __('notes.all_subjects') }}</option>
{% for subject in subjects %}
<option value="{{ subject.subjects_id }}" {{ filters.subject_id == subject.subjects_id ? 'selected' : '' }}>{{ subject.subjects_name }}</option>
{% endfor %}
</select>
{% if filters.search or filters.subject_id %}
<a href="{{ url('/admin/notes') }}" class="btn btn-outline-secondary" title="{{ __('notes.cancel') }}"><i class="bi bi-x-lg"></i></a>
{% endif %}
</form>
<button type="button" class="btn btn-outline-primary" data-bs-toggle="modal" data-bs-target="#subjectsModal">
<i class="bi bi-tags me-1"></i> {{ __('notes.manage_subjects') }}
</button>
<a href="{{ url('/admin/notes/create') }}" class="btn btn-primary">
<i class="bi bi-file-earmark-plus me-1"></i> {{ __('notes.add_note') }}
</a>
</div>
</div>
{% if flash_messages.success %}
<div class="alert alert-success alert-dismissible fade show" role="alert">
{{ flash_messages.success }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endif %}
<div class="row row-cols-1 row-cols-md-2 row-cols-lg-3 row-cols-xl-4 g-4">
{% for note in notes %}
<div class="col">
<div class="card note-card shadow-sm h-100" style="background-color: {{ note.notes_color }};">
{% if note.notes_is_pinned %}
<div class="pinned-badge"><i class="bi bi-pin-angle-fill"></i></div>
{% endif %}
<div class="card-body">
<div class="d-flex justify-content-between align-items-start mb-2">
<h5 class="card-title text-truncate pe-4">
{{ note.notes_title }}
{% if note.notes_image or note.notes_file %}
<span class="ms-1 fs-6 text-muted" title="{{ __('notes.has_attachments')|default('Possui anexos') }}">
<i class="bi bi-paperclip"></i>
</span>
{% endif %}
</h5>
<div class="dropdown">
<button class="btn btn-link btn-sm text-dark p-0" type="button" data-bs-toggle="dropdown">
<i class="bi bi-three-dots-vertical"></i>
</button>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a href="{{ url('/admin/notes/edit/' ~ note.notes_id) }}" class="dropdown-item">
<i class="bi bi-pencil me-2"></i> {{ __('notes.edit_note') }}
</a>
</li>
<li>
<form action="{{ url('/admin/notes/pin/' ~ note.notes_id) }}" method="POST" class="d-inline">
<button type="submit" class="dropdown-item">
<i class="bi bi-pin me-2"></i> {{ note.notes_is_pinned ? __('notes.unpin') : __('notes.pin') }}
</button>
</form>
</li>
<li><hr class="dropdown-divider"></li>
<li>
<form action="{{ url('/admin/notes/delete/' ~ note.notes_id) }}" method="POST" class="d-inline" onsubmit="return confirm('{{ __('notes.delete_confirm') }}')">
<button type="submit" class="dropdown-item text-danger">
<i class="bi bi-trash me-2"></i> {{ __('notes.delete') }}
</button>
</form>
</li>
</ul>
</div>
</div>
<div class="note-content small text-muted">
{{ note.notes_content|raw }}
</div>
</div>
<div class="card-footer bg-transparent border-0 d-flex justify-content-between align-items-center">
<div class="d-flex gap-1">
{% if note.subject %}
<span class="badge text-dark" style="background-color: {{ note.subject.subjects_color }};">
<i class="bi bi-tag me-1"></i>
{{ note.subject.subjects_name }}
</span>
{% endif %}
</div>
<small class="text-muted" title="{{ __('notes.created_at') }}: {{ note.created_at|date('d/m/Y H:i') }}">
{{ note.created_at|date('d/m/Y') }}
</small>
</div>
</div>
</div>
{% else %}
<div class="col-12 text-center py-5">
<div class="text-muted">
<i class="bi bi-journal-x display-1 mb-3"></i>
<p class="lead">{{ __('notes.no_notes') }}</p>
</div>
</div>
{% endfor %}
</div>
</div>
<!-- Subjects Management Modal -->
<div class="modal fade" id="subjectsModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{{ __('notes.manage_subjects') }}</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{{ __('notes.cancel') }}"></button>
</div>
<div class="modal-body">
<form action="{{ url('/admin/notes/subjects/store') }}" method="POST" class="mb-4">
<div class="row g-2">
<div class="col-7">
<input type="text" name="subjects_name" class="form-control" placeholder="{{ __('notes.subject_name') }}" required>
</div>
<div class="col-3">
<input type="color" name="subjects_color" class="form-control form-control-color w-100" value="#6c757d" title="{{ __('notes.subject_color') }}">
</div>
<div class="col-2">
<button type="submit" class="btn btn-primary w-100" title="{{ __('notes.add') }}"><i class="bi bi-plus-lg"></i></button>
</div>
</div>
</form>
<div class="list-group">
{% for subject in subjects %}
<div class="list-group-item d-flex justify-content-between align-items-center">
<div>
<span class="badge rounded-circle p-2 me-2" style="background-color: {{ subject.subjects_color }};"> </span>
{{ subject.subjects_name }}
</div>
<form action="{{ url('/admin/notes/subjects/delete/' ~ subject.subjects_id) }}" method="POST" onsubmit="return confirm('{{ __('notes.delete_subject_confirm') }}')">
<button type="submit" class="btn btn-link btn-sm text-danger p-0" title="{{ __('notes.delete') }}"><i class="bi bi-trash"></i></button>
</form>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
{% endblock %}