summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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()