From c50fe7258716e144856bc11df1e67f5faedb1348 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 8 May 2014 10:51:58 +0530 Subject: [PATCH] Convert help pages to templates --- modules/installed/help/help.py | 57 ++------------------- modules/installed/help/templates/about.html | 43 ++++++++++++++++ modules/installed/help/templates/help.html | 27 ++++++++++ templates/base.html | 12 +++-- 4 files changed, 82 insertions(+), 57 deletions(-) create mode 100644 modules/installed/help/templates/about.html create mode 100644 modules/installed/help/templates/help.html diff --git a/modules/installed/help/help.py b/modules/installed/help/help.py index 1f8407af5..927f9e6c6 100644 --- a/modules/installed/help/help.py +++ b/modules/installed/help/help.py @@ -20,62 +20,15 @@ class Help(PagePlugin): @cherrypy.expose def index(self): - main=""" -

There are a variety of places to go for help with Plinth - and the box it runs on.

- -

This front end has a developer's manual. It isn't - complete, but it is the first place to look. Feel free to - offer suggestions, edits, and screenshots for completing - it!

- -

A section of - the Debian wiki is devoted to the %(box)s. At some - point the documentation in the wiki and the documentation in - the manual should dovetail.

- -

There - are Debian gurus in the \#debian channels of both - irc.freenode.net and irc.oftc.net. They probably don't know - much about the %(box)s and almost surely know nothing of - this front end, but they are an incredible resource for - general Debian issues.

- -

There is no FAQ because - the question frequency is currently zero for all - questions.

- """ % {'box':cfg.box_name} - return util.render_template(title="Documentation and FAQ", main=main) + return util.render_template(template='help', + title=_('Documentation and FAQ')) @cherrypy.expose def about(self): - return util.render_template(title=_("About the %s" % cfg.box_name), - main=""" - -

We live in a world where our use of the network is - mediated by those who often do not have our best - interests at heart. By building software that does not rely on - a central service, we can regain control and privacy. By - keeping our data in our homes, we gain useful legal - protections over it. By giving back power to the users over - their networks and machines, we are returning the Internet to - its intended peer-to-peer architecture.

+ return util.render_template( + template='about', + title=_('About the {box_name}').format(box_name=cfg.box_name)) -

In order to bring about the new network order, it is - paramount that it is easy to convert to it. The hardware it - runs on must be cheap. The software it runs on must be easy to - install and administrate by anybody. It must be easy to - transition from existing services.

-

Learn more »

""", - sidebar_right=_("""Our Goal

There are a number of projects working to realize a future - of distributed services; we aim to bring them all together in - a convenient package.

- -

For more information about the FreedomBox project, see the - Debian - Wiki.

- """)) class View(PagePlugin): def __init__(self, *args, **kwargs): diff --git a/modules/installed/help/templates/about.html b/modules/installed/help/templates/about.html new file mode 100644 index 000000000..51ca7d9e8 --- /dev/null +++ b/modules/installed/help/templates/about.html @@ -0,0 +1,43 @@ +{% extends 'login_nav.html' %} + +{% block main_block %} + + + +

We live in a world where our use of the network is mediated by +those who often do not have our best interests at heart. By building +software that does not rely on a central service, we can regain +control and privacy. By keeping our data in our homes, we gain useful +legal protections over it. By giving back power to the users over +their networks and machines, we are returning the Internet to its +intended peer-to-peer architecture.

+ +

In order to bring about the new network order, it is +paramount that it is easy to convert to it. The hardware it +runs on must be cheap. The software it runs on must be easy to +install and administrate by anybody. It must be easy to +transition from existing services.

+ +

Learn more +»

+ +{% endblock %} + +{% block sidebar_right_block %} + + + +{% endblock %} diff --git a/modules/installed/help/templates/help.html b/modules/installed/help/templates/help.html new file mode 100644 index 000000000..be405db97 --- /dev/null +++ b/modules/installed/help/templates/help.html @@ -0,0 +1,27 @@ +{% extends 'login_nav.html' %} + +{% block main_block %} + +

There are a variety of places to go for help with +{{ cfg.product_name }} and the box it runs on.

+ +

This front end has a +developer's manual. It isn't complete, but it is the first place +to look. Feel free to offer suggestions, edits, and screenshots for +completing it!

+ +

A +section of the Debian wiki is devoted to the {{ cfg.box_name }}. +At some point the documentation in the wiki and the documentation in +the manual should dovetail.

+ +

There are Debian gurus in the \#debian channels of both +irc.freenode.net and irc.oftc.net. They probably don't know much +about the {{ cfg.box_name }} and almost surely know nothing of this +front end, but they are an incredible resource for general Debian +issues.

+ +

There is no FAQ because +the question frequency is currently zero for all questions.

+ +{% endblock %} diff --git a/templates/base.html b/templates/base.html index 182fe0f81..c08b3b8ea 100644 --- a/templates/base.html +++ b/templates/base.html @@ -129,11 +129,13 @@ {{ sidebar_left|safe }} {% endif %} - {% if sidebar_right %} - - {% endif %} + {% block sidebar_right_block %} + {% if sidebar_right %} + + {% endif %} + {% endblock %} {% endif %}