Skip to content

Commit bed5f4f

Browse files
committed
Add request arg to format_npf in rss templates
1 parent a4256b1 commit bed5f4f

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{% from "macros/error_details.jinja" import error_details %}
2+
3+
<figure class="alert">
4+
<svg class="icon" xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 -960 960 960" width="48px"><path d="M453-280h60v-240h-60v240Zm26.98-314q14.02 0 23.52-9.2T513-626q0-14.45-9.48-24.22-9.48-9.78-23.5-9.78t-23.52 9.78Q447-640.45 447-626q0 13.6 9.48 22.8 9.48 9.2 23.5 9.2Zm.29 514q-82.74 0-155.5-31.5Q252-143 197.5-197.5t-86-127.34Q80-397.68 80-480.5t31.5-155.66Q143-709 197.5-763t127.34-85.5Q397.68-880 480.5-880t155.66 31.5Q709-817 763-763t85.5 127Q880-563 880-480.27q0 82.74-31.5 155.5Q817-252 763-197.68q-54 54.31-127 86Q563-80 480.27-80Zm.23-60Q622-140 721-239.5t99-241Q820-622 721.19-721T480-820q-141 0-240.5 98.81T140-480q0 141 99.5 240.5t241 99.5Zm-.5-340Z"/></svg>
5+
<figcaption>
6+
<h4> Error: Unable to render post </h4>
7+
<p> Someone has gone wrong during the rendering of this post </p>
8+
{{error_details(request, exception.__name__, exception.message, "")}}
9+
</figcaption>
10+
</figure>
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{% macro error_details(request, name, message, context) %}
2+
<details open="">
3+
<summary>Technical details</summary>
4+
<pre>{{translate(request.ctx.language, "priviblur_error_generic_technical_details_error_name", substitution=name)}}</pre>
5+
{% if exception_message %}<pre>{{translate(request.ctx.language, "priviblur_error_generic_technical_details_error_message", substitution='"' + message + '"')}}</pre>{% endif %}
6+
<pre>{{-translate(request.ctx.language, "priviblur_error_generic_technical_details_error_context")}}</pre>
7+
<pre>{{context}}</pre>
8+
</details>
9+
{% endmacro %}

src/templates/rss/blog/base_blog.xml.jinja

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
{% block description %}
1616
{%- if blog.blog_info.description_npf -%}
17-
{%- set _, description_html = format_npf(blog.blog_info.description_npf) -%}
17+
{%- set _, description_html = format_npf(blog.blog_info.description_npf, request=request) -%}
1818
{%- else -%}
1919
{%- set description_html = "" %}
2020
{%- endif -%}

src/templates/rss/post/notes/note/reply.xml.jinja

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
note.layout,
1515
note.blog.name,
1616
note.id,
17+
request=request
1718
)
1819
-%}
1920
{{-content_tag-}}

0 commit comments

Comments
 (0)