From b67fc78a348785510cd99520644e65273f4cbfb1 Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 19 Aug 2020 12:55:47 +0200 Subject: [PATCH 01/10] Update ModuleInfo.tmpl.php --- src/Templates/ModuleInfo.tmpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Templates/ModuleInfo.tmpl.php b/src/Templates/ModuleInfo.tmpl.php index 39674e63..69f78528 100644 --- a/src/Templates/ModuleInfo.tmpl.php +++ b/src/Templates/ModuleInfo.tmpl.php @@ -47,7 +47,7 @@ From d429787b193a85c15d893d260b7359aba15fc5ed Mon Sep 17 00:00:00 2001 From: Jay Date: Thu, 3 Sep 2020 11:54:49 +0200 Subject: [PATCH 02/10] Heading and other fixes - fix: headings not looking good with module icon - fix: module images being too long - fix: remove unnecessary html containers - fix: remove inline css - fix: change loading text to german equivelant - style: change the text cursor of badges to default cursor - style: cleaned up some unnecessary code --- src/Templates/ModuleInfo.tmpl.php | 562 +++++++++++++++--------------- src/Templates/Styles/style.css | 99 ++---- 2 files changed, 318 insertions(+), 343 deletions(-) diff --git a/src/Templates/ModuleInfo.tmpl.php b/src/Templates/ModuleInfo.tmpl.php index 70c7e95c..fbe58350 100644 --- a/src/Templates/ModuleInfo.tmpl.php +++ b/src/Templates/ModuleInfo.tmpl.php @@ -18,319 +18,317 @@
-
-
- - -
-
-
- -
+ + +
+
+
+ -

getName() ?>

+

getName() ?>

