From e1a01d356988d596b257d11a5aa4cd979ce535bb Mon Sep 17 00:00:00 2001 From: Abhirup Pal Date: Thu, 8 Apr 2021 18:06:47 +0530 Subject: [PATCH 1/3] logo: Update logo to use a full image with text. --- assets/img/zulip.svg | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/assets/img/zulip.svg b/assets/img/zulip.svg index 5bef7d9a29bd15..440ebb78884c69 100644 --- a/assets/img/zulip.svg +++ b/assets/img/zulip.svg @@ -1,10 +1,18 @@ - + + + + + + From 16b1dce5e36657486eba017364929b3c2e7ae73c Mon Sep 17 00:00:00 2001 From: Abhirup Pal Date: Thu, 8 Apr 2021 18:07:35 +0530 Subject: [PATCH 2/3] ui: Add logo as homepage link. The logo is removed from the previous position besides each chat. It is placed at the top left corner serving as the link to the homepage. Fixes #53. --- lib/html.py | 35 +++++++++++++---------------------- lib/jekyll.py | 12 ++++++++---- style.css | 5 +++++ 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/lib/html.py b/lib/html.py index ab39575bdc4899..32e70558c42157 100644 --- a/lib/html.py +++ b/lib/html.py @@ -58,9 +58,8 @@ def format_message( ): msg_id = str(msg['id']) - zulip_link = link_to_zulip( + post_link = zulip_post_url( zulip_url, - zulip_icon_url, stream_id, stream_name, topic_name, @@ -80,32 +79,24 @@ def format_message( anchor = ''.format(msg_id) html = f''' {anchor} -

{zulip_link} {user_name} ({date}):

+

+ {user_name} + ({date} + | Archive): +

{msg_content} ''' return html - -def link_to_zulip( - zulip_url, - zulip_icon_url, - stream_id, - stream_name, - topic_name, - msg_id, - ): - # format a link to the original post where you click on the Zulip icon - # (if it's available) - post_link = zulip_post_url(zulip_url, stream_id, stream_name, topic_name, msg_id) - if zulip_icon_url: - img_tag = f'view this post on Zulip' - else: - img_tag = '' - zulip_link = f'{img_tag}' - return zulip_link - def last_updated_footer(stream_info): last_updated = format_date1(stream_info['time']) date_footer = f'\n

Last updated: {last_updated} UTC

' return date_footer +def homepage_link(site_url, zulip_icon_url): + if zulip_icon_url: + img_tag = f'homepage' + else: + img_tag = '' + homepage_url = f'{img_tag}' + return homepage_url diff --git a/lib/jekyll.py b/lib/jekyll.py index 52909a72df931c..a3a1bbd36cc551 100644 --- a/lib/jekyll.py +++ b/lib/jekyll.py @@ -40,6 +40,7 @@ from .html import ( format_message, + homepage_link, last_updated_footer, topic_page_links, ) @@ -58,7 +59,7 @@ def build_website(json_root, md_root, site_url, html_root, title, zulip_url, zul streams = stream_info['streams'] date_footer = last_updated_footer(stream_info) - write_main_page(md_root, site_url, html_root, title, streams, date_footer) + write_main_page(md_root, site_url, html_root, title, streams, date_footer, zulip_icon_url) write_css(md_root) for stream_name in streams: @@ -74,6 +75,7 @@ def build_website(json_root, md_root, site_url, html_root, title, zulip_url, zul stream_name, stream_data, date_footer, + zulip_icon_url ) for topic_name in topic_data: @@ -94,7 +96,7 @@ def build_website(json_root, md_root, site_url, html_root, title, zulip_url, zul # writes the index page listing all streams. # `streams`: a dict mapping stream names to stream json objects as described in the header. -def write_main_page(md_root, site_url, html_root, title, streams, date_footer): +def write_main_page(md_root, site_url, html_root, title, streams, date_footer, zulip_icon_url): ''' The main page in our website lists streams: @@ -108,12 +110,12 @@ def write_main_page(md_root, site_url, html_root, title, streams, date_footer): write_main_page_header(outfile, html_root, title) content = stream_list_page(streams) - + outfile.write(f'\n{homepage_link(site_url, zulip_icon_url)}\n') outfile.write(content) outfile.write(date_footer) outfile.close() -def write_stream_topics(md_root, site_url, html_root, title, stream_name, stream, date_footer): +def write_stream_topics(md_root, site_url, html_root, title, stream_name, stream, date_footer, zulip_icon_url): ''' A stream page lists all topics for the stream: @@ -135,6 +137,7 @@ def write_stream_topics(md_root, site_url, html_root, title, stream_name, stream content = topic_list_page(stream_name, stream_url, topic_data) + outfile.write(f'\n{homepage_link(site_url, zulip_icon_url)}\n') outfile.write(content) outfile.write(date_footer) outfile.close() @@ -203,6 +206,7 @@ def write_topic_messages( topic_name, ) + outfile.write(f'\n{homepage_link(site_url, zulip_icon_url)}\n') outfile.write(topic_links) outfile.write(f'\n\n') diff --git a/style.css b/style.css index 4d34676ea21ab0..5f08f0158df349 100644 --- a/style.css +++ b/style.css @@ -1 +1,6 @@ .msg { margin-left: 2em; } + +.archive-link-color{ + color: grey; + text-decoration: none; +} From b311686f46f64c40c7c43cba8bec477d45e0ab6d Mon Sep 17 00:00:00 2001 From: Abhirup Pal Date: Fri, 9 Apr 2021 19:21:38 +0530 Subject: [PATCH 3/3] ui: Update stream topic view in messages page. --- lib/html.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/html.py b/lib/html.py index 32e70558c42157..4c2eb693f1783f 100644 --- a/lib/html.py +++ b/lib/html.py @@ -38,8 +38,11 @@ def topic_page_links( topic_url = archive_topic_url(site_url, html_root, sanitized_stream_name, sanitized_topic_name) return f'''\ -

Stream: {stream_name}

-

Topic: {topic_name}

+

+ {stream_name} + > + {topic_name} +