Added Tabs to edit page

This commit is contained in:
2025-11-16 21:57:10 -08:00
parent bba62180fe
commit a14df54cd9
29 changed files with 771 additions and 130 deletions

View File

@@ -0,0 +1,62 @@
{% extends '@novaconium/master.html.twig' %}
{% block content %}
<h2>Edit Page - {{ title }}</h2>
<form method="post" action="/novaconium/savePage" id="edit-page-form-novaconium">
<input type="hidden" name="id" value="{{ rows.id }}">
<input type="hidden" name="token" value="{{ token }}">
<div class="form-group">
<button type="submit">Save Changes</button>
</div>
<div id="edit-page-title" class="form-group">
<label for="title">
Title
<span class="tooltip">?<span class="tooltiptext">This is the title for the cms, it's the default in twig, heading and metadata can be overwritten.</span></span>
</label>
<input type="text" id="title" name="title" value="{{ rows.title }}" required>
<div id="edit-page-dates">
<strong>Last Updated:</strong> {{ rows.updated|date("Y-m-d H:i:s") }},
<strong>Created:</strong> {{ rows.created|date("Y-m-d H:i:s") }}
</div>
</div>
<div class="tab-container">
<!-- Tab Navigation -->
<nav class="tab-nav">
<button type="button" class="tab-button active" onclick="switchTab('content1')">Basic Info</button>
<button type="button" class="tab-button" onclick="switchTab('content2')">SEO & Meta</button>
<button type="button" class="tab-button" onclick="switchTab('content3')">Sitemap</button>
<button type="button" class="tab-button" onclick="switchTab('content4')">Page Tweaks</button>
<button type="button" class="tab-button" onclick="switchTab('content5')">Page Notes</button>
<button type="button" class="tab-button" onclick="switchTab('content6', this)">Tags</button>
</nav>
<div id="content1" class="tab-content active">
{% include '@novacore/editpage/tab-main.html.twig' %}
</div>
<div id="content2" class="tab-content">
{% include '@novacore/editpage/tab-metadata.html.twig' %}
</div>
<div id="content3" class="tab-content">
{% include '@novacore/editpage/tab-other.html.twig' %}
</div>
<div id="content4" class="tab-content">
{% include '@novacore/editpage/tab-tweaks.html.twig' %}
</div>
<div id="content5" class="tab-content">
{% include '@novacore/editpage/tab-notes.html.twig' %}
</div>
<div id="content6" class="tab-content">
{% include '@novacore/editpage/tab-tags.html.twig' %}
</div>
</div>
</form>
{% endblock %}

View File

@@ -0,0 +1,16 @@
<div class="form-group">
<label for="slug">
Slug: (<a href="/page/{{ rows.slug }}" target="_new">/page/{{ rows.slug }}</a>)
<span class="tooltip">?<span class="tooltiptext">Slug is a human readable but uri friendly name for the page.</span></span>
</label>
<input type="text" id="slug" name="slug" value="{{ rows.slug }}" required>
</div>
<!-- Ace Editor -->
<div class="form-group fullwidth">
<label for="body">Body:</label>
<div class="editor-container">
<textarea id="body" name="body" rows="10" style="display: none;">{{ rows.body|default('')|e('html') }}</textarea>
<div id="body-editor" class="ace-editor"></div> {# Ace mounts here #}
</div>
</div>

View File

@@ -0,0 +1,17 @@
<h2>Metadata</h2>
<div class="form-group">
<label for="description">Description:</label>
<input type="text" id="description" name="description" value="{{ rows.description }}">
</div>
<div class="form-group">
<label for="keywords">Keywords:</label>
<input type="text" id="keywords" name="keywords" value="{{ rows.keywords }}">
</div>
<div class="form-group">
<label for="author">Author:</label>
<input type="text" id="author" name="author" value="{{ rows.author }}">
</div>

View File

@@ -0,0 +1,4 @@
<div class="form-group fullwidth">
<label for="notes">Notes:</label>
<textarea id="notes" name="notes" rows="5">{{ rows.notes }}</textarea>
</div>

View File

@@ -0,0 +1,25 @@
<h2>Sitemap</h2>
<div class="form-group">
<label for="path">Path:</label>
<input type="text" id="path" name="path" value="{{ rows.path }}">
</div>
<div class="form-group">
<label for="changefreq">Change Frequency:</label>
<select id="changefreq" name="changefreq">
{% set freqs = ['always', 'hourly', 'daily', 'weekly', 'monthly', 'yearly', 'never'] %}
{% for freq in freqs %}
<option value="{{ freq }}" {% if rows.changefreq == freq %}selected{% endif %}>
{{ freq|capitalize }}
</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<label for="priority">Priority (0.0 - 1.0):</label>
<input type="number" id="priority" name="priority" value="{{ rows.priority }}" step="0.1" min="0" max="1">
</div>

View File

@@ -0,0 +1,12 @@
<h1>Tags</h1>
<label for="tags">
Tags:
<span class="tooltip">?<span class="tooltiptext">Comma-separated keywords for categorizing this page (e.g., blog, tutorial). Click chips to remove; type to see suggestions.</span><span class="tooltip-desc" id="desc-tags">Comma-separated keywords for categorizing this page (e.g., blog, tutorial). Click chips to remove; type to see suggestions.</span></span>
</label>
<div class="form-row">
<div class="tags-input" id="tags-input" data-tags="{{ rows.page_tags|default('')|split(',')|filter('trim')|default([])|json_encode|e('html_attr') }}" data-existing-tags="{{ rows.existing_tags|default('')|split(',')|filter('trim')|default([])|json_encode|e('html_attr') }}">
<input type="text" id="tags" name="tags" placeholder="e.g., seo, cms, php" aria-describedby="desc-tags">
<ul id="tags-dropdown" class="tags-dropdown" role="listbox" aria-expanded="false"></ul> {# Custom dropdown #}
</div>
<input type="hidden" id="tags_json" name="tags_json" value="{{ rows.page_tags|default('')|split(',')|filter('trim')|default([])|json_encode|e('html_attr') }}">
</div>

View File

@@ -0,0 +1,10 @@
<h2>Page Data</h2>
<div class="form-group">
<label for="heading">Heading:</label>
<input type="text" id="heading" name="heading" value="{{ rows.heading }}">
</div>
<div class="form-group fullwidth">
<label for="intro">Intro:</label>
<textarea id="intro" name="intro" rows="5">{{ rows.intro }}</textarea>
</div>