posts: add links to source to kiwi arxiv
This commit is contained in:
parent
a65b54ac5f
commit
3e3c14ce59
@ -112,6 +112,7 @@ class MainHandler extends request_handler {
|
||||
render('main/post',
|
||||
title: $pt->title,
|
||||
id: $post->id,
|
||||
source_url: $post->sourceUrl,
|
||||
unsafe_html: $pt->getHtml(is_retina(), getUserTheme()),
|
||||
unsafe_toc_html: $pt->getTableOfContentsHtml(),
|
||||
date: $post->getFullDate(),
|
||||
|
@ -17,6 +17,7 @@ class Post extends model {
|
||||
public string $date;
|
||||
public bool $visible;
|
||||
public string $shortName;
|
||||
public string $sourceUrl;
|
||||
|
||||
protected array $texts = [];
|
||||
|
||||
|
@ -135,9 +135,6 @@ function articles_right_link($ctx, $url, string $label, int $index) {
|
||||
function page($ctx, $page_url, $short_name, $unsafe_html) {
|
||||
$html = <<<HTML
|
||||
<div class="page">
|
||||
<!--<div class="blog-post-title-nav">
|
||||
<a href="/">{$ctx->lang('index')}</a> <span>›</span>
|
||||
</div>-->
|
||||
{$ctx->if_admin($ctx->page_admin_links, $page_url, $short_name)}
|
||||
<div class="blog-post-text">{$unsafe_html}</div>
|
||||
</div>
|
||||
@ -160,7 +157,7 @@ HTML;
|
||||
// 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
|
||||
<div class="blog-post-wrap2">
|
||||
<div class="blog-post-wrap1">
|
||||
@ -173,7 +170,8 @@ $html = <<<HTML
|
||||
<div class="blog-post-date">
|
||||
{$ctx->if_not($visible, $ctx->lang('blog_post_hidden').' |')}
|
||||
{$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)}
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user