Skip to content

Commit

Permalink
Merge 336f838 into 7a379e6
Browse files Browse the repository at this point in the history
  • Loading branch information
therealmarv committed Jan 26, 2017
2 parents 7a379e6 + 336f838 commit 284b4ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 8 additions & 2 deletions pybossa/view/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
"""Help view for PYBOSSA."""
from flask import Blueprint
from flask import render_template
from pybossa.util import handle_content_type
from pybossa.cache import projects as cached_projects
from pybossa.cache import categories as cached_cat
from random import choice
from readability.readability import Document

blueprint = Blueprint('help', __name__)

Expand Down Expand Up @@ -60,5 +62,9 @@ def cookies_policy():
@blueprint.route('/privacy')
def privacy():
"""Render help/privacy policy page."""
return render_template('help/privacy.html',
title='Help: Cookies Policy')
# use readability to remove styling and headers
cleaned_up_content = Document(render_template('help/privacy.html')).summary()
response = dict(template='help/privacy.html',
content=cleaned_up_content,
title='Privacy Policy')
return handle_content_type(response)
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
"pyjwt",
"flask_json_multidict",
"flask-cors>=3.0.2, <3.0.3",
"webassets>=0.12.1, <0.12.2"
"webassets>=0.12.1, <0.12.2",
"readability-lxml>=0.6.2, <1.0"
]

setup(
Expand Down

0 comments on commit 284b4ac

Please sign in to comment.