add markup to thread create and topic edit

This commit is contained in:
Lera Elvoé 2025-05-21 19:57:08 +03:00
parent f5ba312032
commit f18e31811c
Signed by: yagich
SSH Key Fingerprint: SHA256:6xjGb6uA7lAVcULa7byPEN//rQ0wPoG+UzYVMfZnbvc
5 changed files with 55 additions and 29 deletions

View File

@ -252,13 +252,18 @@ p {
padding: 20px 0; padding: 20px 0;
} }
input[type="text"], input[type="password"] { input[type="text"], input[type="password"], textarea, select {
border: 1px solid black; border: 1px solid black;
border-radius: 3px; border-radius: 3px;
padding: 7px 10px; padding: 7px 10px;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
background-color: $lighter; resize: vertical;
background-color: color.scale($accent_color, $lightness: 40%);
&:focus {
background-color: color.scale($accent_color, $lightness: 60%);
}
} }
.infobox { .infobox {

View File

@ -244,13 +244,17 @@ p {
padding: 20px 0; padding: 20px 0;
} }
input[type=text], input[type=password] { input[type=text], input[type=password], textarea, select {
border: 1px solid black; border: 1px solid black;
border-radius: 3px; border-radius: 3px;
padding: 7px 10px; padding: 7px 10px;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
background-color: rgb(229.84, 231.92, 227.28); resize: vertical;
background-color: rgb(217.8, 225.6, 208.2);
}
input[type=text]:focus, input[type=password]:focus, textarea:focus, select:focus {
background-color: rgb(230.2, 235.4, 223.8);
} }
.infobox { .infobox {

View File

@ -0,0 +1,11 @@
<details>
<summary>Supported babycode tags</summary>
<ul>
<li>[b]<b>bold</b>[/b]</li>
<li>[i]<i>italic</i>[/i]</li>
<li>[s]<del>strikethrough</del>[/s]</li>
<li>[url=https://example.com]<a href="https://example.com">labeled URL</a>[/url]</li>
<li>[url]<a href="https://unlabeled-url.example.com">https://unlabeled-url.example.com</a>[/url]</li>
<li>[code]<code>code block</code>[/code]</li>
</ul>
</details>

View File

@ -1,13 +1,18 @@
<h1>New thread</h1> <% render("views.common.topnav") -%>
<form method="post"> <div class="darkbg settings-container">
<label for="topic_id">Topic:</label> <h1>New thread</h1>
<select name="topic_id", id="topic_id" autocomplete="off"> <form method="post">
<% for _, topic in ipairs(all_topics) do %> <label for="topic_id">Topic</label>
<option value="<%= topic.id %>" <%- params.topic_id == tostring(topic.id) and "selected" or "" %>><%= topic.name %></value> <select name="topic_id", id="topic_id" autocomplete="off">
<% end %> <% for _, topic in ipairs(all_topics) do %>
</select><br> <option value="<%= topic.id %>" <%- params.topic_id == tostring(topic.id) and "selected" or "" %>><%= topic.name %></value>
<label for="title">Thread title:</label> <% end %>
<input type="text" id="title" name="title" required><br> </select><br>
<textarea id="initial_post" name="initial_post" placeholder="Post body" required></textarea><br> <label for="title">Thread title</label>
<input type="submit" value="Create thread"> <input type="text" id="title" name="title" placeholder="Required" required>
</form> <label for="initial_post">Post body</label>
<textarea id="initial_post" name="initial_post" placeholder="Required" rows=5 required></textarea>
<% render "views.common.bbcode_help" %>
<input type="submit" value="Create thread">
</form>
</div>

View File

@ -1,12 +1,13 @@
<h1>Editing topic <%= topic.name %></h1> <% render("views.common.topnav") -%>
<form method="post"> <div class="darkbg settings-container">
<input type="text" name="name" id="name" value="<%= topic.name %>" placeholder="Topic name" required><br> <h1>Editing topic <%= topic.name %></h1>
<textarea id="description" name="description" value="<%= topic.description %>" placeholder="Topic description"></textarea><br> <form method="post">
<input type="checkbox" id="is_locked" name="is_locked" value="<%= ntob(topic.is_locked) %>"> <label for=name>Name</label>
<label for="is_locked">Locked</label><br> <input type="text" name="name" id="name" value="<%= topic.name %>" placeholder="Topic name" required>
<input type="submit" value="Save changes"> <label for=description>Description</label>
</form> <textarea id="description" name="description" placeholder="Topic description" rows=4><%= topic.description %></textarea>
<form method="get" action="<%= url_for("topic", {slug = topic.slug}) %>"> <input type="submit" value="Save changes">
<input type="submit" value="Cancel"> <a class="linkbutton" href="<%= url_for("topic", {slug = topic.slug}) %>">Cancel</a><br>
</form> <i>Note: to preserve history, you cannot change the topic URL.</i>
<i>Note: to preserve history, you cannot change the topic URL.</i> </form>
</div>