def _getButtonsStates(self, entity):
     if not g_clanCtrl.isEnabled():
         submit = NOTIFICATION_BUTTON_STATE.HIDDEN
     elif not g_clanCtrl.isAvailable():
         submit = NOTIFICATION_BUTTON_STATE.VISIBLE
     else:
         submit = NOTIFICATION_BUTTON_STATE.DEFAULT
     return {'submit': submit}
Beispiel #2
0
 def _getButtonsStates(self, entity):
     if not g_clanCtrl.isEnabled():
         submit = NOTIFICATION_BUTTON_STATE.HIDDEN
     elif not g_clanCtrl.isAvailable():
         submit = NOTIFICATION_BUTTON_STATE.VISIBLE
     else:
         submit = NOTIFICATION_BUTTON_STATE.DEFAULT
     return {'submit': submit}
 def _getCustomData(self):
     return {
         'canRoleCreateFortRest':
         self.fortCtrl.getPermissions().canCreate() and self._isMyClan,
         'canCreateFortLim':
         self.fortCtrl.getLimits().isCreationValid()[0] and self._isMyClan,
         'joinClanAvailable':
         not g_clanCache.isInClan and self._isMyClan,
         'clanSearchAvailable':
         g_clanCtrl.isEnabled()
     }
 def _getButtonsStates(self, entity):
     if self._state in (
             CLAN_INVITE_STATES.ACCEPTED, CLAN_INVITE_STATES.DECLINED
     ) or g_clanCtrl.getAccountProfile().isInClan(
     ) or not g_clanCtrl.isEnabled() or self.__isInClanEnterCooldown():
         submit = cancel = NOTIFICATION_BUTTON_STATE.HIDDEN
     elif not g_clanCtrl.isAvailable():
         submit = cancel = NOTIFICATION_BUTTON_STATE.VISIBLE
     else:
         submit = cancel = NOTIFICATION_BUTTON_STATE.DEFAULT
     return {'submit': submit, 'cancel': cancel}
 def _getButtonsStates(self, entity):
     if (
         self._state in (CLAN_APPLICATION_STATES.ACCEPTED, CLAN_APPLICATION_STATES.DECLINED)
         or not g_clanCtrl.getAccountProfile().getMyClanPermissions().canHandleClanInvites()
         or not g_clanCtrl.isEnabled()
     ):
         submit = cancel = NOTIFICATION_BUTTON_STATE.HIDDEN
     elif not g_clanCtrl.isAvailable():
         submit = cancel = NOTIFICATION_BUTTON_STATE.VISIBLE
     else:
         submit = cancel = NOTIFICATION_BUTTON_STATE.DEFAULT
     return {"submit": submit, "cancel": cancel}
 def _getButtonsStates(self, entity):
     if self._state in (
             CLAN_APPLICATION_STATES.ACCEPTED,
             CLAN_APPLICATION_STATES.DECLINED
     ) or not g_clanCtrl.getAccountProfile().getMyClanPermissions(
     ).canHandleClanInvites() or not g_clanCtrl.isEnabled():
         submit = cancel = NOTIFICATION_BUTTON_STATE.HIDDEN
     elif not g_clanCtrl.isAvailable():
         submit = cancel = NOTIFICATION_BUTTON_STATE.VISIBLE
     else:
         submit = cancel = NOTIFICATION_BUTTON_STATE.DEFAULT
     return {'submit': submit, 'cancel': cancel}
 def _getButtonsStates(self, entity):
     if (
         self._state in (CLAN_INVITE_STATES.ACCEPTED, CLAN_INVITE_STATES.DECLINED)
         or g_clanCtrl.getAccountProfile().isInClan()
         or not g_clanCtrl.isEnabled()
         or self.__isInClanEnterCooldown()
     ):
         submit = cancel = NOTIFICATION_BUTTON_STATE.HIDDEN
     elif not g_clanCtrl.isAvailable():
         submit = cancel = NOTIFICATION_BUTTON_STATE.VISIBLE
     else:
         submit = cancel = NOTIFICATION_BUTTON_STATE.DEFAULT
     return {"submit": submit, "cancel": cancel}
 def _getCustomData(self):
     return {'canRoleCreateFortRest': self.fortCtrl.getPermissions().canCreate() and self._isMyClan,
      'canCreateFortLim': self.fortCtrl.getLimits().isCreationValid()[0] and self._isMyClan,
      'joinClanAvailable': not g_clanCache.isInClan and self._isMyClan,
      'clanSearchAvailable': g_clanCtrl.isEnabled()}