From 38fe07cd93e62097fc5ccd79ba4b2ce01bc6c7b9 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 17 Sep 2015 13:01:12 +0530 Subject: [PATCH] help: Serve FreedomBox manual - Remove FAQ menu entry - Remove Wiki entry and place a link from index page. - Update index content to point to IRC, wiki, manual and mailing list. --- plinth/__main__.py | 11 ++++++- plinth/modules/help/help.py | 22 ++++++-------- plinth/modules/help/templates/help_index.html | 30 ++++++++----------- .../{help_detail.html => help_manual.html} | 8 +++++ plinth/modules/help/urls.py | 2 +- 5 files changed, 40 insertions(+), 33 deletions(-) rename plinth/modules/help/templates/{help_detail.html => help_manual.html} (87%) diff --git a/plinth/__main__.py b/plinth/__main__.py index 044e89c75..3c009f5c9 100644 --- a/plinth/__main__.py +++ b/plinth/__main__.py @@ -28,7 +28,6 @@ import stat import sys import cherrypy -from cherrypy import _cpserver from cherrypy.process.plugins import Daemonizer from plinth import cfg @@ -123,6 +122,16 @@ def setup_server(): cherrypy.tree.mount(None, js_url, config) logger.debug('Serving javascript directory %s on %s', js_dir, js_url) + manual_dir = os.path.join(cfg.doc_dir, 'images') + manual_url = '/'.join([cfg.server_dir, 'help/manual/images']) \ + .replace('//', '/') + config = { + '/': {'tools.staticdir.root': manual_dir, + 'tools.staticdir.on': True, + 'tools.staticdir.dir': '.'}} + cherrypy.tree.mount(None, manual_url, config) + logger.debug('Serving manual images %s on %s', manual_dir, manual_url) + for module_import_path in module_loader.loaded_modules: module = importlib.import_module(module_import_path) module_name = module_import_path.split('.')[-1] diff --git a/plinth/modules/help/help.py b/plinth/modules/help/help.py index d449820f1..8b99d0182 100644 --- a/plinth/modules/help/help.py +++ b/plinth/modules/help/help.py @@ -34,12 +34,8 @@ def init(): 'help:index', 101) menu.add_urlname(_('Where to Get Help'), 'glyphicon-search', 'help:index_explicit', 5) - menu.add_urlname(_('Developer\'s Manual'), 'glyphicon-info-sign', - 'help:helppage', 10, url_args=('plinth',)) - menu.add_urlname(_('FAQ'), 'glyphicon-question-sign', 'help:helppage', 20, - url_args=('faq',)) - menu.add_item(_('%s Wiki' % cfg.box_name), 'glyphicon-pencil', - 'http://wiki.debian.org/FreedomBox', 30) + menu.add_urlname(_('FreedomBox Manual'), 'glyphicon-info-sign', + 'help:manual', 10) menu.add_urlname(_('About'), 'glyphicon-star', 'help:about', 100) @@ -61,15 +57,15 @@ def about(request): @public -def helppage(request, page): - """Serve a help page from the 'doc' directory""" +def manual(request): + """Serve the manual page from the 'doc' directory""" try: - with open(os.path.join(cfg.doc_dir, '%s.part.html' % page), 'r') \ - as input_file: + with open(os.path.join(cfg.doc_dir, 'freedombox-manual.part.html'), 'r') \ + as input_file: content = input_file.read() except IOError: raise Http404 - title = _('%s Documentation') % cfg.product_name - return TemplateResponse(request, 'help_detail.html', - {'title': title, 'content': content}) + return TemplateResponse(request, 'help_manual.html', + {'title': _('FreedomBox Manual'), + 'content': content}) diff --git a/plinth/modules/help/templates/help_index.html b/plinth/modules/help/templates/help_index.html index 21b62a734..ab5db705e 100644 --- a/plinth/modules/help/templates/help_index.html +++ b/plinth/modules/help/templates/help_index.html @@ -22,26 +22,20 @@

Help

-

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

+

The FreedomBox Manual is the + best place to start for information regarding {{ cfg.box_name }}.

-

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!

+

FreedomBox project wiki contains further + information.

-

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.

+

To seek help from FreedomBox community, queries may be posted on + the + + mailing list. The list archives also contain information about + problems faced by other users and possible solutions.

-

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.

+

Many FreedomBox contributors and users are also available on the + #freedombox channel of the irc.oftc.net IRC network.

{% endblock %} diff --git a/plinth/modules/help/templates/help_detail.html b/plinth/modules/help/templates/help_manual.html similarity index 87% rename from plinth/modules/help/templates/help_detail.html rename to plinth/modules/help/templates/help_manual.html index 8756fb05a..b59140290 100644 --- a/plinth/modules/help/templates/help_detail.html +++ b/plinth/modules/help/templates/help_manual.html @@ -18,6 +18,14 @@ # {% endcomment %} +{% block page_head %} + +{% endblock %} + {% block content %} {{ content|safe }} {% endblock %} diff --git a/plinth/modules/help/urls.py b/plinth/modules/help/urls.py index c43c6f5f5..24efd2113 100644 --- a/plinth/modules/help/urls.py +++ b/plinth/modules/help/urls.py @@ -30,5 +30,5 @@ urlpatterns = patterns( # pylint: disable-msg=C0103 url(r'^help/$', 'index', name='index'), url(r'^help/index/$', 'index', name='index_explicit'), url(r'^help/about/$', 'about', name='about'), - url(r'^help/page/(plinth|hacking|faq)/$', 'helppage', name='helppage'), + url(r'^help/manual/$', 'manual', name='manual'), )