Made pages edit better and added messages
This commit is contained in:
@@ -5,5 +5,4 @@
|
||||
<p>Dashboard page</p>
|
||||
<p><a href="/">Homepage</a></p>
|
||||
<p><a href="/novaconium/logout">logout</p>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
30
views/editmessage.html.twig
Normal file
30
views/editmessage.html.twig
Normal file
@@ -0,0 +1,30 @@
|
||||
{% extends '@novaconium/master.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Edit Message - {{ title }}</h2>
|
||||
|
||||
<p><a href="/novaconium/messages/delete/{{ themessage.id }}">Delete</a></p>
|
||||
|
||||
<form method="post" action="/novaconium/message_save">
|
||||
<input type="hidden" name="id" value="{{ themessage.id }}">
|
||||
<input type="hidden" name="token" value="{{ token }}">
|
||||
|
||||
<label for="name">Name:</label>
|
||||
<input type="text" id="name" name="name" value="{{ themessage.name }}" required>
|
||||
|
||||
<label for="email">Email:</label>
|
||||
<input type="email" id="email" name="email" value="{{ themessage.email }}" required>
|
||||
|
||||
<label for="message">Message:</label>
|
||||
<textarea id="message" name="message" rows="10" required>{{ themessage.message }}</textarea>
|
||||
|
||||
<label for="unread">
|
||||
<input type="checkbox" id="unread" name="unread" value="1" {% if themessage.unread %}checked{% endif %}>
|
||||
Unread
|
||||
</label>
|
||||
|
||||
<p><strong>Created:</strong> {{ themessage.created|date("Y-m-d H:i:s") }}</p>
|
||||
|
||||
<button type="submit">Save Changes</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -1,32 +1,61 @@
|
||||
{% extends '@novaconium/master.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Edit Page - {{ title }}</h2>
|
||||
<h2>Edit Page - {{ title }}</h2>
|
||||
|
||||
<form method="post" action="/novaconium/savePage">
|
||||
<input type="hidden" name="id" value="{{ rows.id }}">
|
||||
<input type="hidden" name="token" value="{{ token }}">
|
||||
<form method="post" action="/novaconium/savePage">
|
||||
<input type="hidden" name="id" value="{{ rows.id }}">
|
||||
<input type="hidden" name="token" value="{{ token }}">
|
||||
|
||||
<label for="title">Title:</label>
|
||||
<input type="text" id="title" name="title" value="{{ rows.title }}" required>
|
||||
<label for="title">Title:</label>
|
||||
<input type="text" id="title" name="title" value="{{ rows.title }}" required>
|
||||
|
||||
<label for="slug">Slug: (<a href="/page/{{ rows.slug }}" target="_new">/page/{{ rows.slug }}</a>)</label>
|
||||
<input type="text" id="slug" name="slug" value="{{ rows.slug }}" required>
|
||||
<label for="heading">Heading:</label>
|
||||
<input type="text" id="heading" name="heading" value="{{ rows.heading }}">
|
||||
|
||||
<label for="body">Body:</label>
|
||||
<textarea id="body" name="body" rows="10" required>{{ rows.body }}</textarea>
|
||||
<label for="description">Description:</label>
|
||||
<input type="text" id="description" name="description" value="{{ rows.description }}">
|
||||
|
||||
<label for="intro">Intro:</label>
|
||||
<textarea id="intro" name="intro" rows="10" required>{{ rows.intro }}</textarea>
|
||||
<label for="keywords">Keywords:</label>
|
||||
<input type="text" id="keywords" name="keywords" value="{{ rows.keywords }}">
|
||||
|
||||
<label for="draft">
|
||||
<input type="checkbox" id="draft" name="draft" value="1" {% if rows.draft %}checked{% endif %}>
|
||||
Save as Draft
|
||||
</label>
|
||||
<label for="author">Author:</label>
|
||||
<input type="text" id="author" name="author" value="{{ rows.author }}">
|
||||
|
||||
<p><strong>Created:</strong> {{ rows.created|date("Y-m-d H:i:s") }}</p>
|
||||
<p><strong>Last Updated:</strong> {{ rows.updated|date("Y-m-d H:i:s") }}</p>
|
||||
<label for="slug">Slug: (<a href="/page/{{ rows.slug }}" target="_new">/page/{{ rows.slug }}</a>)</label>
|
||||
<input type="text" id="slug" name="slug" value="{{ rows.slug }}" required>
|
||||
|
||||
<button type="submit">Save Changes</button>
|
||||
</form>
|
||||
<label for="path">Path:</label>
|
||||
<input type="text" id="path" name="path" value="{{ rows.path }}">
|
||||
|
||||
<label for="intro">Intro:</label>
|
||||
<textarea id="intro" name="intro" rows="5">{{ rows.intro }}</textarea>
|
||||
|
||||
<label for="body">Body:</label>
|
||||
<textarea id="body" name="body" rows="10">{{ rows.body }}</textarea>
|
||||
|
||||
<label for="notes">Notes:</label>
|
||||
<textarea id="notes" name="notes" rows="5">{{ rows.notes }}</textarea>
|
||||
|
||||
<label for="draft">
|
||||
<input type="checkbox" id="draft" name="draft" value="1" {% if rows.draft %}checked{% endif %}>
|
||||
Save as Draft
|
||||
</label>
|
||||
|
||||
<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>
|
||||
|
||||
<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">
|
||||
|
||||
<p><strong>Created:</strong> {{ rows.created|date("Y-m-d H:i:s") }}</p>
|
||||
<p><strong>Last Updated:</strong> {{ rows.updated|date("Y-m-d H:i:s") }}</p>
|
||||
|
||||
<button type="submit">Save Changes</button>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
43
views/messages.html.twig
Normal file
43
views/messages.html.twig
Normal file
@@ -0,0 +1,43 @@
|
||||
{% extends '@novaconium/master.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{title}}</h1>
|
||||
<table class="messages-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Email</th>
|
||||
<th>Name</th>
|
||||
<th>Message Preview</th>
|
||||
<th>Created</th>
|
||||
<th>Status</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for msg in messages %}
|
||||
<tr class="{{ msg.unread ? 'unread' : 'read' }}">
|
||||
<td><a href="mailto:{{ msg.email }}">{{ msg.email }}</a></td>
|
||||
<td>{{ msg.name }}</td>
|
||||
<td>{{ msg.message }}</td>
|
||||
<td>{{ msg.created|date('Y-m-d H:i') }}</td>
|
||||
<td>
|
||||
{% if msg.unread %}
|
||||
<strong>Unread</strong>
|
||||
{% else %}
|
||||
Read
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a href="/novaconium/messages/edit/{{ msg.id }}" class="btn btn-edit">Edit</a>
|
||||
<a href="/novaconium/messages/delete/{{ msg.id }}">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="7" style="text-align:center;">No messages found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% endblock %}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
{% block content %}
|
||||
<h1>{{title}}</h1>
|
||||
<p><a href="/novaconium/page/create">Create Page</a></p>
|
||||
<table class="pages-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user