posts: add links to source to kiwi arxiv

This commit is contained in:
E. S. 2024-03-15 23:38:59 +00:00
parent a65b54ac5f
commit 3e3c14ce59
3 changed files with 5 additions and 5 deletions

View File

@ -112,6 +112,7 @@ class MainHandler extends request_handler {
render('main/post', render('main/post',
title: $pt->title, title: $pt->title,
id: $post->id, id: $post->id,
source_url: $post->sourceUrl,
unsafe_html: $pt->getHtml(is_retina(), getUserTheme()), unsafe_html: $pt->getHtml(is_retina(), getUserTheme()),
unsafe_toc_html: $pt->getTableOfContentsHtml(), unsafe_toc_html: $pt->getTableOfContentsHtml(),
date: $post->getFullDate(), date: $post->getFullDate(),

View File

@ -17,6 +17,7 @@ class Post extends model {
public string $date; public string $date;
public bool $visible; public bool $visible;
public string $shortName; public string $shortName;
public string $sourceUrl;
protected array $texts = []; protected array $texts = [];

View File

@ -135,9 +135,6 @@ function articles_right_link($ctx, $url, string $label, int $index) {
function page($ctx, $page_url, $short_name, $unsafe_html) { function page($ctx, $page_url, $short_name, $unsafe_html) {
$html = <<<HTML $html = <<<HTML
<div class="page"> <div class="page">
<!--<div class="blog-post-title-nav">
<a href="/">{$ctx->lang('index')}</a> <span>&rsaquo;</span>
</div>-->
{$ctx->if_admin($ctx->page_admin_links, $page_url, $short_name)} {$ctx->if_admin($ctx->page_admin_links, $page_url, $short_name)}
<div class="blog-post-text">{$unsafe_html}</div> <div class="blog-post-text">{$unsafe_html}</div>
</div> </div>
@ -160,7 +157,7 @@ HTML;
// post page // post page
// --------- // ---------
function post($ctx, $id, $title, $unsafe_html, $unsafe_toc_html, $date, $visible, $url, string $lang, $other_langs) { function post($ctx, $id, $title, $unsafe_html, $unsafe_toc_html, $date, $visible, $url, string $lang, $other_langs, string $source_url) {
$html = <<<HTML $html = <<<HTML
<div class="blog-post-wrap2"> <div class="blog-post-wrap2">
<div class="blog-post-wrap1"> <div class="blog-post-wrap1">
@ -173,7 +170,8 @@ $html = <<<HTML
<div class="blog-post-date"> <div class="blog-post-date">
{$ctx->if_not($visible, $ctx->lang('blog_post_hidden').' |')} {$ctx->if_not($visible, $ctx->lang('blog_post_hidden').' |')}
{$date} {$date}
{$ctx->if_true($other_langs, $ctx->post_other_langs($url, $other_langs))} {$ctx->if_true($other_langs, fn() => $ctx->post_other_langs($url, $other_langs))}
{$ctx->if_true($source_url, fn() => ' | <a href="'.$source_url.'">Source at kiwiarxiv</a>')}
{$ctx->if_admin($ctx->post_admin_links, $url, $id, $lang)} {$ctx->if_admin($ctx->post_admin_links, $url, $id, $lang)}
</div> </div>
</div> </div>