Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions apps/entries/templates/entries/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
{% block title %}{% if object %}Edit Entry{% else %}New Entry{% endif %} — SCD Reporting{% endblock %}

{% block content %}
<div class="max-w-2xl">
<div class="lg:flex lg:gap-8 lg:items-start">
<div class="max-w-2xl w-full min-w-0">

<div class="mb-4">
<a href="{% if object %}{% url 'entries:detail' object.pk %}{% else %}{% url 'entries:list' %}{% endif %}"
Expand Down Expand Up @@ -331,7 +332,14 @@ <h1 class="text-2xl font-bold text-slate-900 mt-1">
</div>

</form>
</div>
</div>{# end left column #}

{# ── Markdown cheat sheet (right side panel) ──────────────────────────────── #}
<aside class="hidden lg:block w-72 shrink-0 lg:sticky lg:top-8">
{% include "entries/partials/_markdown_cheatsheet.html" %}
</aside>

</div>{# end two-column wrapper #}

{{ entry_templates|default:"[]"|json_script:"entry-templates-data" }}
<script>
Expand Down
65 changes: 65 additions & 0 deletions apps/entries/templates/entries/partials/_markdown_cheatsheet.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{% comment %}
Markdown quick-reference shown beside the entry form.
Keep rows in sync with apps/core/markdown.py (render_markdown):
fenced_code + tables, headings h1-h3, no images.
{% endcomment %}
<div class="bg-white rounded-lg border border-slate-200 shadow-sm overflow-hidden">

<div class="px-4 py-3 border-b border-slate-100 bg-slate-50">
<h2 class="text-sm font-semibold text-slate-700">Markdown cheat sheet</h2>
<p class="mt-0.5 text-xs text-slate-400">Formatting you can use in the description.</p>
</div>

<dl class="divide-y divide-slate-100">
<div class="px-4 py-2 flex items-center justify-between gap-3">
<dt class="text-xs text-slate-500 shrink-0">Bold</dt>
<dd class="font-mono text-xs text-slate-700 bg-slate-50 rounded px-1.5 py-0.5">**text**</dd>
</div>
<div class="px-4 py-2 flex items-center justify-between gap-3">
<dt class="text-xs text-slate-500 shrink-0">Italic</dt>
<dd class="font-mono text-xs text-slate-700 bg-slate-50 rounded px-1.5 py-0.5">*text*</dd>
</div>
<div class="px-4 py-2 flex items-center justify-between gap-3">
<dt class="text-xs text-slate-500 shrink-0">Headings</dt>
<dd class="font-mono text-xs text-slate-700 bg-slate-50 rounded px-1.5 py-0.5"># H1 · ## H2 · ### H3</dd>
</div>
<div class="px-4 py-2 flex items-center justify-between gap-3">
<dt class="text-xs text-slate-500 shrink-0">Link</dt>
<dd class="font-mono text-xs text-slate-700 bg-slate-50 rounded px-1.5 py-0.5">[text](https://…)</dd>
</div>
<div class="px-4 py-2 flex items-center justify-between gap-3">
<dt class="text-xs text-slate-500 shrink-0">Bullet list</dt>
<dd class="font-mono text-xs text-slate-700 bg-slate-50 rounded px-1.5 py-0.5">- item</dd>
</div>
<div class="px-4 py-2 flex items-center justify-between gap-3">
<dt class="text-xs text-slate-500 shrink-0">Numbered list</dt>
<dd class="font-mono text-xs text-slate-700 bg-slate-50 rounded px-1.5 py-0.5">1. item</dd>
</div>
<div class="px-4 py-2 flex items-center justify-between gap-3">
<dt class="text-xs text-slate-500 shrink-0">Quote</dt>
<dd class="font-mono text-xs text-slate-700 bg-slate-50 rounded px-1.5 py-0.5">&gt; quoted text</dd>
</div>
<div class="px-4 py-2 flex items-center justify-between gap-3">
<dt class="text-xs text-slate-500 shrink-0">Inline code</dt>
<dd class="font-mono text-xs text-slate-700 bg-slate-50 rounded px-1.5 py-0.5">`code`</dd>
</div>
<div class="px-4 py-2 flex items-start justify-between gap-3">
<dt class="text-xs text-slate-500 shrink-0">Code block</dt>
<dd class="font-mono text-xs text-slate-700 bg-slate-50 rounded px-1.5 py-0.5 whitespace-pre leading-tight">```
code
```</dd>
Comment on lines +48 to +50
</div>
<div class="px-4 py-2 flex items-center justify-between gap-3">
<dt class="text-xs text-slate-500 shrink-0">Table</dt>
<dd class="font-mono text-xs text-slate-700 bg-slate-50 rounded px-1.5 py-0.5">| a | b |</dd>
</div>
<div class="px-4 py-2 flex items-center justify-between gap-3">
<dt class="text-xs text-slate-500 shrink-0">Divider</dt>
<dd class="font-mono text-xs text-slate-700 bg-slate-50 rounded px-1.5 py-0.5">---</dd>
</div>
</dl>

<div class="px-4 py-2.5 border-t border-slate-100 bg-slate-50 text-xs text-slate-400">
Click <span class="font-medium text-slate-500">Preview markdown</span> to check formatting.
</div>
</div>