comparison mod_http_muc_log/mod_http_muc_log.lua @ 3690:8c0a6d4541d5

mod_http_muc_log: Wrap navigation in unorderded lists (thanks jonas’)
author Kim Alvefur <zash@zash.se>
date Mon, 30 Sep 2019 00:27:25 +0200
parents da7ec4ed6ddf
children 96c6d9b0969f
comparison
equal deleted inserted replaced
3689:65e94270c413 3690:8c0a6d4541d5
357 prev_when = datetime.date(prev_when); 357 prev_when = datetime.date(prev_when);
358 module:log("debug", "Previous message: %s", prev_when); 358 module:log("debug", "Previous message: %s", prev_when);
359 end 359 end
360 end 360 end
361 361
362 local links = {
363 { href = "./", rel = "up", text = "Calendar" },
364 };
365 if prev_when ~= "" then
366 table.insert(links, { href = prev_when, rel = "prev", text = prev_when});
367 end
368 if next_when ~= "" then
369 table.insert(links, { href = next_when, rel = "next", text = next_when});
370 end
371
362 response.headers.content_type = "text/html; charset=utf-8"; 372 response.headers.content_type = "text/html; charset=utf-8";
363 return render(template, { 373 return render(template, {
364 title = ("%s - %s"):format(get_room(room):get_name(), date); 374 title = ("%s - %s"):format(get_room(room):get_name(), date);
365 jid = get_room(room).jid; 375 jid = get_room(room).jid;
366 hide_presence = hide_presence(request); 376 hide_presence = hide_presence(request);
367 presence_available = presence_logged; 377 presence_available = presence_logged;
368 lines = logs; 378 lines = logs;
369 links = { 379 links = links;
370 { href = "./", rel = "up", text = "Calendar" },
371 { href = prev_when, rel = "prev", text = prev_when},
372 { href = next_when, rel = "next", text = next_when},
373 };
374 }); 380 });
375 end 381 end
376 382
377 local function list_rooms(event) 383 local function list_rooms(event)
378 local request, response = event.request, event.response; 384 local request, response = event.request, event.response;