+
+
+
getImageUris()) { ?> -
- getImageUris() as $image) { ?> -
- - - -
- -
+ getImageUris() as $image) { ?> +
+ + + +
+ +
+
- - - + + + -
- - - +
+ + + - isCompatible()) { ?> - + isCompatible()) { ?> + + + + + Update installieren + + + + + + Änderungen verwerfen + + Änderungen übernehmen (Link-Mode) + + + - - Update installieren - + + Download & Install - - - - Änderungen verwerfen - - Änderungen übernehmen (Link-Mode) - - - - + + Download (inkompatible Version) - - Download & Install + + Deinstallieren - - Download (inkompatible Version) + + Installieren - - Deinstallieren + + Installieren (inkompatible Version) - - Installieren + getInstalledVersion()) { ?> + getVersion() != $module->getVersion()) { ?> + Zur installierten Version + + - - Installieren (inkompatible Version) + isRemote() && $module->isLoaded() && !$module->isInstalled()) { ?> + Modul löschen + +
+
+
- getInstalledVersion()) { ?> - getVersion() != $module->getVersion()) { ?> - Zur installierten Version - - +
+ - isRemote() && $module->isLoaded() && !$module->isInstalled()) { ?> - Modul löschen - +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
VersiongetVersion(); ?>
PreisgetPriceFormated(); ?>
Kompatibel mit Modified + getModifiedCompatibility()) { ?> + getModifiedCompatibility() as $version) { ?> + + + + + + unbekannt + +
Entwickler + getDeveloper() && $module->getDeveloperWebsite()) { ?> + getDeveloper() ?> + getDeveloper()) { ?> + getDeveloper() ?> + + unbekannter Entwickler + +
-
-
-
-
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - -
VersiongetVersion(); ?>
PreisgetPriceFormated(); ?>
Kompatibel mit Modified - getModifiedCompatibility()) { ?> - getModifiedCompatibility() as $version) { ?> - - - - - - unbekannt - -
Entwickler - getDeveloper() && $module->getDeveloperWebsite()) { ?> - getDeveloper() ?> - getDeveloper()) { ?> - getDeveloper() ?> - - unbekannter Entwickler - -
-
- -
-

Beschreibung

-

- getDescription()) { ?> - getDescription() ?> - - keine Beschreibung vorhanden - -

-
-
- -
-
- loading ... -
-
- +
+
+ Wird geladen. Bitte warten... +
+
+ -
-
- loading ... -
-
- +
+
+ Wird geladen. Bitte warten... +
+
+ -
-
- loading ... -
-
- - -
-
- - - - - - - - - - - - - - - - - - getTags()) { ?> - - - - +
+
+ Wird geladen. Bitte warten... +
+
+ + +
+
+
ArchivnamegetArchiveName(); ?>
VersiongetVersion(); ?>
Kompatibel mit Modified - getModifiedCompatibility()) { ?> - getModifiedCompatibility() as $version) { ?> - - - - unbekannt - -
Tags - getTags()) as $tag) { ?> - - -
+ + + + + + + + + + + + + + + + + getTags()) { ?> + + + + + - - - - - - - - - - - - - - - - - - - - -
ArchivnamegetArchiveName(); ?>
VersiongetVersion(); ?>
Kompatibel mit Modified + getModifiedCompatibility()) { ?> + getModifiedCompatibility() as $version) { ?> + + + + unbekannt +
Tags + getTags()) as $tag) { ?> + + +
Entwickler - getDeveloper() && $module->getDeveloperWebsite()) { ?> - getDeveloper() ?> - getDeveloper()) { ?> - getDeveloper() ?> - - unbekannter Entwickler - -
Alle Versionen - getVersions() as $moduleVersion) {?> - getVersion(); ?> - isInstalled()) { ?> - installiert - isLoaded()) { ?> - geladen - - nicht geladen - -
- -
Benötigt - getRequire()) { ?> - getRequire() as $archiveName => $version) { ?> - :
- - - keine Abhängigkeit vorhanden - -
Benutzt von - getUsedBy()) { ?> - getUsedBy() as $usedBy) { ?> - getArchiveName()?>: getVersion() ?>
- - - wird von keinem Modul verwendet - -
-
-
+ + Entwickler + + getDeveloper() && $module->getDeveloperWebsite()) { ?> + getDeveloper() ?> + getDeveloper()) { ?> + getDeveloper() ?> + + unbekannter Entwickler + + + + + + Alle Versionen + + getVersions() as $moduleVersion) {?> + getVersion(); ?> + isInstalled()) { ?> + installiert + isLoaded()) { ?> + geladen + + nicht geladen + +
+ + + + + + Benötigt + + getRequire()) { ?> + getRequire() as $archiveName => $version) { ?> + :
+ + + keine Abhängigkeit vorhanden + + + + + + Benutzt von + + getUsedBy()) { ?> + getUsedBy() as $usedBy) { ?> + getArchiveName()?>: getVersion() ?>
+ + + wird von keinem Modul verwendet + + + + + +
+
-
-

Geänderte Dateien

+
+

Geänderte Dateien

- isInstalled() && $module->isChanged()) { ?> + isInstalled() && $module->isChanged()) { ?> - getChancedFiles() as $file => $mode) { ?> - + getChancedFiles() as $file => $mode) { ?> + -
:
-
- - - keine Änderungen vorhanden +
:
+
-
-
+ + keine Änderungen vorhanden +
diff --git a/src/Templates/Styles/style.css b/src/Templates/Styles/style.css index 1c1d7427..bfecdc40 100644 --- a/src/Templates/Styles/style.css +++ b/src/Templates/Styles/style.css @@ -9,6 +9,14 @@ --colourPrimary: #007bff; --colourPrimaryLight: #66b0f7; --colourLight: #777; + --colourBorder: #d9d9d9; + --colourBorderLight: #f4f4f4; + + /** + * Apply bootstrap colour + */ + --colourGreen: var(--green); + --colourOrange: var(--orange); --radiusDefault: 4px; @@ -71,6 +79,10 @@ section { margin: 4em 0; } +.badge { + cursor: default; +} + /** * Tooltip @@ -327,24 +339,6 @@ section { text-decoration: underline; } -.moduleinfo h1 { - font-weight: normal; - margin-bottom: var(--gutterDefault); -} - -.module-listing h1 { - font-weight: normal; - border-bottom: 1px solid #cccccc; - font-size: 2em; -} - -.module-listing h2 { - font-weight: normal; - font-size: 1.5em; - margin-bottom: var(--gutterDefault); - margin-top: var(--gutterDefault); -} - .module-listing .search { margin-bottom: 25px; } @@ -356,46 +350,50 @@ section { border: 1px solid #cccccc; } -.content .moduleinfo .moduleinfo-row { +.content .module-title { + display: flex; + flex-flow: row nowrap; + align-items: flex-start; +} + +.content .module-title img { + margin: 0.4rem 0.8rem 0.4rem 0.4rem; + height: 4rem; +} + +.content .moduleinfo-row { padding-bottom: var(--paddingDefault); border-bottom: 1px solid #cccccc; margin-bottom: var(--gutterDefault); } -.content .moduleinfo .moduleinfo-row .info-heading { +.content .moduleinfo-row .info-heading { display: inline-block; font-weight: bold; width: 300px; float: left; } -.content .moduleinfo .moduleinfo-row .info-body { +.content .moduleinfo-row .info-body { padding-left: 300px; } -.content .moduleinfo .moduleinfo-images { +.content .moduleinfo-images { padding-bottom: var(--paddingDefault); } -.content .moduleinfo .moduleinfo-images img { - -width: 300px; +.content .moduleinfo-images img { width: 100%; + max-height: 128px; border: 1px solid #cccccc; } -.content .moduleinfo .module-icon img { - float: left; - margin-right: 10px; - height: 32px; - margin-top: 8px -} - -.moduleinfo .button { +.content .button { margin: 0px; margin-right: 10px; } -.content .moduleinfo .moduleinfo-buttons { +.content .moduleinfo-buttons { margin-bottom: var(--gutterDefault); padding-bottom: var(--paddingDefault); border-bottom: 1px solid #cccccc; @@ -413,37 +411,16 @@ section { font-weight: bold; } +/** + * Markdown + */ .markdown h1 { - border: none; -} + margin: initial; -.markdown h2 { - font-weight: normal; - margin-top: 60px; -} - -.markdown h3 { - font-weight: normal; - margin-top: 40px; -} + font-size: 3rem; + text-transform: none; -.markdown.changelog h3 { - font-weight: bold; - margin-top: 16px; - font-size: 18px; -} - -.markdown h4 { - font-weight: normal; - margin-top: var(--gutterDefault); -} - -.markdown hr { - margin: 40px 0px 40px; - border: none; - border-top: 1px dashed #cccccc; - height: 0px; - background-color: none; + opacity: 1; } .markdown table { From 3cea0c12b6b3e1674e69343acd3aff391042fa01 Mon Sep 17 00:00:00 2001 From: Jay Date: Thu, 3 Sep 2020 13:07:24 +0200 Subject: [PATCH 03/10] Fix headings not looking good --- src/Templates/ModuleInfo.tmpl.php | 2 +- src/Templates/Styles/style.css | 48 ++++++++++++++++++++++--------- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/src/Templates/ModuleInfo.tmpl.php b/src/Templates/ModuleInfo.tmpl.php index fbe58350..9f843061 100644 --- a/src/Templates/ModuleInfo.tmpl.php +++ b/src/Templates/ModuleInfo.tmpl.php @@ -190,7 +190,7 @@ getDescription()) { ?> getDescription() ?> - keine Beschreibung vorhanden + Keine Beschreibung vorhanden.

diff --git a/src/Templates/Styles/style.css b/src/Templates/Styles/style.css index bfecdc40..36c9c3ea 100644 --- a/src/Templates/Styles/style.css +++ b/src/Templates/Styles/style.css @@ -6,6 +6,8 @@ --paddingDefaultHalf: 10px; --paddingNavigation: 10px; + --sizeH1: 2.8rem; + --colourPrimary: #007bff; --colourPrimaryLight: #66b0f7; --colourLight: #777; @@ -67,18 +69,30 @@ input + p, .input-group + p { color: var(--colourLight); } -h1 { +h1, +h2, +h3, +h4, +h5, +h6 { margin-bottom: 1em; - - text-transform: uppercase; - font-size: 4rem; - opacity: 0.2; } +h1 { font-size: var(--sizeH1); } +h2 { font-size: 2.4rem; } +h3 { font-size: 2.0rem; } +h4 { font-size: 1.6rem; } +h5 { font-size: 1.2rem; } +h6 { font-size: 0.8rem; } + section { margin: 4em 0; } + +/** + * Badge + */ .badge { cursor: default; } @@ -339,6 +353,14 @@ section { text-decoration: underline; } + +/** + * Module list + */ +.module-listing h2 { + margin-bottom: 0.2em; +} + .module-listing .search { margin-bottom: 25px; } @@ -358,7 +380,7 @@ section { .content .module-title img { margin: 0.4rem 0.8rem 0.4rem 0.4rem; - height: 4rem; + height: var(--sizeH1); } .content .moduleinfo-row { @@ -414,13 +436,13 @@ section { /** * Markdown */ -.markdown h1 { - margin: initial; - - font-size: 3rem; - text-transform: none; - - opacity: 1; +.markdown h1, +.markdown h2, +.markdown h3, +.markdown h4, +.markdown h5, +.markdown h6 { + margin-bottom: 0.2em; } .markdown table { From 7e1f4f2bd263fe3147ec533331069c42eaa3c671 Mon Sep 17 00:00:00 2001 From: Jay Date: Thu, 3 Sep 2020 14:07:20 +0200 Subject: [PATCH 04/10] Fine tune headings --- src/Templates/Styles/style.css | 50 +++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/src/Templates/Styles/style.css b/src/Templates/Styles/style.css index 36c9c3ea..bdf8d411 100644 --- a/src/Templates/Styles/style.css +++ b/src/Templates/Styles/style.css @@ -6,7 +6,7 @@ --paddingDefaultHalf: 10px; --paddingNavigation: 10px; - --sizeH1: 2.8rem; + --sizeH1: 2.0rem; --colourPrimary: #007bff; --colourPrimaryLight: #66b0f7; @@ -79,11 +79,11 @@ h6 { } h1 { font-size: var(--sizeH1); } -h2 { font-size: 2.4rem; } -h3 { font-size: 2.0rem; } -h4 { font-size: 1.6rem; } +h2 { font-size: 1.8rem; } +h3 { font-size: 1.6rem; } +h4 { font-size: 1.4rem; } h5 { font-size: 1.2rem; } -h6 { font-size: 0.8rem; } +h6 { font-size: 1.0rem; } section { margin: 4em 0; @@ -379,7 +379,7 @@ section { } .content .module-title img { - margin: 0.4rem 0.8rem 0.4rem 0.4rem; + margin: 0.2em 0.4em 0.2em 0.2em; height: var(--sizeH1); } @@ -402,11 +402,12 @@ section { .content .moduleinfo-images { padding-bottom: var(--paddingDefault); + margin: 0 -30px 0 -30px; } .content .moduleinfo-images img { width: 100%; - max-height: 128px; + max-height: 256px; border: 1px solid #cccccc; } @@ -415,12 +416,6 @@ section { margin-right: 10px; } -.content .moduleinfo-buttons { - margin-bottom: var(--gutterDefault); - padding-bottom: var(--paddingDefault); - border-bottom: 1px solid #cccccc; -} - .moduleinfo-row { line-height: 22px; } @@ -445,6 +440,35 @@ section { margin-bottom: 0.2em; } +.markdown h1 { font-size: 1.6rem; } +.markdown h2 { font-size: 1.4rem; } +.markdown h3 { font-size: 1.2rem; } +.markdown h4 { font-size: 1.0rem; } +.markdown h5 { font-size: 1.0rem; } +.markdown h6 { font-size: 1.0rem; } + +.markdown h1, +.markdown h2 { + border-bottom: 1px solid var(--colourBorder); +} + +.markdown h1 { + margin-bottom: 0.6em; + padding-bottom: 0.1em; +} + +.markdown h2 { + margin: 4rem 0 0.4em 0; + padding: 0 0 0.1em 0; +} + +.markdown hr { + margin: 2rem 1rem; + + border: unset; + border-top: 1px dashed var(--colourBorder); +} + .markdown table { border-collapse: collapse; } From b00c614e8f2c24e9c0baf41226854607f7750779 Mon Sep 17 00:00:00 2001 From: Jay Date: Thu, 3 Sep 2020 14:16:37 +0200 Subject: [PATCH 05/10] Add extra space to h2 --- src/Templates/Styles/style.css | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Templates/Styles/style.css b/src/Templates/Styles/style.css index bdf8d411..b4bfafd7 100644 --- a/src/Templates/Styles/style.css +++ b/src/Templates/Styles/style.css @@ -449,17 +449,14 @@ section { .markdown h1, .markdown h2 { - border-bottom: 1px solid var(--colourBorder); -} - -.markdown h1 { margin-bottom: 0.6em; padding-bottom: 0.1em; + + border-bottom: 1px solid var(--colourBorder); } .markdown h2 { - margin: 4rem 0 0.4em 0; - padding: 0 0 0.1em 0; + margin-top: 4rem; } .markdown hr { From bc369cfab4811ef4e19491b2b568895c6bb8f3bc Mon Sep 17 00:00:00 2001 From: Jay Date: Thu, 3 Sep 2020 14:20:21 +0200 Subject: [PATCH 06/10] Update style.css --- src/Templates/Styles/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Templates/Styles/style.css b/src/Templates/Styles/style.css index b4bfafd7..0997e8de 100644 --- a/src/Templates/Styles/style.css +++ b/src/Templates/Styles/style.css @@ -401,7 +401,7 @@ section { } .content .moduleinfo-images { - padding-bottom: var(--paddingDefault); + padding-bottom: 1rem; margin: 0 -30px 0 -30px; } From c902801e1fa052673527e81e1b558b45aa72abc4 Mon Sep 17 00:00:00 2001 From: grandeljay Date: Sat, 4 Nov 2023 17:07:28 +0100 Subject: [PATCH 07/10] feat: use latest archive tag/version --- src/Classes/ModuleCreator.php | 49 ++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/src/Classes/ModuleCreator.php b/src/Classes/ModuleCreator.php index 217a9128..b91fe639 100644 --- a/src/Classes/ModuleCreator.php +++ b/src/Classes/ModuleCreator.php @@ -35,7 +35,7 @@ public function createModule($vendorPrefix, $vendorName, $moduleName) $moduleConstName = str_replace('-', '_', strtoupper('MODULE_' . $vendorPrefix . '_' . $moduleName)); $this->createFolders($archiveName, $fileName, $vendorName, $moduleNameCamelCase); - $this->createModuleInfoJsonFile($archiveName, $moduleName); + $this->createModuleInfoJsonFile($vendorName, $moduleName); $this->createSystemModuleFile($archiveName, $fileName, $className, $moduleConstName); $this->createSystemModuleLanguageDeFile($archiveName, $fileName, $moduleConstName, $vendorName); $this->createSystemModuleLanguageEnFile($archiveName, $fileName, $moduleConstName, $vendorName); @@ -76,8 +76,49 @@ public function createFolders($archiveName, $fileName, $vendorName, $moduleNameC @mkdir(App::getModulesRoot() . '/' . $archiveName . '/src-mmlc/Classes'); } - public function createModuleInfoJsonFile($archiveName, $moduleName) + private function getLatestVersion(string $archiveName): string { + $version = '0.1.0'; + + /** + * Create GitHub API reqest. + * + * GitHub requries a `User-Agent` header or it will respond with HTTP + * 403. + */ + $requestOptions = [ + 'http' => [ + 'header' => [ + 'User-Agent: PHP', + ], + ], + ]; + $requestContext = stream_context_create($requestOptions); + $requestResponse = file_get_contents( + sprintf( + 'https://api.github.com/repos/%s/tags', + $archiveName + ), + $use_include_path = false, + $requestContext + ); + + if (false !== $requestResponse) { + $archiveTags = json_decode($requestResponse, $associative = true); + $archiveTagsLatest = reset($archiveTags); + + if (isset($archiveTagsLatest['name'])) { + $version = $archiveTagsLatest['name']; + } + } + + return $version; + } + + public function createModuleInfoJsonFile($vendorName, $moduleName) + { + $archiveName = $vendorName . '/' . $moduleName; + $info = [ 'name' => $moduleName, 'archiveName' => $archiveName, @@ -96,8 +137,8 @@ public function createModuleInfoJsonFile($archiveName, $moduleName) 'price' => '', 'require' => [ - 'composer/autoload' => '^1.1.0', - 'robinthehood/modified-std-module' => '^0.1.0' + 'composer/autoload' => '^' . $this->getLatestVersion('RobinTheHood/modified-composer-autoload'), + 'robinthehood/modified-std-module' => '^' . $this->getLatestVersion('RobinTheHood/modified-std-module'), ], 'modifiedCompatibility' => [ From 02df635512141ded91b8bf900d5c2b3a275711b3 Mon Sep 17 00:00:00 2001 From: grandeljay Date: Sat, 4 Nov 2023 17:56:27 +0100 Subject: [PATCH 08/10] feat: use `$vendorName` --- src/Classes/ModuleCreator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Classes/ModuleCreator.php b/src/Classes/ModuleCreator.php index b91fe639..73baa99b 100644 --- a/src/Classes/ModuleCreator.php +++ b/src/Classes/ModuleCreator.php @@ -129,9 +129,9 @@ public function createModuleInfoJsonFile($vendorName, $moduleName) 'description' => 'Beschreibung für ' . $moduleName, 'installation' => 'Installationsanleitung für ' . $moduleName, - 'developer' => '', 'developerWebsite' => 'https://...', 'website' => 'https://...', + 'developer' => $vendorName, 'category' => '', 'price' => '', From 5fead442ff04e5f839ab13378fcdbab045420a6d Mon Sep 17 00:00:00 2001 From: grandeljay Date: Sat, 4 Nov 2023 17:59:45 +0100 Subject: [PATCH 09/10] feat: assume `developerWebsite` --- src/Classes/ModuleCreator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Classes/ModuleCreator.php b/src/Classes/ModuleCreator.php index 73baa99b..06ba1d99 100644 --- a/src/Classes/ModuleCreator.php +++ b/src/Classes/ModuleCreator.php @@ -129,9 +129,9 @@ public function createModuleInfoJsonFile($vendorName, $moduleName) 'description' => 'Beschreibung für ' . $moduleName, 'installation' => 'Installationsanleitung für ' . $moduleName, - 'developerWebsite' => 'https://...', 'website' => 'https://...', 'developer' => $vendorName, + 'developerWebsite' => 'https://github.com/' . $vendorName, 'category' => '', 'price' => '', From 391d87b9d155334733794ff3da646755cb7309c6 Mon Sep 17 00:00:00 2001 From: grandeljay Date: Sat, 4 Nov 2023 18:00:05 +0100 Subject: [PATCH 10/10] feat: assume `website` --- src/Classes/ModuleCreator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Classes/ModuleCreator.php b/src/Classes/ModuleCreator.php index 06ba1d99..f814f5d9 100644 --- a/src/Classes/ModuleCreator.php +++ b/src/Classes/ModuleCreator.php @@ -129,9 +129,9 @@ public function createModuleInfoJsonFile($vendorName, $moduleName) 'description' => 'Beschreibung für ' . $moduleName, 'installation' => 'Installationsanleitung für ' . $moduleName, - 'website' => 'https://...', 'developer' => $vendorName, 'developerWebsite' => 'https://github.com/' . $vendorName, + 'website' => 'https://github.com/' . $archiveName, 'category' => '', 'price' => '',