Projet

Général

Profil

0001-backoffice-don-t-display-statistics-links-when-bijoe.patch

Frédéric Péters, 04 mai 2020 10:16

Télécharger (2,45 ko)

Voir les différences:

Subject: [PATCH] backoffice: don't display statistics links when bijoe is
 deployed (#42431)

 wcs/backoffice/management.py | 13 +++++++------
 wcs/ctl/check_hobos.py       |  2 ++
 2 files changed, 9 insertions(+), 6 deletions(-)
wcs/backoffice/management.py
545 545
    def get_sidebar(self, formdefs):
546 546
        r = TemplateIO(html=True)
547 547
        r += self.get_lookup_sidebox()
548
        r += htmltext('<div class="bo-block">')
549
        r += htmltext('<ul id="sidebar-actions">')
550
        r += htmltext('<li class="stats"><a href="statistics">%s</a></li>') % _('Global statistics')
551
        r += htmltext('</ul>')
552
        r += htmltext('</div>')
548
        if not get_publisher().get_site_option('bijoe_url'):
549
            r += htmltext('<div class="bo-block">')
550
            r += htmltext('<ul id="sidebar-actions">')
551
            r += htmltext('<li class="stats"><a href="statistics">%s</a></li>') % _('Global statistics')
552
            r += htmltext('</ul>')
553
            r += htmltext('</div>')
553 554
        return r.getvalue()
554 555

  
555 556
    def lookup(self):
......
1059 1060
        if self.formdef.geolocations:
1060 1061
            r += htmltext(' <li><a data-base-href="map" href="map%s">%s</a></li>') % (
1061 1062
                qs, _('Plot on a Map'))
1062
        if 'stats' in self._q_exports:
1063
        if 'stats' in self._q_exports and not get_publisher().get_site_option('bijoe_url'):
1063 1064
            r += htmltext(' <li class="stats"><a href="stats">%s</a></li>') % _('Statistics')
1064 1065
        return r.getvalue()
1065 1066

  
wcs/ctl/check_hobos.py
455 455
                continue
456 456
            if service.get('service-id') == 'fargo':
457 457
                config.set('options', 'fargo_url', service.get('base_url'))
458
            if service.get('service-id') == 'bijoe':
459
                config.set('options', 'bijoe_url', service.get('base_url'))
458 460

  
459 461
        try:
460 462
            portal_agent_url = config.get('variables', 'portal_agent_url')
461
-