from ..WebScript import WebScript
from ..WebPage import WebPage

class BaseWebPage (WebPage):

	def __init__(self):
		WebPage.__init__(self)

		self.get_style_sheet().add_rule('table', { 'width': '100%' })
		self.get_head().add(self.get_client_config_script())

	def get_client_config_script(self):
		return WebScript("text/javascript", content="""
		// Add properties to mocha
		window.mocha = window.mocha || {};
		mocha.tenant = 'cityoforlando3';
		mocha.clientOrigin = 'https://wd5-impl.workday.com';
		mocha.language = 'en_US';
		mocha.clientVersion = '0';
		mocha.systemConfidenceLevel = 'PROD';
		mocha.oauthAuthorizationPending = false;
		mocha.proxyLoginEnabled = false;
		mocha.maintenancePageUrl = 'https://wd5-impl.workday.com/wday/drs/outage?t=cityoforlando3';
		mocha.deviceTrustDetailsUrl = '';
		mocha.pendingAuthDetailsUrl = '';
		mocha.webAuthnDetailsUrl = '';
		mocha.enableBluePrimaryButtons = 'false';

		// Construct init params for GWT app
		mocha.initParams = {
			authGatewayPath: '/wday/authgwy',
			baseDir: '/wday/asset/ui-html/',
			systemConfidenceLevel: 'PROD',
			cdn: {
				endpoint: 'wd5-impl.workdaycdn.com',
				enabled: true,
				allowed: true
			},
			proxyEnabled: false,
			currentVersion: '20.0.04.045',
			serviceType: 'authgwy',
			loginAuthURL: '/cityoforlando3/login-auth.xml',
			environment: 'Implementation  -   cityoforlando3',
			environmentType: 'IMPL'
		};
""")