Botão Excluir
This commit is contained in:
@@ -1,4 +1,15 @@
|
||||
/* Simple File List Styles */
|
||||
:root {
|
||||
--azul-principal: #006494;
|
||||
--azul-brilhante: #00a6fb;
|
||||
--azul-claro: #0582ca;
|
||||
--azul-escuro: #003554;
|
||||
--verde: #4caf50;
|
||||
--cinza: #e0e0e0;
|
||||
--borda-radius: 4px;
|
||||
--sombra: 0 2px 10px rgba(0, 0, 0, 0.05);
|
||||
--transicao: all 0.2s ease;
|
||||
}
|
||||
.sfl-upload-container {
|
||||
background: #fff;
|
||||
border-radius: var(--borda-radius);
|
||||
@@ -224,6 +235,21 @@
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.sfl-action-link[data-action="excluir"]::before {
|
||||
font-family: "Dashicons";
|
||||
content: "\f182";
|
||||
font-size: 1.1em;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.sfl-action-link.sfl-delete-file {
|
||||
background-color: #d63638;
|
||||
}
|
||||
|
||||
.sfl-action-link.sfl-delete-file:hover {
|
||||
background-color: #b32d2e;
|
||||
}
|
||||
|
||||
/* Drag and drop styles */
|
||||
.sfl-upload-area.drag-over {
|
||||
background-color: rgba(0, 166, 251, 0.1);
|
||||
@@ -276,3 +302,19 @@
|
||||
background: #fff;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* Estilo para o botão de excluir no painel admin */
|
||||
button.sfl-delete-file {
|
||||
background-color: #d63638;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: var(--borda-radius);
|
||||
padding: 7px 16px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
|
||||
button.sfl-delete-file:hover {
|
||||
background-color: #b32d2e;
|
||||
}
|
@@ -70,7 +70,7 @@ function sfl_render_file_list() {
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="7" style="background: #f7fafd; padding: 16px 15px;">
|
||||
<th colspan="<?php echo current_user_can('upload_files') ? '8' : '7'; ?>" style="background: #f7fafd; padding: 16px 15px;">
|
||||
<form method="get" class="sfl-filter-form" style="margin:0; display: flex; align-items: center; gap: 10px;">
|
||||
<label for="sfl_categoria" style="margin:0;"><strong>Filtrar por categoria:</strong></label>
|
||||
<select name="sfl_categoria" id="sfl_categoria" onchange="this.form.submit()">
|
||||
@@ -98,6 +98,9 @@ function sfl_render_file_list() {
|
||||
<th>Data</th>
|
||||
<th>Abrir</th>
|
||||
<th>Baixar</th>
|
||||
<?php if (current_user_can('upload_files')): ?>
|
||||
<th>Ações</th>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -128,6 +131,11 @@ function sfl_render_file_list() {
|
||||
<td>
|
||||
<a href="<?php echo esc_url($file->file_url); ?>" download class="sfl-action-link" data-action="baixar">Baixar</a>
|
||||
</td>
|
||||
<td>
|
||||
<?php if (current_user_can('upload_files')): ?>
|
||||
<button class="sfl-action-link sfl-delete-file" data-file-id="<?php echo $file->id; ?>" data-action="excluir">Excluir</button>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
|
@@ -1,11 +1,12 @@
|
||||
<?php
|
||||
/*
|
||||
Plugin Name: Gerenciador de arquivos
|
||||
Description: Um sistema simples de gerenciamento de arquivos para WordPress com recursos de upload.
|
||||
Plugin Name: Simple File List
|
||||
Plugin URI: https://yourwebsite.com/simple-file-list
|
||||
Description: A simple file management system for WordPress with upload capabilities.
|
||||
Version: 1.0
|
||||
Author: Marco Antonio Vivas
|
||||
Author: Your Name
|
||||
Author URI: https://yourwebsite.com
|
||||
License: GPL2
|
||||
Plugin URI:
|
||||
*/
|
||||
|
||||
// Security check
|
||||
|
Reference in New Issue
Block a user