clean up pages and view

master
alice 3 years ago
parent d48b48aad1
commit 2dd5a01872

@ -13,8 +13,9 @@ from django.utils.http import is_safe_url
from django.utils.translation import ( from django.utils.translation import (
LANGUAGE_SESSION_KEY, check_for_language, LANGUAGE_SESSION_KEY, check_for_language,
) )
from django.template.loader import TemplateDoesNotExist, get_template from django.template.loader import TemplateDoesNotExist, get_template, select_template
from django.template import Template from django.template import Template
from django.template.response import TemplateResponse
import django_lcore import django_lcore
from constance import config from constance import config
import frontmatter import frontmatter
@ -80,44 +81,29 @@ def page(request, name):
basename = 'pages/' + name basename = 'pages/' + name
# For "pages", entire files are translated. We try the most # Try to render a HTML template
# specific first
files = [
basename + '.' + get_language() + '.md',
basename + '.en.md',
basename + '.md',
]
try: try:
#html_template = get_template(basename + '.html') html_template = get_template(basename + '.html')
return render(request, basename + '.html') return TemplateResponse(request, html_template).render()
except TemplateDoesNotExist as e: except TemplateDoesNotExist:
print(basename + '.html', "not found, looking for md", repr(e))
pass pass
for file in files: md_template = select_template([
try: basename + '.' + get_language() + '.md',
template = get_template(file) basename + '.en.md',
except TemplateDoesNotExist: ])
continue
page_source = template.render(None, request)
page = frontmatter.loads(page_source)
page_md = page.content
title = page.metadata.get('Title', "")
toc_depth = int(page.metadata.get('TocDepth', 6))
md = markdown.Markdown(extensions=[
TocExtension(toc_depth=toc_depth),
'markdown.extensions.meta',
CodeHiliteExtension(noclasses=True),
])
page_html = md.convert(page_md)
page_source = md_template.render(None, request)
page_fm = frontmatter.loads(page_source)
page_md = page_fm.content
ctx = dict(content=page_html, title=title) title = page_fm.metadata.get('Title', "")
return render(request, 'ccvpn/page.html', ctx) md_inst = markdown.Markdown(extensions=[
'markdown.extensions.meta',
CodeHiliteExtension(noclasses=True),
])
page_html = md_inst.convert(page_md)
return HttpResponseNotFound() ctx = dict(content=page_html, title=title)
return render(request, 'ccvpn/page.html', ctx)

@ -1,26 +0,0 @@
---
Title: Install on Chrome OS
---
1. Téléchargez le fichier .onc requis dans [votre compte](/account/config), en choisissant
Chrome OS comme OS.
2. Allez sur [chrome://net-internals/](chrome://net-internals/#chromeos), partie ChromeOS, et importez le fichier téléchargé.
Aucun message ne sera affiché, mais il devrait avoir été importé quand même.
<img src="/static/pageimg/install_chromeos_1_arrows.png" alt="screenshot" />
3. Ouvrez les options de Chrome OS, cliquez sur Private Network (en dessous de Ethernet et Wi-Fi),
et sélectionnez CCrypto VPN.
<img src="/static/pageimg/install_chromeos_2.png" alt="screenshot" />
4. Cliquez ensuite sur le bouton Connect, entrez votre mot de passe, et appuyez sur Connect
à nouveau.
<img src="/static/pageimg/install_chromeos_3.png" alt="screenshot" />
5. Attendez quelques secondes et le VPN devrait être connecté.
<img src="/static/pageimg/install_chromeos_4.png" alt="screenshot" />

@ -20,9 +20,6 @@ See our published source code for technical details.
We use no additional external analytics or advertisement network on our website. We use no additional external analytics or advertisement network on our website.
All these informations are strictly kept by CCrypto and will not be shared to a third party unless required by law (see 4.). All these informations are strictly kept by CCrypto and will not be shared to a third party unless required by law (see 4.).
Our websites embeds a support chat widget operated by Tawk.to. It can be blocked
without breaking the rest of the website and tickets can be used for secure communication.
### 2. VPN Logging ### 2. VPN Logging

Loading…
Cancel
Save