comparison examples/blog/src/index.html.luan @ 1217:4c2972f4d862

.html in examples
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 20 Mar 2018 15:43:16 -0600
parents 5dbb552075ff
children bc40bc9aab3a
comparison
equal deleted inserted replaced
1216:5dbb552075ff 1217:4c2972f4d862
29 <form> 29 <form>
30 <input name=query type=text value="<%= query or "" %>"> 30 <input name=query type=text value="<%= query or "" %>">
31 <input type=submit value=Search> 31 <input type=submit value=Search>
32 </form> 32 </form>
33 33
34 <div><a href="new">Make New Post</a></div> 34 <div><a href="new.html">Make New Post</a></div>
35 35
36 <% 36 <%
37 local posts = query and Post.search(query) or Post.get_all() 37 local posts = query and Post.search(query) or Post.get_all()
38 for _, post in ipairs(posts) do 38 for _, post in ipairs(posts) do
39 %> 39 %>
40 <a name="p<%= post.id %>"> 40 <a name="p<%= post.id %>">
41 <h2><%= post.subject %></h2> 41 <h2><%= post.subject %></h2>
42 <p><%= Time.format(post.date) %> - <a href="edit?post=<%= post.id %>">Edit</a></p> 42 <p><%= Time.format(post.date) %> - <a href="edit.html?post=<%= post.id %>">Edit</a></p>
43 <pre><%= bbcode_to_html(html_encode(post.content)) %></pre> 43 <pre><%= bbcode_to_html(html_encode(post.content)) %></pre>
44 <hr> 44 <hr>
45 <% 45 <%
46 end 46 end
47 %> 47 %>