first commit all files
This commit is contained in:
132
views/settings/layout.php
Normal file
132
views/settings/layout.php
Normal file
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
/**
|
||||
* Settings Layout - Bootstrap 5 wrapper
|
||||
*
|
||||
* @package WP_Agentic_Writer
|
||||
* @var array $view_data Prepared view data from class-settings-v2.php
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Extract view data for easier access
|
||||
extract( $view_data );
|
||||
?>
|
||||
<div class="wrap wpaw-settings-v2-wrap">
|
||||
<div class="container py-4">
|
||||
<!-- Header -->
|
||||
<div class="wpaw-agentic-header mb-4">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="d-flex align-items-center gap-3">
|
||||
<img src="<?php echo esc_url( WP_AGENTIC_WRITER_URL . 'assets/img/icon.svg' ); ?>"
|
||||
alt="WP Agentic Writer"
|
||||
style="width: 48px; height: 48px; filter: invert(1)">
|
||||
<div>
|
||||
<h1 class="h3 mb-1"><?php esc_html_e( 'WP Agentic Writer', 'wp-agentic-writer' ); ?></h1>
|
||||
<p class="text-muted mb-0">
|
||||
v<?php echo esc_html( WP_AGENTIC_WRITER_VERSION ); ?> ·
|
||||
<?php esc_html_e( 'Settings & Configuration', 'wp-agentic-writer' ); ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tab Navigation -->
|
||||
<div class="row mb-4">
|
||||
<div class="col-12">
|
||||
<ul class="nav nav-pills nav-fill gap-2 p-2" id="wpaw-settings-tabs" role="tablist">
|
||||
<li class="nav-item mb-0" role="presentation">
|
||||
<button class="nav-link active d-flex align-items-center justify-content-center gap-2" id="general-tab" data-bs-toggle="pill" data-bs-target="#general" type="button" role="tab" aria-controls="general" aria-selected="true">
|
||||
<i class="bi bi-sliders"></i>
|
||||
<?php esc_html_e( 'General', 'wp-agentic-writer' ); ?>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item mb-0" role="presentation">
|
||||
<button class="nav-link d-flex align-items-center justify-content-center gap-2" id="models-tab" data-bs-toggle="pill" data-bs-target="#models" type="button" role="tab" aria-controls="models" aria-selected="false">
|
||||
<i class="bi bi-stars"></i>
|
||||
<?php esc_html_e( 'AI Models', 'wp-agentic-writer' ); ?>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item mb-0" role="presentation">
|
||||
<button class="nav-link d-flex align-items-center justify-content-center gap-2" id="cost-log-tab" data-bs-toggle="pill" data-bs-target="#cost-log" type="button" role="tab" aria-controls="cost-log" aria-selected="false">
|
||||
<i class="bi bi-graph-up"></i>
|
||||
<?php esc_html_e( 'Cost Log', 'wp-agentic-writer' ); ?>
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item mb-0" role="presentation">
|
||||
<button class="nav-link d-flex align-items-center justify-content-center gap-2" id="guide-tab" data-bs-toggle="pill" data-bs-target="#guide" type="button" role="tab" aria-controls="guide" aria-selected="false">
|
||||
<i class="bi bi-book"></i>
|
||||
<?php esc_html_e( 'Model Guide', 'wp-agentic-writer' ); ?>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Form Start -->
|
||||
<form method="post" action="options.php" id="wpaw-settings-form">
|
||||
<?php settings_fields( 'wp_agentic_writer_settings' ); ?>
|
||||
|
||||
<!-- Tab Content -->
|
||||
<div class="tab-content" id="wpaw-settings-tab-content">
|
||||
<!-- General Tab -->
|
||||
<div class="tab-pane fade show active" id="general" role="tabpanel" aria-labelledby="general-tab">
|
||||
<?php include WP_AGENTIC_WRITER_DIR . 'views/settings/tab-general.php'; ?>
|
||||
</div>
|
||||
|
||||
<!-- Models Tab -->
|
||||
<div class="tab-pane fade" id="models" role="tabpanel" aria-labelledby="models-tab">
|
||||
<?php include WP_AGENTIC_WRITER_DIR . 'views/settings/tab-models.php'; ?>
|
||||
</div>
|
||||
|
||||
<!-- Cost Log Tab -->
|
||||
<div class="tab-pane fade" id="cost-log" role="tabpanel" aria-labelledby="cost-log-tab">
|
||||
<?php include WP_AGENTIC_WRITER_DIR . 'views/settings/tab-cost-log.php'; ?>
|
||||
</div>
|
||||
|
||||
<!-- Guide Tab -->
|
||||
<div class="tab-pane fade" id="guide" role="tabpanel" aria-labelledby="guide-tab">
|
||||
<?php include WP_AGENTIC_WRITER_DIR . 'views/settings/tab-guide.php'; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sticky Save Button -->
|
||||
<div class="row mt-4">
|
||||
<div class="col-12">
|
||||
<div class="card border-0 shadow-sm">
|
||||
<div class="card-body d-flex justify-content-between align-items-center py-3">
|
||||
<div class="text-muted small">
|
||||
<span class="dashicons dashicons-info-outline me-1"></span>
|
||||
<?php esc_html_e( 'Changes are saved immediately after clicking Save.', 'wp-agentic-writer' ); ?>
|
||||
</div>
|
||||
<div class="d-flex gap-2">
|
||||
<button type="button" class="btn btn-outline-secondary" id="wpaw-reset-settings">
|
||||
<span class="dashicons dashicons-image-rotate me-1"></span>
|
||||
<?php esc_html_e( 'Reset to Defaults', 'wp-agentic-writer' ); ?>
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary btn-lg px-4" id="wpaw-save-settings">
|
||||
<span class="dashicons dashicons-saved me-1"></span>
|
||||
<?php esc_html_e( 'Save Settings', 'wp-agentic-writer' ); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Toast Container for Notifications -->
|
||||
<div class="toast-container position-fixed bottom-0 end-0 p-3">
|
||||
<div id="wpaw-toast" class="toast" role="alert" aria-live="assertive" aria-atomic="true">
|
||||
<div class="toast-header">
|
||||
<span class="me-2">✨</span>
|
||||
<strong class="me-auto"><?php esc_html_e( 'WP Agentic Writer', 'wp-agentic-writer' ); ?></strong>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="toast-body" id="wpaw-toast-message"></div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user