Mercurial Hosting > chat
comparison src/get_chat.js.luan @ 27:809193524522
responsive
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Wed, 06 Nov 2024 16:01:42 -0700 |
| parents | 9f45d32670ae |
| children | e2b7f6393dab |
comparison
equal
deleted
inserted
replaced
| 26:5bdbbd0a65e1 | 27:809193524522 |
|---|---|
| 11 local get_chat_by_id = Chat.get_by_id or error() | 11 local get_chat_by_id = Chat.get_by_id or error() |
| 12 local Post = require "site:/lib/Post.luan" | 12 local Post = require "site:/lib/Post.luan" |
| 13 local post_search = Post.search or error() | 13 local post_search = Post.search or error() |
| 14 local Shared = require "site:/lib/Shared.luan" | 14 local Shared = require "site:/lib/Shared.luan" |
| 15 local post_html = Shared.post_html or error() | 15 local post_html = Shared.post_html or error() |
| 16 local Logging = require "luan:logging/Logging.luan" | |
| 17 local logger = Logging.logger "get_chat.js" | |
| 16 | 18 |
| 17 | 19 |
| 18 local function html() | 20 local function html() |
| 19 local user = current_user() or error() | 21 local user = current_user() or error() |
| 20 local chat = Http.request.parameters.chat or error() | 22 local chat = Http.request.parameters.chat or error() |
| 21 chat = get_chat_by_id(chat) or error() | 23 chat = get_chat_by_id(chat) or error() |
| 22 local posts = post_search( "post_chat_id:"..chat.id, "id" ) | 24 local posts = post_search( "post_chat_id:"..chat.id, "id" ) |
| 23 %> | 25 %> |
| 24 <div top> | 26 <div top> |
| 25 <h3><%= chat.other_users_email(user) %></h3> | 27 <h3> |
| 28 <img back onclick="back()" src="/images/arrow_back.svg"> | |
| 29 <span><%= chat.other_users_email(user) %></span> | |
| 30 </h3> | |
| 26 <button onclick='deleteChat()'>delete</button> | 31 <button onclick='deleteChat()'>delete</button> |
| 27 </div> | 32 </div> |
| 28 <div main> | 33 <div main> |
| 29 <% | 34 <% |
| 30 for _, post in ipairs(posts) do | 35 for _, post in ipairs(posts) do |
