FEAT added preview link for artisans

This commit is contained in:
Antoine M 2025-04-08 11:32:20 +02:00
parent 1f1465678c
commit 7fdbc9875c
2 changed files with 17 additions and 0 deletions

View File

@ -67,10 +67,19 @@ add_action('edit_form_after_title', function () {
$status_mdp = get_field('mdp_status', get_the_ID());
$post_status = get_post_status();
$translatedStatus = translate_wordpress_online_statuses($post_status);
$post_link = get_preview_post_link();
if ($screen && $screen->post_type === 'artisans') {
?>
<h1 class="admin-artisan-title"><?php echo get_the_title() ?></h1>
<?php if (!empty($post_link) && $screen->action !== 'add') : ?>
<div class="preview-artisan-link">
<a href="<?php echo $post_link; ?>" target="_blank" class="button button-primary">
<span class="dashicons dashicons-admin-users" style="margin-right: 5px;"></span>
Voir la fiche
</a>
</div>
<?php endif; ?>
<div id="top-status" class="top-status">
<div class="state-container">
<p>État :</p>

View File

@ -702,6 +702,14 @@ select[data-enpassusermodified='yes'] {
}
}
.preview-artisan-link {
@apply !mb-12;
a {
@apply !bg-patrimoine-sante-securite !flex !items-center gap-2 w-fit !mt-4;
@apply bg-red-400 text-white !border-none !rounded-xl px-4 !py-1 ml-auto;
}
}
/* -----------------------------------------------------------
Admin styles
-----------------------------------------------------------*/