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 = ''): ...@@ -58,11 +58,15 @@ def get_doc_url(page, anchor = ''):
''' '''
Return URL to documentation. Return URL to documentation.
''' '''
# Should we use tagged release or latest version
if RUNNING_GIT and not GIT_RELEASE: if RUNNING_GIT and not GIT_RELEASE:
version = 'latest' version = 'latest'
else: else:
version = 'weblate-%s' % VERSION version = 'weblate-%s' % VERSION
# Generate URL
url = 'http://weblate.readthedocs.org/en/%s/%s.html' % (version, page) url = 'http://weblate.readthedocs.org/en/%s/%s.html' % (version, page)
# Optionally append anchor
if anchor != '': if anchor != '':
url += '#%s' % anchor url += '#%s' % anchor
return url return url
...@@ -29,14 +29,22 @@ import os ...@@ -29,14 +29,22 @@ import os
@staff_member_required @staff_member_required
def report(request): def report(request):
'''
Provides report about git status of all repos.
'''
return render_to_response("admin/report.html", RequestContext(request, { return render_to_response("admin/report.html", RequestContext(request, {
'subprojects': SubProject.objects.all() 'subprojects': SubProject.objects.all()
})) }))
@staff_member_required @staff_member_required
def ssh(request): 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') key_path = os.path.expanduser('~/.ssh/id_rsa.pub')
# Check whether we can generate SSH key
try: try:
ret = os.system('which ssh-keygen > /dev/null 2>&1') ret = os.system('which ssh-keygen > /dev/null 2>&1')
can_generate = ret == 0 can_generate = ret == 0
...@@ -54,6 +62,7 @@ def ssh(request): ...@@ -54,6 +62,7 @@ def ssh(request):
except: except:
messages.error(request, _('Failed to generate key!')) messages.error(request, _('Failed to generate key!'))
# Read key data if it exists
if os.path.exists(key_path): if os.path.exists(key_path):
key_data = file(key_path).read() key_data = file(key_path).read()
key_type, key_fingerprint, key_id = key_data.strip().split() 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