# -*- coding: utf-8 -*-
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
from appy.px import Px
from appy.server.guard import Guard

# Import the app's main Config instance
from Hubber import Config as c

#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Declare this extension
from pathlib import Path
c.declareExt(Path(__path__[0]))

#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Apply ext's changes to this instance
c.ui.images['loginLogo.png'] = 'GeezTeem'

#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Customize the portlet to inject the GeezTeem website in it

Guard.pxLoginBottom = Px('''
 <div class="geezteem">
  <div class="topSpace">
   <b>GeezTeem</b> 🌱 <x>:_('free_software_maker')</x>
  </div>
  <div>
   <span class="rsp">Gaëtan Delannay</span>
   <a href="javascript:sendMail('geezteem.com','gaetan.delannay')"
      class="rsp">📨</a>
   <span>0472/56.98.59</span>
  </div>
  <div class="topSpace">Entreprise sise à 5020 Malonne, 
    <x>:_('belgium')</x></div>
  <div class="topSpace"><x>:_('company_id')</x> 0811.124.193</div>
 </div>
 ''',

 css='''
  .geezteem { text-align:center }
  .rsp { padding-right:0.4em }
 ''',

 js='''
  function sendMail(domain, user) {
    var loc = 'mailto:' + user + '@' + domain;
    parent.location = loc;
  }''')
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
