Changeset - 1c38ad017928
[Not reviewed]
0 8 0
Ben Sturmfels (bsturmfels) - 2 years ago 2021-12-17 21:58:53
ben@sturm.com.au
Revert removal of "safe" template tag from blog/news headlines.

Conservancy use HTML entities in their titles.
8 files changed with 10 insertions and 10 deletions:
0 comments (0 inline, 0 general)
www/conservancy/templates/blog/entry_detail.html
Show inline comments
 
{% extends "base_blog.html" %}
 

	
 
{% block head %}
 
{% include "opengraph_partial.html" with url=object.get_absolute_url title=object.headline description=object.get_description %}
 
{% include "opengraph_urllist_partial.html" with property='image' urls=object.get_one_image_url fallback='/img/conservancy-logo.png' %}
 
{% include "opengraph_urllist_partial.html" with property='video' urls=object.get_one_video_url %}
 
{% endblock %}
 

	
 
{% block subtitle %}{{ object.headline|striptags }} - Conservancy Blog - {% endblock %}
 
{% block subtitle %}{{ object.headline|striptags|safe }} - Conservancy Blog - {% endblock %}
 

	
 
{% block content %}
 
<div class="breadcrumbs">
 
  <p><a href="/">Home</a> / <a href="/news/">News</a> / <a href="/blog/">Blog</a></p>
 
</div>
 

	
 
{% include "blog/entry_partial.html" with entry=object htag="h2" only %}
 

	
 
<p class="blog-comments">Please email any comments on this entry to
 
  <a href="mailto:info@sfconservancy.org">info@sfconservancy.org</a>.</p>
 

	
 
<p><span class="continued"><a href="/blog/">Other Conservancy Blog entries&hellip;</a></span></p>
www/conservancy/templates/blog/entry_partial.html
Show inline comments
...
 
@@ -9,25 +9,25 @@ This partial accepts these optional parameters:
 
* `show`: How much of the BlogEntry to render.  Accepted values are
 
  "headline", "dateline", "summary", "summary+tags", and "body".
 
  Every value will render the parts listed before it, except "body"
 
  doesn't include "summary".  Default "body".
 
* `htag`: Name of the HTML tag to render the entry headline.  Default "h3".
 

	
 
{% endcomment %}
 

	
 
<div class="blog-entry">
 

	
 
<{{ htag|default:"h3" }} class="clear"
 
  >{% if show|default:"body" != "body" %}<a href="{{ entry.get_absolute_url }}"
 
  >{% endif %}{{ entry.headline }}{% if show|default:"body" != "body" %}</a>{% endif %}</{{ htag|default:"h3" }}>
 
  >{% endif %}{{ entry.headline|safe }}{% if show|default:"body" != "body" %}</a>{% endif %}</{{ htag|default:"h3" }}>
 

	
 
{% if show != "headline" %}
 
<p class="date">by <span class="author">{{ entry.author.formal_name }}</span>
 
  on {{ entry.pub_date|date:"F j, Y" }}
 
</p>
 

	
 
{% if show != "dateline" %}
 

	
 
{% if show|default:"body" == "body" %}
 
{{ entry.body|safe }}
 
{% else %}
 
{{ entry.summary|safe }}
www/conservancy/templates/feeds/blog_title.html
Show inline comments
 
{{ obj.headline|striptags }}
 
{{ obj.headline|striptags|safe }}
www/conservancy/templates/feeds/news_description.html
Show inline comments
 
{% if obj.subhead %}<p><strong>{{ obj.subhead }}</strong></p>{% endif %}
 
{% if obj.subhead %}<p><strong>{{ obj.subhead|safe }}</strong></p>{% endif %}
 
{{ obj.summary|safe }}
 
{{ obj.body|safe }}
www/conservancy/templates/feeds/news_title.html
Show inline comments
 
{{ obj.headline|striptags }}
 
{{ obj.headline|striptags|safe }}
www/conservancy/templates/news/pressrelease_detail.html
Show inline comments
 
{% extends "base_news.html" %}
 

	
 
