diff --git a/src/var/lib/tyto/program/db.py b/src/var/lib/tyto/program/db.py index e0f1deb..ee97d65 100644 --- a/src/var/lib/tyto/program/db.py +++ b/src/var/lib/tyto/program/db.py @@ -100,6 +100,7 @@ domain_values = \ 'www_sidebar', 'www_metas', 'www_footer', + 'domain_footer_about', 'domain_active', ) diff --git a/src/var/lib/tyto/program/domain.py b/src/var/lib/tyto/program/domain.py index f818352..cee9b72 100644 --- a/src/var/lib/tyto/program/domain.py +++ b/src/var/lib/tyto/program/domain.py @@ -21,16 +21,6 @@ from datetime import datetime import os, sys, locale, importlib import logs, db, tyto, html -#---------------------------------------------------------------------- -# Optional -# This variable, if not empty, will be used in website footer -# and will replace defaut content of domain_about -# Put in any HTML you want but, -# note: content is already in

-#---------------------------------------------------------------------- -domain_footer_about = \ -'Un petit essai' - #==========================# # Manage Argument 'domain' # @@ -530,7 +520,20 @@ def create_domain(target): set_f = 'sidebar_items = %d'%sidebar_items tyto.set_file(db.domain_conf, False, set_f) - + # Create domain_footer_about (user custom description in footer) + #--------------------------------------------------------------- + try: + domain_footer_about = db.domain_footer_about + set_f = '\n# Custom HTML (ONE Line)\n' + \ + "domain_footer_about = '%s'"%domain_footer_about + except: + domain_about = db.domain_about + set_f = '\n# Custom HTML (ONE Line)\n' + \ + "domain_footer_about = '

%s

'"%domain_about + + tyto.set_file(db.domain_conf, False, set_f) + + # Activate Domain after Resumed configuration ? #---------------------------------------------- try: domain_active = db.domain_active @@ -854,11 +857,12 @@ def create_footer(option): if not res in ['y', 'Y']: return # Default footer contents - Tytosrc = '(\n%s%s)'%(9 * ' ', tyto.trans[3][tyto.n]) + Tytosrc = \ + '\n%s(%s)'%(9 * ' ', tyto.trans[3][tyto.n]) tyto_show = \ - '\n%s%s %s'%(9 * ' ', tyto.Tyto, Tytosrc) @@ -874,8 +878,13 @@ def create_footer(option): '%stitle="%s"\n'%(9 * ' ',tyto.trans[1][tyto.n]) + \ '%sid="footer_title_link">%s'%(9 * ' ', db.domain_title) - # Show domain_HTML_about (if not empty), else domain_about - if domain_footer_about: db.domain_about = domain_footer_about + # Show domain_footer_about + footer_about = '' + for line in db.domain_footer_about.rsplit('\n'): + if not line: continue + line = '%s%s'%(6 * ' ', line) + if footer_about: footer_about = '%s\n%s'%(footer_about, line) + else: footer_about = line # License URL if not db.domain_licurl: db.domain_licurl = '/' @@ -884,8 +893,12 @@ def create_footer(option): if db.domain_legalurl: legal_link = \ '%s'%(11 * ' ', tyto.trans[16][tyto.n]) + '%stitle="%s %s"\n'%( + 11 * ' ', tyto.trans[16][tyto.n], db.domain_title + ) + \ + '%sclass="footer_item_link">%s'%( + 11 * ' ', tyto.trans[16][tyto.n] + ) if db.domain_termsurl: terms_link = \ @@ -925,7 +938,7 @@ def create_footer(option): tyto.trans[11][tyto.n], domain_home ) + \ ' \n' + \ - ' \n'%(db.domain_about) + \ + '%s\n'%(footer_about) + \ ' \n' + \ '\n' + \ ' \n' + \ ' \n' + \ ''