Improve the Plugin details page
This commit is contained in:
parent
d7f1d523f0
commit
dfccf7fc4e
|
|
@ -109,8 +109,9 @@ class Updates extends Controller
|
||||||
|
|
||||||
$readmeFiles = ['README.md', 'readme.md'];
|
$readmeFiles = ['README.md', 'readme.md'];
|
||||||
$upgradeFiles = ['UPGRADE.md', 'upgrade.md'];
|
$upgradeFiles = ['UPGRADE.md', 'upgrade.md'];
|
||||||
|
$licenceFiles = ['LICENCE.md', 'licence.md'];
|
||||||
|
|
||||||
$upgrades = $readme = $name = null;
|
$readme = $changelog = $upgrades = $licence = $name = null;
|
||||||
$code = str_replace('-', '.', $urlCode);
|
$code = str_replace('-', '.', $urlCode);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -124,7 +125,9 @@ class Updates extends Controller
|
||||||
if ($path && $plugin) {
|
if ($path && $plugin) {
|
||||||
$details = $plugin->pluginDetails();
|
$details = $plugin->pluginDetails();
|
||||||
$readme = $this->getPluginMarkdownFile($path, $readmeFiles);
|
$readme = $this->getPluginMarkdownFile($path, $readmeFiles);
|
||||||
|
$changelog = File::get($path.'/updates/version.yaml');
|
||||||
$upgrades = $this->getPluginMarkdownFile($path, $upgradeFiles);
|
$upgrades = $this->getPluginMarkdownFile($path, $upgradeFiles);
|
||||||
|
$licence = $this->getPluginMarkdownFile($path, $licenceFiles);
|
||||||
|
|
||||||
$pluginVersion = PluginVersion::whereCode($code)->first();
|
$pluginVersion = PluginVersion::whereCode($code)->first();
|
||||||
$this->vars['pluginName'] = array_get($details, 'name', 'system::lang.plugin.unnamed');
|
$this->vars['pluginName'] = array_get($details, 'name', 'system::lang.plugin.unnamed');
|
||||||
|
|
@ -147,8 +150,10 @@ class Updates extends Controller
|
||||||
|
|
||||||
$this->vars['activeTab'] = $tab ?: 'readme';
|
$this->vars['activeTab'] = $tab ?: 'readme';
|
||||||
$this->vars['urlCode'] = $urlCode;
|
$this->vars['urlCode'] = $urlCode;
|
||||||
$this->vars['upgrades'] = $upgrades;
|
|
||||||
$this->vars['readme'] = $readme;
|
$this->vars['readme'] = $readme;
|
||||||
|
$this->vars['changelog'] = nl2br(str_replace('- ', ' - ', '<p>'.$changelog.'</p>'));
|
||||||
|
$this->vars['upgrades'] = $upgrades;
|
||||||
|
$this->vars['licence'] = $licence;
|
||||||
}
|
}
|
||||||
catch (Exception $ex) {
|
catch (Exception $ex) {
|
||||||
$this->handleError($ex);
|
$this->handleError($ex);
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,13 @@
|
||||||
<?= e(trans('system::lang.updates.details_readme')) ?>
|
<?= e(trans('system::lang.updates.details_readme')) ?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="<?= $activeTab == 'changelog' ? 'active' : '' ?>">
|
||||||
|
<a
|
||||||
|
href="#changelog"
|
||||||
|
data-tab-url="<?= Backend::url('system/updates/details/'.$urlCode.'/changelog') ?>">
|
||||||
|
<?= e(trans('system::lang.updates.details_changelog')) ?>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<li class="<?= $activeTab == 'upgrades' ? 'active' : '' ?>">
|
<li class="<?= $activeTab == 'upgrades' ? 'active' : '' ?>">
|
||||||
<a
|
<a
|
||||||
href="#upgrades"
|
href="#upgrades"
|
||||||
|
|
@ -47,6 +54,13 @@
|
||||||
<?= e(trans('system::lang.updates.details_upgrades')) ?>
|
<?= e(trans('system::lang.updates.details_upgrades')) ?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="<?= $activeTab == 'licence' ? 'active' : '' ?>">
|
||||||
|
<a
|
||||||
|
href="#licence"
|
||||||
|
data-tab-url="<?= Backend::url('system/updates/details/'.$urlCode.'/licence') ?>">
|
||||||
|
<?= e(trans('system::lang.updates.details_licence')) ?>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<div class="tab-pane <?= $activeTab == 'readme' ? 'active' : '' ?>">
|
<div class="tab-pane <?= $activeTab == 'readme' ? 'active' : '' ?>">
|
||||||
|
|
@ -58,6 +72,15 @@
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="tab-pane <?= $activeTab == 'changelog' ? 'active' : '' ?>">
|
||||||
|
<div class="plugin-details-content">
|
||||||
|
<?php if ($changelog): ?>
|
||||||
|
<?= $changelog ?>
|
||||||
|
<?php else: ?>
|
||||||
|
<p><?= e(trans('system::lang.updates.details_changelog_missing')) ?></p>
|
||||||
|
<?php endif ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="tab-pane <?= $activeTab == 'upgrades' ? 'active' : '' ?>">
|
<div class="tab-pane <?= $activeTab == 'upgrades' ? 'active' : '' ?>">
|
||||||
<div class="plugin-details-content">
|
<div class="plugin-details-content">
|
||||||
<?php if ($upgrades): ?>
|
<?php if ($upgrades): ?>
|
||||||
|
|
@ -67,6 +90,15 @@
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="tab-pane <?= $activeTab == 'licence' ? 'active' : '' ?>">
|
||||||
|
<div class="plugin-details-content">
|
||||||
|
<?php if ($licence): ?>
|
||||||
|
<?= $licence ?>
|
||||||
|
<?php else: ?>
|
||||||
|
<p><?= e(trans('system::lang.updates.details_licence_missing')) ?></p>
|
||||||
|
<?php endif ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -267,7 +267,7 @@ return [
|
||||||
'empty' => 'Select action',
|
'empty' => 'Select action',
|
||||||
'confirm' => 'Confirm update',
|
'confirm' => 'Confirm update',
|
||||||
'skip' => 'Skip this plugin (once only)',
|
'skip' => 'Skip this plugin (once only)',
|
||||||
'ignore' => 'Skip this plugin (always)',
|
'ignore' => 'Skip this plugin (always)'
|
||||||
],
|
],
|
||||||
'important_action_required' => 'Action required',
|
'important_action_required' => 'Action required',
|
||||||
'important_view_guide' => 'View upgrade guide',
|
'important_view_guide' => 'View upgrade guide',
|
||||||
|
|
@ -276,10 +276,14 @@ return [
|
||||||
'details_view_homepage' => 'View homepage',
|
'details_view_homepage' => 'View homepage',
|
||||||
'details_readme' => 'Documentation',
|
'details_readme' => 'Documentation',
|
||||||
'details_readme_missing' => 'There is no documentation provided.',
|
'details_readme_missing' => 'There is no documentation provided.',
|
||||||
|
'details_changelog' => 'Changelog',
|
||||||
|
'details_changelog_missing' => 'There is no changelog provided.',
|
||||||
'details_upgrades' => 'Upgrade Guide',
|
'details_upgrades' => 'Upgrade Guide',
|
||||||
'details_upgrades_missing' => 'There are no upgrade instructions provided.',
|
'details_upgrades_missing' => 'There are no upgrade instructions provided.',
|
||||||
|
'details_licence' => 'Licence',
|
||||||
|
'details_licence_missing' => 'There is no licence provided.',
|
||||||
'details_current_version' => 'Current version',
|
'details_current_version' => 'Current version',
|
||||||
'details_author' => 'Author',
|
'details_author' => 'Author'
|
||||||
],
|
],
|
||||||
'server' => [
|
'server' => [
|
||||||
'connect_error' => 'Error connecting to the server.',
|
'connect_error' => 'Error connecting to the server.',
|
||||||
|
|
|
||||||
|
|
@ -237,8 +237,8 @@ return [
|
||||||
'core_current_build' => 'Verzió',
|
'core_current_build' => 'Verzió',
|
||||||
'core_build' => 'Új verzió: :build',
|
'core_build' => 'Új verzió: :build',
|
||||||
'core_build_help' => 'Elérhető a legújabb hivatalos kiadás.',
|
'core_build_help' => 'Elérhető a legújabb hivatalos kiadás.',
|
||||||
'core_downloading' => 'Honlap frissítés letöltése...',
|
'core_downloading' => 'Honlap frissítésének letöltése...',
|
||||||
'core_extracting' => 'Honlap frissítés kicsomagolása...',
|
'core_extracting' => 'Honlap frissítésének kicsomagolása...',
|
||||||
'plugins' => 'Bővítmények',
|
'plugins' => 'Bővítmények',
|
||||||
'themes' => 'Témák',
|
'themes' => 'Témák',
|
||||||
'disabled' => 'Letiltva',
|
'disabled' => 'Letiltva',
|
||||||
|
|
@ -247,8 +247,8 @@ return [
|
||||||
'plugin_version_none' => 'Új bővítmény',
|
'plugin_version_none' => 'Új bővítmény',
|
||||||
'plugin_current_version' => 'Aktuális verzió',
|
'plugin_current_version' => 'Aktuális verzió',
|
||||||
'theme_new_install' => 'Új téma telepítése.',
|
'theme_new_install' => 'Új téma telepítése.',
|
||||||
'theme_downloading' => 'Letöltendő téma: :name',
|
'theme_downloading' => 'Téma letöltése: :name',
|
||||||
'theme_extracting' => 'Kicsomagolandó téma: :name',
|
'theme_extracting' => 'Téma kicsomagolása: :name',
|
||||||
'update_label' => 'Honlap frissítése',
|
'update_label' => 'Honlap frissítése',
|
||||||
'update_completing' => 'Frissítési folyamat befejezése',
|
'update_completing' => 'Frissítési folyamat befejezése',
|
||||||
'update_loading' => 'Elérhető frissítések betöltése...',
|
'update_loading' => 'Elérhető frissítések betöltése...',
|
||||||
|
|
@ -275,10 +275,14 @@ return [
|
||||||
'details_title' => 'Bővítmény részletei',
|
'details_title' => 'Bővítmény részletei',
|
||||||
'details_view_homepage' => 'Honlap megtekintése',
|
'details_view_homepage' => 'Honlap megtekintése',
|
||||||
'details_readme' => 'Dokumentáció',
|
'details_readme' => 'Dokumentáció',
|
||||||
'details_readme_missing' => 'Nincs megadva dokumentáció.',
|
'details_readme_missing' => 'Nincs megadva leírás.',
|
||||||
|
'details_changelog' => 'Kiadott verziók',
|
||||||
|
'details_changelog_missing' => 'Nincs megadva lista.',
|
||||||
'details_upgrades' => 'Frissítési útmutató',
|
'details_upgrades' => 'Frissítési útmutató',
|
||||||
'details_upgrades_missing' => 'Nincs megadva instrukció.',
|
'details_upgrades_missing' => 'Nincs megadva instrukció.',
|
||||||
'details_current_version' => 'Aktuális verzió',
|
'details_licence' => 'Licenc',
|
||||||
|
'details_licence_missing' => 'Nincs megadva licenc.',
|
||||||
|
'details_current_version' => 'Verzió',
|
||||||
'details_author' => 'Fejlesztő'
|
'details_author' => 'Fejlesztő'
|
||||||
],
|
],
|
||||||
'server' => [
|
'server' => [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue