Files
FreshRSS/app/layout/layout.phtml
proletarius101 d3be01a1da Add pwa (#3890)
* Don't use Chrome or indeed Firefox on Android

Would close #1963. But I will not finish this PR because the idea that every single website on the internet should have to do this is absolutely ridiculous.

* add pwa manifest

Add a pwa manifest as defined in https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Installable_PWAs
- creates shortcuts without the browser frame
- has a splash screen
- has an independent view stack than the browser one

* update manifest as per pwabuilder.com

* add 32x32 and 48x48 icon config

* enhance manifest spec compliance

* change as per suggestions

* Update app/layout/layout.phtml

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>

* fix mobile icon padding

* remove screen auto rotation

* change theme color to white

* Move meta
(Should not be in the referrer condition)

* JSON HTTP cache

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2021-10-24 17:28:40 +02:00

90 lines
3.1 KiB
PHTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php FreshRSS::preLayout(); ?>
<!DOCTYPE html>
<html lang="<?= FreshRSS_Context::$user_conf->language ?>" xml:lang="<?= FreshRSS_Context::$user_conf->language ?>"<?php
if (_t('gen.dir') === 'rtl') {
echo ' dir="rtl" class="rtl"';
}
?>>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="initial-scale=1.0" />
<?= self::headStyle() ?>
<script id="jsonVars" type="application/json">
<?php $this->renderHelper('javascript_vars'); ?>
</script>
<?= self::headScript() ?>
<link rel="manifest" href="<?= Minz_Url::display('/themes/manifest.json') ?>" />
<link rel="shortcut icon" id="favicon" type="image/x-icon" sizes="16x16 64x64" href="<?= Minz_Url::display('/favicon.ico') ?>" />
<link rel="icon msapplication-TileImage apple-touch-icon" type="image/png" sizes="256x256" href="<?= Minz_Url::display('/themes/icons/favicon-256.png') ?>" />
<link rel="apple-touch-icon" href="<?= Minz_Url::display('/themes/icons/apple-touch-icon.png') ?>" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-title" content="<?= FreshRSS_Context::$system_conf->title ?>">
<meta name="msapplication-TileColor" content="#FFF" />
<meta name="theme-color" content="#FFF" />
<?php if (!FreshRSS_Context::$system_conf->allow_referrer) { ?>
<meta name="referrer" content="never" />
<?php } ?>
<?= self::headTitle() ?>
<?php
$url_base = Minz_Request::currentRequest();
if (isset($this->rss_title)) {
$url_rss = $url_base;
$url_rss['a'] = 'rss';
if (FreshRSS_Context::$user_conf->since_hours_posts_per_rss) {
$url_rss['params']['hours'] = FreshRSS_Context::$user_conf->since_hours_posts_per_rss;
}
?>
<link rel="alternate" type="application/rss+xml" title="<?= $this->rss_title ?>" href="<?= Minz_Url::display($url_rss) ?>" />
<?php } if (FreshRSS_Context::$system_conf->allow_robots) { ?>
<meta name="description" content="<?= htmlspecialchars(FreshRSS_Context::$name . ' | ' . FreshRSS_Context::$description, ENT_COMPAT, 'UTF-8') ?>" />
<?php } else { ?>
<meta name="robots" content="noindex,nofollow" />
<?php } ?>
</head>
<body class="<?= Minz_Request::actionName() ?>">
<?php
flush();
$this->partial('header');
?>
<main id="global">
<?php
flush();
if (isset($this->callbackBeforeFeeds)) {
call_user_func($this->callbackBeforeFeeds, $this);
}
$this->render();
?>
</main>
<?php
$msg = '';
$status = 'closed';
if (isset($this->notification)) {
$msg = $this->notification['content'];
$status = $this->notification['type'];
invalidateHttpCache();
}
?>
<div id="notification" class="notification <?= $status ?>">
<span class="msg"><?= $msg ?></span>
<a class="close" href=""><?= _i('close') ?></a>
</div>
<!-- Popup-->
<div id="popup">
<div id="popup-content">
<div id="popup-close" class="popup-row">×</div>
<div id="popup-txt" class="popup-row"></div>
<div id="popup-iframe-container" class="popup-row">
<div id="popup-iframe-sub">
<iframe id="popup-iframe" frameborder="0"></iframe>
</div>
</div>
</div>
</div>
</body>
</html>