summaryrefslogtreecommitdiffstats
path: root/doc-publik
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2019-03-06 15:22:05 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2019-03-06 15:22:05 (GMT)
commit2da1526175da8692febb2a4fba5deab357d75a0f (patch)
tree8699f6e6135ee5cf770618b51acf47ed3c211083 /doc-publik
parent456ce91aefe0f5bf538ef15bf42c434fc6e204d1 (diff)
downloadmisc-fred-2da1526175da8692febb2a4fba5deab357d75a0f.zip
misc-fred-2da1526175da8692febb2a4fba5deab357d75a0f.tar.gz
misc-fred-2da1526175da8692febb2a4fba5deab357d75a0f.tar.bz2
doc: add a notice on pages living on redmine
Diffstat (limited to 'doc-publik')
-rw-r--r--doc-publik/update-publik-doc-from-redmine.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/doc-publik/update-publik-doc-from-redmine.py b/doc-publik/update-publik-doc-from-redmine.py
index 0474453..453989e 100644
--- a/doc-publik/update-publik-doc-from-redmine.py
+++ b/doc-publik/update-publik-doc-from-redmine.py
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+
from bs4 import BeautifulSoup
import html5lib
import requests
@@ -20,4 +22,16 @@ for cell in TextCell.objects.filter(slug__in=DOCS.keys(), page__snapshot__isnull
content = document.find('body')
new_content = unicode(content).replace('<body>', '').replace('</body>', '')
cell.text = new_content
+ cell.order = 1
+ cell.save()
+
+ url = DOCS[cell.slug].replace('.html', '').decode('utf-8')
+ cell, created = TextCell.objects.get_or_create(
+ page=cell.page,
+ slug='editor-warning', defaults={'order': 0})
+ cell.placeholder = 'content'
+ cell.order = 0
+ cell.text = u'''<div class="note note-tip"><div>Cette page est tirée de redmine, l'édition se fait là :<br>
+ <a href="%s">%s</a>.</div></div>''' % (url, url)
+ cell.public = False
cell.save()