Janto Dreijer avatar Janto Dreijer committed 61dffb4

date of change in latest releases sidebar

Comments (0)

Files changed (1)

 		show_latest_changes = 1
 		newest_packages_html = ""
 		if show_latest_changes:
-			newest_packages_html = []
-
+			# create html lines
+			newest_packages_html_lines = []
 			for package in Package.packages().values():
 				short_name = package.info()["short_name"]
-				package_news_items, _checked_urls = package.release_files(return_checked_urls=True)
+				news_items, _checked_urls = package.release_files(return_checked_urls=True)
 				checked_urls.extend(_checked_urls)
-				if package_news_items:
-					actions = ", ".join(name for name, _url, t in package_news_items)
-					newest_packages_html.append('<a href="/%(short_name)s" title="%(actions)s">%(short_name)s</a><br />\n' % locals())
+				if news_items:
+					actions = ", ".join(name for name, _url, t in news_items)
+					last_update_time = max(t for name, _url, t in news_items)
+					last_update_time_string = last_update_time.strftime("%d %b %Y")
+					#~ t = t.strftime("%d %b" if t.year == datetime.datetime.now().year else "%d %b %Y")
+					html = '<a href="/%(short_name)s" title="%(actions)s">%(short_name)s</a> <span style="font-size: 10px; color:gray;">%(last_update_time_string)s</span><br />\n' % locals()
+					newest_packages_html_lines.append((last_update_time, html))
 
-			newest_packages_html = "\n".join(sorted(newest_packages_html)[:5])
+			newest_packages_html = "\n".join(html for last_update_time, html in sorted(newest_packages_html_lines, reverse=True))
 			if newest_packages_html:
 				#~ feed_icon = '<a href="/rss.xml" style="font: bold 0.75em sans-serif; color: #fff; background: #f60; padding: 0.2em 0.35em; float: left;">RSS</a>'
 				feed_icon = '<a href="/rss.xml" style="font: 0.75em sans-serif; text-decoration: underline">(RSS)</a>'
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.