def announcement(context):
    try:
        date_str = unquote(context['request'].COOKIES.get(Announcement.hide_cookie_name))
        hidden_date = datetime.strptime(date_str, Announcement.cookie_date_format)
    except (ValueError, TypeError, AttributeError):
        hidden_date = None
        
    return {
        'obj': Announcement.last(hidden_date),
        'cookie_name': Announcement.hide_cookie_name,
        'date': datetime.now().strftime(Announcement.cookie_date_format)
    }
Exemple #2
0
def announcement(context):
    try:
        date_str = unquote(context['request'].COOKIES.get(
            Announcement.hide_cookie_name))
        hidden_date = datetime.strptime(date_str,
                                        Announcement.cookie_date_format)
    except (ValueError, TypeError, AttributeError):
        hidden_date = None

    return {
        'obj': Announcement.last(hidden_date),
        'cookie_name': Announcement.hide_cookie_name,
        'date': datetime.now().strftime(Announcement.cookie_date_format)
    }
Exemple #3
0
def new_announcement(context):
    return {
        'announcement': Announcement.last(),
        'add_content_class': True,
    }
Exemple #4
0
def announcement(context):
    return {
        'announcement': Announcement.last(),
        'add_content_class': False,
    }
Exemple #5
0
def futureui_announcement():
    return {
        'announcement': Announcement.last(),
    }
def announcement():

    return {
        'obj': Announcement.last()
    }