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.
This commit is contained in:
Sunil Mohan Adapa 2015-09-17 13:01:12 +05:30 committed by James Valleroy
parent 78fb03f9cc
commit 38fe07cd93
5 changed files with 40 additions and 33 deletions

View File

@ -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]

View File

@ -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})

View File

@ -22,26 +22,20 @@
<h2>Help</h2>
<p>There are a variety of places to go for help with
{{ cfg.product_name }} and the box it runs on.</p>
<p>The <a href={% url 'help:manual' %}>FreedomBox Manual</a> is the
best place to start for information regarding {{ cfg.box_name }}.</p>
<p>This front end has a <a href="{% url 'help:helppage' 'plinth' %}">
developer's manual</a>. It isn't complete, but it is the first place
to look. Feel free to offer suggestions, edits, and screenshots for
completing it!</p>
<p><a href="http://wiki.debian.org/FreedomBox"
target="_blank">FreedomBox project wiki </a> contains further
information.</p>
<p><a href="http://wiki.debian.org/FreedomBox" target="_blank">A
section of the Debian wiki</a> is devoted to the {{ cfg.box_name }}.
At some point the documentation in the wiki and the documentation in
the manual should dovetail.</p>
<p>To seek help from FreedomBox community, queries may be posted on
the
<a href="https://lists.alioth.debian.org/mailman/listinfo/freedombox-discuss">
mailing list</a>. The list archives also contain information about
problems faced by other users and possible solutions.</p>
<p>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.</p>
<p>There is no <a href="{% url 'help:helppage' 'faq' %}">FAQ</a> because
the question frequency is currently zero for all questions.</p>
<p>Many FreedomBox contributors and users are also available on the
#freedombox channel of the irc.oftc.net IRC network.</p>
{% endblock %}

View File

@ -18,6 +18,14 @@
#
{% endcomment %}
{% block page_head %}
<style type="text/css">
dd {
margin-left: 30px;
}
</style>
{% endblock %}
{% block content %}
{{ content|safe }}
{% endblock %}

View File

@ -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'),
)