From 38d3ecc6a52acbe1f2a3f243a6fe1cf3f98fcbb7 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 12 Jun 2023 13:52:44 +0200 Subject: [minilinux] Minor design tweaks to list - Hackish way to hide sort-order inlined in title - Border for change-log - Shorten cooldown for list update to 3 minutes (was 10) --- modules-available/minilinux/inc/minilinux.inc.php | 6 +++--- modules-available/minilinux/page.inc.php | 5 +++++ modules-available/minilinux/templates/filelist.html | 7 +++++-- modules-available/minilinux/templates/versionlist.html | 4 +++- 4 files changed, 16 insertions(+), 6 deletions(-) (limited to 'modules-available/minilinux') diff --git a/modules-available/minilinux/inc/minilinux.inc.php b/modules-available/minilinux/inc/minilinux.inc.php index 96763874..4960284f 100644 --- a/modules-available/minilinux/inc/minilinux.inc.php +++ b/modules-available/minilinux/inc/minilinux.inc.php @@ -16,16 +16,16 @@ class MiniLinux */ /** - * Query all known sources for meta data + * Query all known sources for metadata * @return int number of sources query was just initialized for */ public static function updateList() { $stamp = time(); $last = Property::get(self::PROPERTY_KEY_FETCHTIME); - if ($last !== false && $last + 10 > $stamp) + if ($last !== false && $last + 3 > $stamp) return 0; // In progress... - Property::set(self::PROPERTY_KEY_FETCHTIME, $stamp, 1); + Property::set(self::PROPERTY_KEY_FETCHTIME, $stamp, 10); Database::exec('LOCK TABLES callback WRITE, minilinux_source WRITE, minilinux_branch WRITE, minilinux_version WRITE'); Database::exec('UPDATE minilinux_source SET taskid = UUID()'); diff --git a/modules-available/minilinux/page.inc.php b/modules-available/minilinux/page.inc.php index 035a45d5..2099b8c5 100644 --- a/modules-available/minilinux/page.inc.php +++ b/modules-available/minilinux/page.inc.php @@ -40,6 +40,11 @@ class Page_MiniLinux extends Page $sourceList = []; // Group by branch for detailed listing, add usage info foreach ($branches as &$branch) { + // Little hack: We abuse the title for ordering, so if the second char is a space, assume the first one + // is just for sort order and remove it. + if ($branch['title'][1] === ' ') { + $branch['title'] = substr($branch['title'], 2); + } $bid = 'div-' . str_replace('/', '-', $branch['branchid']); if (!isset($sourceList[$branch['sourceid']])) { $sourceList[$branch['sourceid']] = ['sourceid' => $branch['sourceid'], 'list' => []]; diff --git a/modules-available/minilinux/templates/filelist.html b/modules-available/minilinux/templates/filelist.html index e4923a8f..241d1264 100644 --- a/modules-available/minilinux/templates/filelist.html +++ b/modules-available/minilinux/templates/filelist.html @@ -49,7 +49,10 @@

 {{/dltask}}
 {{#changelog}}
-

{{lang_changelog}}

-{{{changelog}}} +
+
+

{{lang_changelog}}

+ {{{changelog}}} +
{{/changelog}}
\ No newline at end of file diff --git a/modules-available/minilinux/templates/versionlist.html b/modules-available/minilinux/templates/versionlist.html index 763ab784..e66960b2 100644 --- a/modules-available/minilinux/templates/versionlist.html +++ b/modules-available/minilinux/templates/versionlist.html @@ -17,10 +17,12 @@ - {{dateline_s}} {{#desclen}} +
+
{{/desclen}} + {{dateline_s}} {{title}} -- cgit v1.2.3-55-g7522