Initial progress on styling
This commit is contained in:
parent
c650c27825
commit
2c44a69ec3
38 changed files with 748 additions and 412 deletions
46
templates/fragments/edit_post_details.html
Normal file
46
templates/fragments/edit_post_details.html
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<form hx-put="/post_details/{{ post.id }}" hx-target="this" hx-swap="outerHTML">
|
||||
<div>
|
||||
<label>Tags</label>
|
||||
{% let tags_value = tags %} {% include "fragments/tags_input.html" %}
|
||||
<ul class="tags-autocomplete" id="search-autocomplete"></ul>
|
||||
</div>
|
||||
<div>
|
||||
<label>Title</label>
|
||||
<input name="title" type="text" maxlength="100" placeholder="Title" value="{% if let Some(title) = post.title %}{{ title }}{% endif %}" />
|
||||
</div>
|
||||
<div>
|
||||
<label>Description</label>
|
||||
<textarea name="description" placeholder="Description in Markdown">{% if let Some(description) = post.description %}{{ description }}{% endif %}</textarea>
|
||||
</div>
|
||||
<div>
|
||||
<label>Is public post?</label>
|
||||
<input name="is_public" type="checkbox" {% if post.is_public %}checked{% endif %} value="true" />
|
||||
</div>
|
||||
<div>
|
||||
<label>Rating</label>
|
||||
<select name="rating">
|
||||
<option value="u" {% if post.rating == "u" %}selected{% endif %}>Unrated</option>
|
||||
<option value="s" {% if post.rating == "s" %}selected{% endif %}>Safe</option>
|
||||
<option value="q" {% if post.rating == "q" %}selected{% endif %}>Questionable</option>
|
||||
<option value="e" {% if post.rating == "e" %}selected{% endif %}>Explicit</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label>Source(s)</label>
|
||||
<ul id="sources">
|
||||
{% for source in sources %}
|
||||
{% include "fragments/post_source.html" %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<button hx-post="/post_source" hx-target="#sources" hx-swap="beforeend">+</button>
|
||||
</div>
|
||||
<div>
|
||||
<label>Parent post</label>
|
||||
<input name="parent_post" type="text" pattern="[0-9]*" value="{% if let Some(parent_id) = post.parent_id %}{{ parent_id }}{% endif %}" />
|
||||
</div>
|
||||
<div>
|
||||
<button>Submit</button>
|
||||
<button hx-get="/post_details/{{ post.id }}">Cancel</button>
|
||||
<button hx-confirm="Are you sure that you want to delete this post? This can't be undone!" hx-delete="/post/{{ post.id }}" hx-target="body" hx-replace-url="/">Delete post</button>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue