From 6880874d6c1d09d90dc79f33efd6396e16a2ce93 Mon Sep 17 00:00:00 2001 From: grandeljay Date: Mon, 9 Jan 2023 15:58:45 +0100 Subject: [PATCH 1/4] Add module author to grid view --- src/Classes/Module.php | 14 ++++++++++++++ src/Templates/ModuleListingModule.tmpl.php | 12 ++++++++++-- src/Templates/Styles/style.css | 5 +++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/Classes/Module.php b/src/Classes/Module.php index c97fe02f..781fa7f4 100644 --- a/src/Classes/Module.php +++ b/src/Classes/Module.php @@ -553,4 +553,18 @@ public function getChancedFiles(): array $changedFiles = $moduleHasher->getModuleChanges($this); return $changedFiles; } + + public function getAuthor(): string + { + $author = $this->developer; + + return $author; + } + + public function getAuthorWebsite(): string + { + $authorWebsite = $this->developerWebsite; + + return $authorWebsite; + } } diff --git a/src/Templates/ModuleListingModule.tmpl.php b/src/Templates/ModuleListingModule.tmpl.php index 88cdbd04..bdbb62c5 100644 --- a/src/Templates/ModuleListingModule.tmpl.php +++ b/src/Templates/ModuleListingModule.tmpl.php @@ -18,7 +18,8 @@ $modulePrice = $module->isInstalled() ? 'installiert' : $moduleView->getPriceFormated(); $moduleLink = '?action=moduleInfo&archiveName=' . $module->getArchiveName() . '&version=' . $module->getVersion(); - +$moduleAuthor = $module->getAuthor(); +$moduleAuthorWebsite = $module->getAuthorWebsite(); ?>
@@ -30,6 +31,13 @@
getName(); ?> getVersion(); ?> +
+ + + + + +
@@ -44,4 +52,4 @@ Details
-
\ No newline at end of file + diff --git a/src/Templates/Styles/style.css b/src/Templates/Styles/style.css index 4a14a631..211aea9c 100644 --- a/src/Templates/Styles/style.css +++ b/src/Templates/Styles/style.css @@ -188,6 +188,11 @@ section { color: var(--gray); } +.modules .category .card .card-author { + font-size: 0.8rem; + margin-top: 0.2rem; +} + .modules .category .card .module-price { font-size: 1.25em; color: var(--blue); From 7520d9b904c3f9fef58df73e1e3f299361c069ef Mon Sep 17 00:00:00 2001 From: grandeljay Date: Mon, 9 Jan 2023 16:02:06 +0100 Subject: [PATCH 2/4] Add module website --- src/Classes/Module.php | 7 +++++++ src/Templates/ModuleInfo.tmpl.php | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/Classes/Module.php b/src/Classes/Module.php index 781fa7f4..7ae48b28 100644 --- a/src/Classes/Module.php +++ b/src/Classes/Module.php @@ -567,4 +567,11 @@ public function getAuthorWebsite(): string return $authorWebsite; } + + public function getModuleWebsite(): string + { + $moduleWebsite = $this->website; + + return $moduleWebsite; + } } diff --git a/src/Templates/ModuleInfo.tmpl.php b/src/Templates/ModuleInfo.tmpl.php index 7fddce0b..83a65482 100644 --- a/src/Templates/ModuleInfo.tmpl.php +++ b/src/Templates/ModuleInfo.tmpl.php @@ -294,6 +294,17 @@ + + Website + + getModuleWebsite()) { ?> + getModuleWebsite() ?> + + unbekannte Website + + + + Alle Versionen From 87409f7b1a057f9accda7bf1846a037651dc7b65 Mon Sep 17 00:00:00 2001 From: grandeljay Date: Wed, 11 Jan 2023 10:28:40 +0100 Subject: [PATCH 3/4] Refactor unnecessary methods --- src/Classes/Module.php | 21 --------------------- src/Templates/ModuleInfo.tmpl.php | 10 +++++----- src/Templates/ModuleListingModule.tmpl.php | 12 ++++++------ src/Templates/Styles/style.css | 4 ++-- 4 files changed, 13 insertions(+), 34 deletions(-) diff --git a/src/Classes/Module.php b/src/Classes/Module.php index 7ae48b28..c97fe02f 100644 --- a/src/Classes/Module.php +++ b/src/Classes/Module.php @@ -553,25 +553,4 @@ public function getChancedFiles(): array $changedFiles = $moduleHasher->getModuleChanges($this); return $changedFiles; } - - public function getAuthor(): string - { - $author = $this->developer; - - return $author; - } - - public function getAuthorWebsite(): string - { - $authorWebsite = $this->developerWebsite; - - return $authorWebsite; - } - - public function getModuleWebsite(): string - { - $moduleWebsite = $this->website; - - return $moduleWebsite; - } } diff --git a/src/Templates/ModuleInfo.tmpl.php b/src/Templates/ModuleInfo.tmpl.php index 83a65482..6557821c 100644 --- a/src/Templates/ModuleInfo.tmpl.php +++ b/src/Templates/ModuleInfo.tmpl.php @@ -221,21 +221,21 @@

- +
Wird geladen. Bitte warten...
- +
Wird geladen. Bitte warten...
- +
@@ -297,8 +297,8 @@ Website - getModuleWebsite()) { ?> - getModuleWebsite() ?> + getWebsite()) { ?> + getWebsite() ?> unbekannte Website diff --git a/src/Templates/ModuleListingModule.tmpl.php b/src/Templates/ModuleListingModule.tmpl.php index bdbb62c5..a68c377e 100644 --- a/src/Templates/ModuleListingModule.tmpl.php +++ b/src/Templates/ModuleListingModule.tmpl.php @@ -18,8 +18,8 @@ $modulePrice = $module->isInstalled() ? 'installiert' : $moduleView->getPriceFormated(); $moduleLink = '?action=moduleInfo&archiveName=' . $module->getArchiveName() . '&version=' . $module->getVersion(); -$moduleAuthor = $module->getAuthor(); -$moduleAuthorWebsite = $module->getAuthorWebsite(); +$moduleDeveloper = $module->getDeveloper(); +$moduleDeveloperWebsite = $module->getDeveloperWebsite(); ?>
@@ -31,11 +31,11 @@
getName(); ?> getVersion(); ?> -
- - +
+ + - +
diff --git a/src/Templates/Styles/style.css b/src/Templates/Styles/style.css index 211aea9c..fa823b85 100644 --- a/src/Templates/Styles/style.css +++ b/src/Templates/Styles/style.css @@ -71,7 +71,7 @@ select + p { select.form-control { height: 38px !important; -} +} h1, h2, @@ -188,7 +188,7 @@ section { color: var(--gray); } -.modules .category .card .card-author { +.modules .category .card .card-developer { font-size: 0.8rem; margin-top: 0.2rem; } From c6a69c25b19e2863aa624bc258f0b5bd6e8224e6 Mon Sep 17 00:00:00 2001 From: grandeljay Date: Wed, 11 Jan 2023 10:32:19 +0100 Subject: [PATCH 4/4] Fix outdated version --- tests/unit/RemoteModuleLoaderTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/RemoteModuleLoaderTest.php b/tests/unit/RemoteModuleLoaderTest.php index 8c340220..4409ed58 100644 --- a/tests/unit/RemoteModuleLoaderTest.php +++ b/tests/unit/RemoteModuleLoaderTest.php @@ -67,7 +67,7 @@ public function testCanLoadLatestVersionByArchiveName() $module = $this->loader->loadLatestVersionByArchiveName('composer/autoload'); $this->assertEquals('composer/autoload', $module->getArchiveName()); - $this->assertEquals('1.2.2', $module->getVersion()); + $this->assertEquals('1.3.0', $module->getVersion()); } public function testCanLoadByArchiveNameAndVersion()