Mercurial Hosting > chat
comparison src/lib/Shared.luan @ 22:949914955bfe
add menu
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Tue, 05 Nov 2024 14:29:16 -0700 |
| parents | 435f474f07c7 |
| children | c54c806fcc6e |
comparison
equal
deleted
inserted
replaced
| 21:5a56297713a3 | 22:949914955bfe |
|---|---|
| 90 send_mail(mail) | 90 send_mail(mail) |
| 91 end ) | 91 end ) |
| 92 end | 92 end |
| 93 | 93 |
| 94 function Shared.post_html(post) | 94 function Shared.post_html(post) |
| 95 local author = get_user_by_id(post.author_id) | 95 local author_id = post.author_id |
| 96 local user = current_user() or error() | |
| 97 local mine = user.id == author_id | |
| 98 local author = get_user_by_id(author_id) | |
| 96 local id = post.id | 99 local id = post.id |
| 97 %> | 100 %> |
| 98 <div post="<%=id%>"> | 101 <div post="<%=id%>"> |
| 99 <div who> | 102 <div who> |
| 100 <span author><%=author.email%></span> | 103 <span author><%=author.email%></span> |
| 101 <span when fix><%=post.date%></span> | 104 <span when fix><%=post.date%></span> |
| 105 <% if mine then %> | |
| 106 <span pulldown> | |
| 107 <img onclick="clickMenu(this)" src="/images/more_vert.svg"> | |
| 108 <div> | |
| 109 <span>Edit</span> | |
| 110 <span>Delete</span> | |
| 111 </div> | |
| 112 <span> | |
| 113 <% end %> | |
| 102 </div> | 114 </div> |
| 103 <div text fix><%= html_encode(post.content) %></div> | 115 <div text fix><%= html_encode(post.content) %></div> |
| 104 </div> | 116 </div> |
| 105 <% | 117 <% |
| 106 end | 118 end |
