diff --git a/irclog.py b/irclog.py
index 5c51b8a..4062399 100644
--- a/irclog.py
+++ b/irclog.py
@@ -817,6 +817,10 @@ class WebServer:
'tr.command_NICK, tr.command_ACCOUNT, tr.command_MODE, tr.command_TOPIC, tr.command_TOPICWHO, tr.command_WHOX { color: grey; }',
'tr.command_NOTICE td:nth-child(3) { font-style: italic; }',
]) + ''
+ generalStyleTag = ''
def __init__(self, config):
self.config = config
@@ -889,11 +893,23 @@ class WebServer:
async def get_channel_info(self, request):
self.logger.info(f'Received request {id(request)} from {request.remote!r} for {request.path!r}')
+ description = html.escape(self._paths[request.match_info["path"]][4]) if self._paths[request.match_info["path"]][4] else '(not available)'
return aiohttp.web.Response(
text = ''.join([
'',
- f'
{html.escape(self._paths[request.match_info["path"]][0])}',
- f'{html.escape(self._paths[request.match_info["path"]][4] or "")}',
+ f'{html.escape(self._paths[request.match_info["path"]][0])}{self.generalStyleTag}',
+ '',
+ '',
+ 'Home',
+ f'Today's log',
+ f'Search',
+ '
',
+ '
',
+ '',
+ f'Channel: {html.escape(self._paths[request.match_info["path"]][0])}
',
+ f'Description: {description}',
+ '
',
+ '',
''
]),
content_type = 'text/html'
@@ -965,24 +981,25 @@ class WebServer:
date = datetime.datetime.strptime(request.match_info['date'], '%Y-%m-%d').replace(tzinfo = datetime.timezone.utc)
dateStart = date.timestamp()
dateEnd = (date + datetime.timedelta(days = 1)).timestamp()
- channelLinks = ' '.join([
+ channelLinks = '' + ''.join([
+ 'Home',
f'Search',
f'Previous day',
f'Next day',
- ])
+ ]) + '
'
#TODO Implement this in a better way...
fn = date.strftime('%Y-%m.log')
lines = list(self._raw_to_lines(self._file_iter_with_path(os.path.join(self.config['storage']['path'], request.match_info["path"], fn), request.match_info["path"]), filter = lambda path, ts, command, content: dateStart <= ts <= dateEnd))
return aiohttp.web.Response(
text = ''.join([
'',
- f'{html.escape(self._paths[request.match_info["path"]][0])} log for {date:%Y-%m-%d}{self.logStyleTag}',
+ f'{html.escape(self._paths[request.match_info["path"]][0])} log for {date:%Y-%m-%d}{self.generalStyleTag}{self.logStyleTag}',
'',
- f'{channelLinks}
',
+ channelLinks,
'
',
self._render_log(lines),
'
',
- f'{channelLinks}
',
+ channelLinks,
'',
'',
]),
@@ -995,6 +1012,12 @@ class WebServer:
if self._paths[request.match_info['path']][2]: # Hidden channels aren't searchable
return aiohttp.web.HTTPNotFound()
+ linkBar = ''.join([
+ '',
+ 'Home',
+ f'Today's log',
+ '
',
+ ])
searchForm = ''.join([
'