Template
Populate the client website template with catalog feature flags.
Extract always-on public/portal/UTM plus optional email_sms, directmail, blog, payments, social, and social_ai so new client sites can be bootstrapped from this seed. Refs #1 Refs #2 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}{{ post.title }} · {{ SITE_NAME }}{% endblock %}
|
||||
{% block content %}
|
||||
<section class="section section-lg">
|
||||
<div class="container">
|
||||
<p><a href="{% url 'blog:list' %}">← Blog</a></p>
|
||||
<h1>{{ post.title }}</h1>
|
||||
<p class="muted">{% if post.published_at %}{{ post.published_at|date:"F j, Y" }}{% endif %}</p>
|
||||
<div>{{ post.body|linebreaks }}</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,18 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Blog · {{ SITE_NAME }}{% endblock %}
|
||||
{% block content %}
|
||||
<section class="section section-lg">
|
||||
<div class="container">
|
||||
<h1 class="text-uppercase">Blog</h1>
|
||||
{% for post in posts %}
|
||||
<article style="margin:0 0 32px">
|
||||
<h2><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h2>
|
||||
<p class="muted">{% if post.published_at %}{{ post.published_at|date:"F j, Y" }}{% endif %}</p>
|
||||
<p>{{ post.excerpt|default:post.body|truncatewords:40 }}</p>
|
||||
</article>
|
||||
{% empty %}
|
||||
<p>No posts yet.</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,20 @@
|
||||
{% extends "portal_base.html" %}
|
||||
{% block title %}{% if post %}Edit{% else %}New{% endif %} post · Portal{% endblock %}
|
||||
{% block topbar_title %}{% if post %}Edit post{% else %}New post{% endif %}{% endblock %}
|
||||
{% block portal_content %}
|
||||
<form method="post" class="form-grid">
|
||||
{% csrf_token %}
|
||||
<div class="field"><label>Title</label><input name="title" required value="{{ post.title|default:'' }}"></div>
|
||||
<div class="field"><label>Slug</label><input name="slug" value="{{ post.slug|default:'' }}" placeholder="auto from title"></div>
|
||||
<div class="field"><label>Excerpt</label><textarea name="excerpt" style="min-height:64px">{{ post.excerpt|default:'' }}</textarea></div>
|
||||
<div class="field"><label>Body</label><textarea name="body" required style="min-height:220px">{{ post.body|default:'' }}</textarea></div>
|
||||
<label><input type="checkbox" name="is_published" {% if post.is_published %}checked{% endif %}> Published</label>
|
||||
<button class="btn btn-primary" type="submit">Save</button>
|
||||
</form>
|
||||
{% if post %}
|
||||
<form method="post" action="{% url 'blog_portal:portal_delete' post.pk %}" style="margin-top:24px" onsubmit="return confirm('Delete this post?');">
|
||||
{% csrf_token %}
|
||||
<button class="btn btn-ghost" type="submit">Delete</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,20 @@
|
||||
{% extends "portal_base.html" %}
|
||||
{% block title %}Blog posts · Portal{% endblock %}
|
||||
{% block topbar_title %}Blog posts{% endblock %}
|
||||
{% block portal_content %}
|
||||
<p><a class="btn btn-primary" href="{% url 'blog_portal:portal_new' %}">New post</a></p>
|
||||
<table class="table">
|
||||
<thead><tr><th>Title</th><th>Status</th><th></th></tr></thead>
|
||||
<tbody>
|
||||
{% for post in posts %}
|
||||
<tr>
|
||||
<td><a href="{% url 'blog_portal:portal_edit' post.pk %}">{{ post.title }}</a></td>
|
||||
<td>{% if post.is_published %}Published{% else %}Draft{% endif %}</td>
|
||||
<td><a href="{{ post.get_absolute_url }}">View</a></td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr><td colspan="3" class="empty-state">No posts yet.</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user