1
0
Fork 0
mirror of synced 2024-06-02 19:04:49 +12:00
appwrite/app/views/layouts/default.phtml

143 lines
6.1 KiB
PHTML
Raw Normal View History

2019-05-09 18:54:39 +12:00
<?php
use Utopia\Locale\Locale;
2019-08-24 19:30:12 +12:00
$protocol = $this->getParam('protocol', '');
2019-05-09 18:54:39 +12:00
$domain = $this->getParam('domain', '');
2020-01-26 18:15:20 +13:00
$platforms = $this->getParam('platforms', []);
2019-12-07 08:54:23 +13:00
$version = $this->getParam('version', '0.0.0');
2019-05-09 18:54:39 +12:00
$isDev = $this->getParam('isDev', false);
$litespeed = $this->getParam('litespeed', true);
$analytics = $this->getParam('analytics', 'UA-26264668-9');
$env = $this->getParam('env', '');
2019-08-31 11:09:23 +12:00
$canonical = $this->getParam('canonical', '');
2020-01-27 06:05:50 +13:00
if(!empty($platforms)) {
$platforms = array_map(function($platform) {
2020-02-09 07:52:59 +13:00
return [
'key' => $platform['key'],
'name' => $platform['name'],
2020-02-09 08:55:48 +13:00
'languages' => array_map(function($language) {
2020-02-09 07:52:59 +13:00
return [
'key' => $language['key'],
2020-02-09 18:17:34 +13:00
'name' => $language['name'] . (($language['beta']) ? ' (beta)' : ''),
2020-02-09 07:52:59 +13:00
];
2020-02-09 18:17:34 +13:00
}, array_filter($platform['languages'], function($node) {
return ($node['enabled']);
}))
2020-02-09 07:52:59 +13:00
];
2020-01-27 06:05:50 +13:00
}, $platforms);
}
2020-02-09 08:55:48 +13:00
?><!DOCTYPE html><!--
2019-05-09 18:54:39 +12:00
<?php echo Locale::getText('settings.inspire'); ?>
--><html lang="<?php echo Locale::getText('settings.locale'); ?>" class="<?php echo $this->getParam('class', 'none'); ?> <?php echo $env; ?>">
<head>
<link rel="manifest" href="/manifest.json">
<title><?php echo $this->getParam('title', ''); ?></title>
<meta name="description" content="<?php echo $this->getParam('description', ''); ?>" />
2020-02-23 21:57:51 +13:00
<link rel="stylesheet" media="all" type="text/css" href="/dist/styles/default-<?php echo Locale::getText('settings.direction'); ?>.css?v=3.<?php echo $version; ?>" />
2019-08-02 00:30:01 +12:00
<link rel="icon" type="image/png" href="<?php echo $this->escape($this->getParam('icon', '')); ?>?v=1" />
2019-05-09 18:54:39 +12:00
<link href="https://fonts.googleapis.com/css?family=Poppins:100,300,400,500,600" rel="stylesheet">
2019-07-30 17:53:16 +12:00
<link rel="apple-touch-icon" href="/images/apple.png">
2020-02-04 21:06:13 +13:00
<!-- <link rel="preconnect" href="" /> -->
2019-10-01 12:15:44 +13:00
<?php if (!empty($canonical)): ?>
2019-08-31 11:09:23 +12:00
<link rel="canonical" href="<?php echo $canonical; ?>" />
<?php endif; ?>
2019-07-30 17:53:16 +12:00
<?php foreach ($this->getParam('prefetch', []) as $prefetch): ?>
<link rel="prefetch" href="<?php echo $this->escape($prefetch); ?>" />
<?php endforeach; ?>
2019-05-09 18:54:39 +12:00
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5" />
<meta name="theme-color" content="#24f4d4">
<meta property="og:type" content="website" />
<meta property="og:title" content="<?php echo $this->getParam('title', ''); ?>" />
<meta property="og:description" content="<?php echo $this->getParam('description', ''); ?>" />
2019-11-27 09:53:30 +13:00
<?php if (!empty($canonical)): ?>
<meta property="og:url" content="<?php echo $canonical; ?>" />
<?php endif; ?>
2019-08-24 19:30:12 +12:00
<meta property="og:image" content="<?php echo $protocol; ?>://<?php echo $domain; ?>/images/logo.png?v=1" />
2019-05-09 18:54:39 +12:00
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '<?php echo $analytics; ?>', 'auto', {});
var APP_ENV = {
NAME: '<?php echo APP_NAME; ?>',
VERSION: '<?php echo $version; ?>',
2019-08-24 19:30:12 +12:00
PROTOCOL: '<?php echo $protocol; ?>',
2019-05-09 18:54:39 +12:00
DOMAIN: '<?php echo $domain; ?>',
2019-08-25 17:41:40 +12:00
HOME: '<?php echo $this->escape($this->getParam('home')); ?>',
2020-02-04 21:06:13 +13:00
SETUP: '<?php echo $this->escape($this->getParam('setup')); ?>',
API: '/v1',
PROJECT: 'console',
2020-01-26 18:15:20 +13:00
PLATFORMS: <?php echo json_encode($platforms); ?>,
2019-05-09 18:54:39 +12:00
LOCALE: '<?php echo $this->escape(Locale::getText('settings.locale')); ?>',
PREFIX: '<?php echo $this->escape($this->getParam('prefix')); ?>',
2019-08-15 01:50:40 +12:00
ROLES: <?PHP echo json_encode($this->getParam('roles', [])); ?>,
PAGING_LIMIT: <?PHP echo APP_PAGING_LIMIT; ?>
2019-05-09 18:54:39 +12:00
};
2019-10-01 12:15:44 +13:00
<?php if ($litespeed): ?>
2019-05-09 18:54:39 +12:00
document.addEventListener("DOMContentLoaded", function() {
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.async = true;
script.src = '/dist/scripts/app-all.js?v=<?php echo $version; ?>';
script.onload = function() {
2019-05-09 20:01:51 +12:00
window.ls.run(window);
2019-05-09 18:54:39 +12:00
};
head.appendChild(script);
});
<?php endif; ?>
</script>
<?php echo $this->exec($this->getParam('head', [])); ?>
</head>
2020-02-12 00:55:57 +13:00
<body class="theme-light" data-general-scroll-to data-general-scroll-direction>
<script>
let theme = window.localStorage.getItem('user-theme');
if(theme === 'theme-dark') {
document.body.classList.remove('theme-light');
document.body.classList.add('theme-dark');
}
</script>
2019-05-09 18:54:39 +12:00
<?php echo $this->exec($this->getParam('header', [])); ?>
2019-05-09 20:23:22 +12:00
<main data-ls-router data-first-from-server="true" data-acl data-analytics-pageview>
2019-05-09 18:54:39 +12:00
<?php echo $this->exec($this->getParam('body', [])); ?>
2019-08-28 12:13:26 +12:00
</main>
2019-05-09 18:54:39 +12:00
<div class="loader"></div>
2019-09-27 06:47:48 +12:00
<div data-cookie-policy="We are using cookies to make this website easier to use."></div>
2019-05-09 18:54:39 +12:00
<section data-ls-ui-alerts="" class="alerts">
<ul data-ls-loop="alerts.list" data-ls-as="alert">
<li>
2019-05-10 08:29:23 +12:00
<div data-ls-attrs="class={{alert.class}} message">
2019-05-09 18:54:39 +12:00
<i class="icon-cancel" data-ls-ui-alerts-delete data-message="{{alert.id}}"></i>
2019-05-10 04:15:51 +12:00
<span data-ls-bind="{{alert.text}}"></span>
2019-05-09 18:54:39 +12:00
2019-08-08 17:09:49 +12:00
<span data-ls-if="undefined !== {{alert.link}}" style="display: none;">
2019-09-27 06:47:48 +12:00
<a data-ls-attrs="href={{alert.link}}" data-ls-ui-alerts-delete data-message="{{alert.id}}">Learn More</a>
2019-05-09 18:54:39 +12:00
</span>
</div>
</li>
</ul>
</section>
<?php echo $this->exec($this->getParam('footer', [])); ?>
2019-11-29 20:35:18 +13:00
<!-- Version <?php echo $version; ?> -->
2019-05-09 18:54:39 +12:00
</body>
</html>