/edit/", methods=["GET", "POST"])
@login_required
@is_package_page
def edit_release(package, id):
- release : PackageRelease = PackageRelease.query.get(id)
+ release: PackageRelease = PackageRelease.query.get(id)
if release is None or release.package != package:
abort(404)
diff --git a/app/models/packages.py b/app/models/packages.py
index ba312304..748b1246 100644
--- a/app/models/packages.py
+++ b/app/models/packages.py
@@ -1098,6 +1098,15 @@ class PackageRelease(db.Model):
downloads = db.Column(db.Integer, nullable=False, default=0)
release_notes = db.Column(db.UnicodeText, nullable=True, default=None)
+ @property
+ def summary(self) -> typing.Optional[str]:
+ if self.release_notes is None:
+ return None
+ if self.release_notes.startswith("-") or self.release_notes.startswith("*"):
+ return None
+
+ return self.release_notes.split("\n")[0]
+
min_rel_id = db.Column(db.Integer, db.ForeignKey("minetest_release.id"), nullable=True, server_default=None)
min_rel = db.relationship("MinetestRelease", foreign_keys=[min_rel_id])
diff --git a/app/templates/base.html b/app/templates/base.html
index db060af1..d9940bce 100644
--- a/app/templates/base.html
+++ b/app/templates/base.html
@@ -20,9 +20,23 @@
{% if noindex -%}
-
+
{%- endif %}
+
+
+
+
+
+
+
+
{% block headextra %}{% endblock %}
diff --git a/app/templates/feeds/json_to_atom.xml b/app/templates/feeds/json_to_atom.xml
new file mode 100644
index 00000000..252c980d
--- /dev/null
+++ b/app/templates/feeds/json_to_atom.xml
@@ -0,0 +1,39 @@
+
+
+ {{ feed["title"] }}
+ {{ feed["description"] }}
+
+
+ {{ feed["items"][0]["date_published"] }}
+ {{ feed["feed_url"] }}
+ {% if feed["authors"] %}
+
+ {{ feed["authors"][0]["name"] }}
+
+ {% endif %}
+ {%- for post in feed["items"] %}
+
+ {{ post["title"] | escape }}
+
+ {{ post["date_published"] }}
+ {{ post["date_published"] }}
+ {{ post["url"] }}
+
+ {{ post["summary"] | escape }}
+
+
+ {{ post["content_html"] | escape }}
+
+
+ {{ post["author"] }}
+
+ {% for tag in post["tags"] %}
+
+ {% endfor %}
+ {% if post["image"] %}
+
+
+ {% endif %}
+
+ {%- endfor %}
+
diff --git a/app/templates/packages/release_view.html b/app/templates/packages/release_view.html
new file mode 100644
index 00000000..4681d690
--- /dev/null
+++ b/app/templates/packages/release_view.html
@@ -0,0 +1,45 @@
+{% extends "packages/package_base.html" %}
+
+{% block title %}
+ {{ package.title }}
+{% endblock %}
+
+{% block content %}
+ {% if package.check_perm(current_user, "MAKE_RELEASE") %}
+
+ {{ _("Edit") }}
+
+ {% endif %}
+
+ {{ self.title() }}
+
+
+ {{ _("%(title)s by %(author)s", title=package.title, author=package.author.display_name) }}
+
+
+
+
+ {{ _("Name") }}: {{ release.name }}
+ {{ _("Title") }}: {{ release.title }}
+
+ {% if release.release_notes %}
+
+ {{ release.release_notes | markdown }}
+
+ {% endif %}
+
+ {{ _("URL") }}: {{ release.url }}
+
+ {% if release.commit_hash %}
+
+ {{ _("Commit Hash") }}: {{ release.commit_hash }}
+
+ {% endif %}
+
+ {% if release.task_id %}
+
+ {{ _("Importing...") }}
+ {{ _("view task") }}
+
+ {% endif %}
+{% endblock %}
diff --git a/app/templates/packages/view.html b/app/templates/packages/view.html
index a3f06fbf..212cec69 100644
--- a/app/templates/packages/view.html
+++ b/app/templates/packages/view.html
@@ -16,6 +16,13 @@
{% if package.get_thumb_url(3, True, "png") -%}
{%- endif %}
+
+
+
{% endblock %}
{% block scriptextra %}