Commit 6c9f9701 authored by Michal Čihař's avatar Michal Čihař

Add some docs

parent 7c7cf538
......@@ -58,11 +58,15 @@ def get_doc_url(page, anchor = ''):
'''
Return URL to documentation.
'''
# Should we use tagged release or latest version
if RUNNING_GIT and not GIT_RELEASE:
version = 'latest'
else:
version = 'weblate-%s' % VERSION
# Generate URL
url = 'http://weblate.readthedocs.org/en/%s/%s.html' % (version, page)
# Optionally append anchor
if anchor != '':
url += '#%s' % anchor
return url
......@@ -29,14 +29,22 @@ import os
@staff_member_required
def report(request):
'''
Provides report about git status of all repos.
'''
return render_to_response("admin/report.html", RequestContext(request, {
'subprojects': SubProject.objects.all()
}))
@staff_member_required
def ssh(request):
'''
Show information and manipulate with SSH key.
'''
# Path to key, we default to RSA keys
key_path = os.path.expanduser('~/.ssh/id_rsa.pub')
# Check whether we can generate SSH key
try:
ret = os.system('which ssh-keygen > /dev/null 2>&1')
can_generate = ret == 0
......@@ -54,6 +62,7 @@ def ssh(request):
except:
messages.error(request, _('Failed to generate key!'))
# Read key data if it exists
if os.path.exists(key_path):
key_data = file(key_path).read()
key_type, key_fingerprint, key_id = key_data.strip().split()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment