add topics

This commit is contained in:
2025-05-18 15:56:29 +03:00
parent 86b568d0f4
commit f5485702a8
11 changed files with 250 additions and 10 deletions

16
views/topics/topics.etlua Normal file
View File

@ -0,0 +1,16 @@
<h1>Topics</h1>
<% if #topic_list == 0 then %>
<p>There are no topics.</p>
<% else %>
<ul>
<% for i, v in ipairs(topic_list) do %>
<li>
<a href=<%= v.slug %>><%= v.name %></a> - <%= v.description %>
</li>
<% end %>
<% end %>
</ul>
<% if user:is_admin() then %>
<a href="<%= url_for("topic_create") %>">Create new topic</a>
<% end %>