{% block head %}
 
{% include "opengraph_partial.html" with url=object.get_absolute_url title=object.headline description=object.get_description %}
 
{% include "opengraph_urllist_partial.html" with property='image' urls=object.get_one_image_url fallback='/img/conservancy-logo.png' %}
 
{% include "opengraph_urllist_partial.html" with property='video' urls=object.get_one_video_url %}
 
{% endblock %}
 

	
 
{% block subtitle %}{{ object.headline|striptags }} - {% endblock %}
 
{% block subtitle %}{{ object.headline|striptags|safe }} - {% endblock %}
 

	
 
{% block content %}
 

	
 
<div id="mainContent">
 
  <div class="breadcrumbs">
 
    <p><a href="/">Home</a> / <a href="/news/">News</a></p>
 
  </div>
 
{% include "news/pressrelease_partial.html" with pressr=object htag="h2" only %}
 
</div>
 
{% endblock %}
www/conservancy/templates/news/pressrelease_partial.html
Show inline comments
...
 
@@ -10,31 +10,31 @@ This partial accepts these optional parameters:
 
  "headline", "dateline", "subhead", "summary", and "body".
 
  Every value will render the parts listed before it.  Default "body".
 
* `htag`: Name of the HTML tag to render the pressr headline.
 
  If you're passing show="subhead" or a greater detail level, this
 
  must be a headline tag h1 through h5, inclusive.  Default "h3".
 

	
 
{% endcomment %}
 

	
 
<div class="press-release">
 

	
 
<{{ htag|default:"h3" }} class="clear"
 
  >{% if show|default:"body" != "body" %}<a href="{{ pressr.get_absolute_url }}"
 
  >{% endif %}{{ pressr.headline }}{% if show|default:"body" != "body" %}</a>{% endif %}</{{ htag|default:"h3" }}>
 
  >{% endif %}{{ pressr.headline|safe }}{% if show|default:"body" != "body" %}</a>{% endif %}</{{ htag|default:"h3" }}>
 

	
 
{% if show != "headline" %}
 
{% if show != "dateline" and pressr.subhead %}
 
  {# This filter sequence generates the "next" hN tag from htag #}
 
  <h{{ htag|default:"3"|last|get_digit:1|add:1 }}
 
     >{{ pressr.subhead }}</h{{ htag|default:"3"|last|get_digit:1|add:1 }}>
 
     >{{ pressr.subhead|safe }}</h{{ htag|default:"3"|last|get_digit:1|add:1 }}>
 
{% endif %}
 

	
 
<p class="date">{{ pressr.pub_date|date:"F j, Y" }}</p>
 

	
 
{% if show != "dateline" and show != "subhead" %}
 
  {% if pressr.summary %}
 
    {{ pressr.summary|safe }}
 
  {% endif %}
 

	
 
  {% if pressr.body %}
 
    {% if show == "summary" %}
 
      <p><a class="continued" href="{{ pressr.get_absolute_url }}">Read More&hellip;</a></p>
www/conservancy/templates/opengraph_partial.html
Show inline comments
...
 
@@ -27,18 +27,18 @@ normally shouldn't need to:
 
<meta property="twitter:site" content="{{ twitter_site|default:"@conservancy" }}">
 

	
 
<meta property="og:type" content="{{ type|default:"website" }}">
 
<meta property="og:locale" content="{{ locale|default:"en_US" }}">
 
<meta property="og:site_name" content="{{ site_name|default:"Software Freedom Conservancy" }}">
 

	
 
{% if url %}
 
{% load fill_url %}
 
<meta property="og:url" content="{{ url|fill_url:host_url }}">
 
{% endif %}
 

	
 
{% if title %}
 
<meta property="og:title" content="{{ title|striptags }}">
 
<meta property="og:title" content="{{ title|striptags|safe }}">
 
{% endif %}
 

	
 
{% if description %}
 
<meta property="og:description" content="{{ description|striptags }}">
 
<meta property="og:description" content="{{ description|striptags|safe }}">
 
{% endif %}
0 comments (0 inline, 0 general)