diff options
author | Devlin Junker <devlin.junker@gmail.com> | 2023-09-25 13:15:14 -0700 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2023-10-01 10:28:29 +0200 |
commit | e16ab4a3641bad7762a9e0ce2f1c66943cd8298b (patch) | |
tree | 13beba326ce16e288be7018fc721ce3caf3fff87 /templates | |
parent | 2ebd898a1b049e6f4dbd3f8a2ca5ff2d04814bb1 (diff) |
add warning message generated with PHP, also check for subcribe_to parameter
Signed-off-by: Devlin Junker <devlin.junker@gmail.com>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/index.php | 23 | ||||
-rw-r--r-- | templates/part.content.warnings.php | 61 |
2 files changed, 75 insertions, 9 deletions
diff --git a/templates/index.php b/templates/index.php index 561bf361b..1f661979c 100644 --- a/templates/index.php +++ b/templates/index.php @@ -1,14 +1,19 @@ <?php +use OCA\News\Plugin\Client\Plugin; + script('news', 'nextcloud-news-main'); -style('news', 'navigation'); -style('news', 'explore'); -style('news', 'admin'); -style('news', 'app'); -style('news', 'content'); -style('news', 'custom'); -style('news', 'mobile'); -style('news', 'settings'); -style('news', 'shortcuts'); + +// load plugin scripts and styles +foreach (Plugin::getStyles() as $appName => $fileName) { + style($appName, $fileName); +} +foreach (Plugin::getScripts() as $appName => $fileName) { + script($appName, $fileName); +} + +print_unescaped($this->inc('part.content.warnings')) + ?> + <div id="q-app"></div> diff --git a/templates/part.content.warnings.php b/templates/part.content.warnings.php new file mode 100644 index 000000000..b791de024 --- /dev/null +++ b/templates/part.content.warnings.php @@ -0,0 +1,61 @@ +<?php if ($_['warnings']['improperlyConfiguredCron']) { ?> + <style> + #cron-warning { + position: absolute; + right: 30px; + top: 40px; + z-index: 5; + padding: 5px; + background-color: var(--color-main-background); + color: var(--color-main-text); + box-shadow: 0 0 6px 0 var(--color-box-shadow); + border-radius: var(--border-radius); + display: flex; + } + + #cron-warning a { + color: #3a84e4; + text-decoration: underline; + font-size: small; + } + + #close-cron-warning { + padding: 10px; + font-weight: bold; + cursor: pointer; + } + + #content { + margin-top: 0px; + } + </style> + + <div id="cron-warning"> + <div style="<?= $_['nc_major_version'] >= 25 ? 'padding: 12px;' : ''; ?>"> + <p><?php p($l->t('Ajax or webcron mode detected! Your feeds will not be updated!')); ?></p> + <ul> + <li> + <a href="https://docs.nextcloud.org/server/latest/admin_manual/configuration_server/background_jobs_configuration.html#cron" + target="_blank" + rel="noreferrer"> + <?php + p($l->t('How to set up the operating system cron')); + ?> + </a> + </li> + <li> + <a href="https://github.com/nextcloud/news-updater" + target="_blank" + rel="noreferrer"> + <?php + p($l->t('Install and set up a faster parallel updater that uses the News app\'s update API')); + ?> + </a> + </li> + </ul> + </div> + <div> + <span id="close-cron-warning">X</span> + </div> + </div> +<?php }; ?> |