Skip to main content

max / makenotwork

7.1 KB · 165 lines History Blame Raw
1 {% extends "base.html" %}
2
3 {% block title %}Settings — {{ community_name }} — Multithreaded{% endblock %}
4
5 {% block head %}<meta name="robots" content="noindex">{% endblock %}
6
7 {% block header %}{% include "partials/site_header.html" %}{% endblock %}
8
9 {% block content %}
10 <div class="container">
11 <div class="breadcrumb">
12 <a href="/">Forums</a>
13 <span class="sep">/</span>
14 <a href="/p/{{ community_slug }}">{{ community_name }}</a>
15 <span class="sep">/</span>
16 Settings
17 </div>
18 <h2 class="section-heading">Community Settings</h2>
19
20 <div class="settings-section">
21 <h3>Community Details</h3>
22 <div class="form-container">
23 <form method="post" action="/p/{{ community_slug }}/settings">
24 <div class="form-group">
25 <label for="name">Name</label>
26 <input type="text" id="name" name="name" value="{{ community_name }}" required>
27 </div>
28 <div class="form-group">
29 <label for="description">Description</label>
30 <textarea id="description" name="description" class="textarea-medium" maxlength="2048">{{ community_description.as_deref().unwrap_or("") }}</textarea>
31 </div>
32 <div class="form-group">
33 <label for="auto_hide_threshold">Auto-hide flag threshold</label>
34 <input type="number" id="auto_hide_threshold" name="auto_hide_threshold" min="0" step="1" value="{{ auto_hide_threshold.unwrap_or(0) }}" class="input-narrow">
35 <span class="form-help">Posts with this many flags are auto-hidden. 0 = disabled.</span>
36 </div>
37 <div class="form-actions">
38 <button type="submit" class="primary">Save</button>
39 </div>
40 </form>
41 </div>
42 </div>
43
44 <div class="settings-section">
45 <h3>Categories</h3>
46 {% if categories.is_empty() %}
47 <div class="empty-state">No categories yet.</div>
48 {% else %}
49 <table class="settings-table">
50 <thead>
51 <tr>
52 <th>Name</th>
53 <th>Slug</th>
54 <th>Order</th>
55 <th>Actions</th>
56 </tr>
57 </thead>
58 <tbody>
59 {% for cat in categories %}
60 <tr>
61 <td>
62 <span class="settings-cat-name">{{ cat.name }}</span>
63 {% if let Some(desc) = cat.description %}
64 <span class="settings-cat-desc">{{ desc }}</span>
65 {% endif %}
66 </td>
67 <td class="settings-mono">{{ cat.slug }}</td>
68 <td class="settings-mono">{{ cat.sort_order }}</td>
69 <td class="settings-actions">
70 <a href="/p/{{ community_slug }}/settings/categories/{{ cat.id }}/edit" class="post-action-link">edit</a>
71 {% if !cat.is_first %}
72 <form method="post" action="/p/{{ community_slug }}/settings/categories/{{ cat.id }}/move" class="form-inline">
73 <input type="hidden" name="direction" value="up">
74 <button type="submit" class="post-action-link">up</button>
75 </form>
76 {% endif %}
77 {% if !cat.is_last %}
78 <form method="post" action="/p/{{ community_slug }}/settings/categories/{{ cat.id }}/move" class="form-inline">
79 <input type="hidden" name="direction" value="down">
80 <button type="submit" class="post-action-link">down</button>
81 </form>
82 {% endif %}
83 </td>
84 </tr>
85 {% endfor %}
86 </tbody>
87 </table>
88 {% endif %}
89
90 <h3 class="section-heading-top">Add Category</h3>
91 <div class="form-container">
92 <form method="post" action="/p/{{ community_slug }}/settings/categories/new">
93 <div class="form-row">
94 <div class="form-group">
95 <label for="cat-name">Name</label>
96 <input type="text" id="cat-name" name="name" required>
97 </div>
98 <div class="form-group">
99 <label for="cat-slug">Slug</label>
100 <input type="text" id="cat-slug" name="slug" placeholder="lowercase-with-hyphens" required>
101 </div>
102 </div>
103 <div class="form-group">
104 <label for="cat-description">Description (optional)</label>
105 <textarea id="cat-description" name="description" class="textarea-short" maxlength="1024"></textarea>
106 </div>
107 <div class="form-actions">
108 <button type="submit" class="primary">Add Category</button>
109 </div>
110 </form>
111 </div>
112 </div>
113
114 <div class="settings-section">
115 <h3>Tags</h3>
116 {% if tags.is_empty() %}
117 <div class="empty-state">No tags yet.</div>
118 {% else %}
119 <table class="settings-table">
120 <thead>
121 <tr>
122 <th>Name</th>
123 <th>Slug</th>
124 <th>Actions</th>
125 </tr>
126 </thead>
127 <tbody>
128 {% for tag in tags %}
129 <tr>
130 <td>{{ tag.name }}</td>
131 <td class="settings-mono">{{ tag.slug }}</td>
132 <td class="settings-actions">
133 <form method="post" action="/p/{{ community_slug }}/settings/tags/delete" class="form-inline" onsubmit="return confirm('Delete this tag?')">
134 <input type="hidden" name="tag_id" value="{{ tag.id }}">
135 <button type="submit" class="post-action-link post-action-delete">delete</button>
136 </form>
137 </td>
138 </tr>
139 {% endfor %}
140 </tbody>
141 </table>
142 {% endif %}
143
144 <h3 class="section-heading-top">Add Tag</h3>
145 <div class="form-container">
146 <form method="post" action="/p/{{ community_slug }}/settings/tags/new">
147 <div class="form-row">
148 <div class="form-group">
149 <label for="tag-name">Name</label>
150 <input type="text" id="tag-name" name="name" required>
151 </div>
152 <div class="form-group">
153 <label for="tag-slug">Slug</label>
154 <input type="text" id="tag-slug" name="slug" placeholder="lowercase-with-hyphens" required>
155 </div>
156 </div>
157 <div class="form-actions">
158 <button type="submit" class="primary">Add Tag</button>
159 </div>
160 </form>
161 </div>
162 </div>
163 </div>
164 {% endblock %}
165