1
|
import os
|
2
|
|
3
|
from quixote import get_publisher, redirect
|
4
|
from quixote.directory import Directory
|
5
|
from quixote.html import TemplateIO, htmltext
|
6
|
|
7
|
from wcs.qommon import _
|
8
|
from wcs.qommon.publisher import get_publisher_class
|
9
|
|
10
|
import wcs.backoffice.management
|
11
|
import wcs.root
|
12
|
from wcs.categories import Category
|
13
|
from wcs.formdef import FormDef
|
14
|
|
15
|
from wcs.qommon import get_cfg, errors
|
16
|
from wcs.qommon.form import *
|
17
|
|
18
|
CURRENT_USER = object()
|
19
|
|
20
|
|
21
|
class BackofficeRootDirectory(wcs.backoffice.root.RootDirectory):
|
22
|
def get_intro_text(self):
|
23
|
return _('Welcome on Publik back office interface')
|
24
|
|
25
|
def _q_index(self):
|
26
|
if len(self.get_menu_items()) == 1:
|
27
|
return redirect(self.get_menu_items()[0]['url'])
|
28
|
return wcs.backoffice.root.RootDirectory._q_index(self)
|
29
|
|
30
|
def home(self):
|
31
|
return redirect('management/')
|
32
|
|
33
|
|
34
|
get_publisher_class().backoffice_directory_class = BackofficeRootDirectory
|