def create(self):
     startDate, finishDate = self._data.getGroupStartFinishTime()
     startDateStruct = getTimeStructInLocal(startDate)
     finishDateStruct = getTimeStructInLocal(finishDate)
     startDateText = text_styles.main(
         backport.text(TOOLTIPS.MARATHON_DATE,
                       day=startDateStruct.tm_mday,
                       month=i18n.makeString(
                           MENU.datetime_months(startDateStruct.tm_mon)),
                       hour=startDateStruct.tm_hour,
                       minutes=i18n.makeString('%02d',
                                               startDateStruct.tm_min)))
     finishDateText = text_styles.main(
         backport.text(TOOLTIPS.MARATHON_DATE,
                       day=finishDateStruct.tm_mday,
                       month=i18n.makeString(
                           MENU.datetime_months(finishDateStruct.tm_mon)),
                       hour=finishDateStruct.tm_hour,
                       minutes=i18n.makeString('%02d',
                                               finishDateStruct.tm_min)))
     text = text_styles.main(
         backport.text(TOOLTIPS.MARATHON_SUBTITLE,
                       startDate=startDateText,
                       finishDate=finishDateText))
     return ('', text)
def getBackBtnLabel(exitEvent, previewView, vehicleName=''):
    key = BACK_BTN_LABELS.get(previewView, 'hangar')
    if key == BACK_BTN_LABELS[VIEW_ALIAS.LOBBY_RESEARCH]:
        return i18n.makeString(MENU.viewheader_backbtn_descrlabel(key),
                               tankName=vehicleName.upper())
    if key == BACK_BTN_LABELS[VIEW_ALIAS.LOBBY_TECHTREE]:
        key = _getBlueprintViewLabel(exitEvent, key)
    return MENU.viewheader_backbtn_descrlabel(key)
Esempio n. 3
0
def convertState(vState):
    if vState in _IGNORED_VEHICLE_STATES:
        return ''
    return makeHtmlString(
        'html_templates:lobby', 'inPremiumIgrOnly'
    ) if vState == Vehicle.VEHICLE_STATE.IN_PREMIUM_IGR_ONLY else makeString(
        MENU.tankcarousel_vehiclestates(vState))
Esempio n. 4
0
def _generateOptions(base, self, ctx=None):
    """ Generate a list of options for  the context menu.
    """
    if isinstance(self._c11nView, MainView):
        return base(self, ctx)
    item = self.itemsCache.items.getItemByCD(self._intCD)
    removeFromTankEnabled = False
    for outfit in (self._c11nView.getModifiedOutfit(season)
                   for season in SeasonType.COMMON_SEASONS):
        if outfit.has(item):
            removeFromTankEnabled = True
            break
    return [
        self._makeItem(
            CustomizationOptions.REMOVE_FROM_TANK,
            MENU.cst_item_ctx_menu(CustomizationOptions.REMOVE_FROM_TANK),
            {'enabled': removeFromTankEnabled})
    ]