diff --git a/aurweb/routers/packages.py b/aurweb/routers/packages.py index 80a4221b..0bd19041 100644 --- a/aurweb/routers/packages.py +++ b/aurweb/routers/packages.py @@ -28,6 +28,8 @@ async def package_base(request: Request, package: str): context["packages_count"] = package.packages.count() context["keywords"] = package.keywords.all() context["comments"] = package.comments.all() + context["is_maintainer"] = request.user.is_authenticated() \ + and request.user.Username == package.Maintainer.Username return render_template(request, "pkgbase.html", context) diff --git a/templates/partials/packages/comments.html b/templates/partials/packages/comments.html index 48bc88e6..39b0d2b4 100644 --- a/templates/partials/packages/comments.html +++ b/templates/partials/packages/comments.html @@ -14,18 +14,23 @@
- Git commit identifiers referencing commits in the AUR package - repository and URLs are converted to links automatically. - - Markdown syntax - - is partially supported. + {{ + "Git commit identifiers referencing commits in the AUR package" + " repository and URLs are converted to links automatically." + | tr + }} + {{ + "%sMarkdown Syntax%s is partially supported." + | tr + | format('', '') + | safe + }}
- +
@@ -34,22 +39,35 @@
- Latest Comments + {{ "Latest Comments" | tr }}
- {% set commentTimestamp = comment.CommentTS | dt | as_timezone(timezone) %} - {{ comment.User.Username }} - commented on {{ "%s" | tr | format(commentTimestamp.strftime("%Y-%m-%d %H:%M")) }} - {% if request.user.is_authenticated() and pkgbase.Maintainer.Username == request.user.Username %} + {% set commented_at = comment.CommentTS | dt | as_timezone(timezone) %} + {% set view_account_info = 'View account information for %s' | tr | format(comment.User.Username) %} + {{ + "%s commented on %s" | tr | format( + '%s' | format( + comment.User.Username, + view_account_info, + comment.User.Username + ), + '%s' | format( + comment.ID, + commented_at.strftime("%Y-%m-%d %H:%M") + ) + ) + | safe + }} + {% if is_maintainer %}
{{ comment.Comments }}
+{{ comment.RenderedComment | safe }}
Package Actions
+{{ "Package Actions" | tr }}
Package Base Details: {{ pkgbase.Name }}
+Package Details: {{ pkgbase.Name }}
{% set result = pkgbase %} {% set pkgname = "result.Name" %} @@ -11,17 +11,17 @@{{ git_clone_uri_priv | format(pkgbase.Name) }} (click to copy) + {{ git_clone_uri_anon | format(pkgbase.Name) }} ({{ "read-only" | tr }}, {{ "click to copy" | tr }}) + {% if is_maintainer %} +
{{ git_clone_uri_priv | format(pkgbase.Name) }} ({{ "click to copy" | tr }}) {% endif %}
Packages ({{ packages_count }})
{% for result in packages %} -- {{ result.Name }}
+ -
+
+ {{ result.Name }}
+
+
{% endfor %}