Пример #1
0
def push_collect_notification(collector, photo_id, receiver):
    message = _l('User <a href=\"%s\">%s</a> collected your <a href=\"%s\">photo</a>') % \
              (url_for('user.index', username=collector.username),
               collector.username,
               url_for('main.show_photo', photo_id=photo_id))
    notification = Notification(message=message, receiver=receiver)
    add_notification(notification)
Пример #2
0
def push_follow_notification(follower, receiver):
    message = _(
        'User <a href="%(url_username)s">%(follower_username)s</a> followed you.',
        url_username=url_for('user.index', username=follower.username),
        follower_username=follower.username)
    notification = Notification(message=message, receiver=receiver)
    commit_notification(notification)
Пример #3
0
def push_follow_notification(follower, receiver):
    message = '{} <a href="{}">{}</a> {}.'.format(_l('User'), 
                                                 url_for('user.index', username=follower.username),
                                                 follower.username,
                                                 _l('followed you')
                                                 )
    notification = Notification(message=message, receiver=receiver)
Пример #4
0
def push_comment_notification(photo_id, receiver, page=1):
    message = '<a href="{}#comments">{}</a> {}.'.format(
        url_for('main.show_photo', photo_id=photo_id, page=page),
        _l('This photo'),
        _l('has new comment/reply.')
        )
    notification = Notification(message=message, receiver=receiver)
Пример #5
0
def push_collect_notification(collector, photo_id, receiver):
    message = _(
        'User <a href="%(url_username)s">%(collector_username)s</a> collected your <a href="%(url_main_show_photo)s">photo</a>',
        url_username=url_for('user.index', username=collector.username),
        collector_username=collector.username,
        url_main_show_photo=url_for('main.show_photo', photo_id=photo_id))
    notification = Notification(message=message, receiver=receiver)
    commit_notification(notification)
Пример #6
0
def push_comment_notification(photo_id, receiver, page=1):
    message = _(
        '<a href="%(url_main_show_photo)s#comments">This photo</a> has new comment/reply.',
        url_main_show_photo=url_for('main.show_photo',
                                    photo_id=photo_id,
                                    page=page))
    notification = Notification(message=message, receiver=receiver)
    commit_notification(notification)
Пример #7
0
def push_collect_notification(collector, photo_id, receiver):
    message = _l('Пользователь <a href="%s">%s</a> добавил ваше фото в свою коллекцию <a href="%s">photo</a>') % \
              (url_for('user.index', username=collector.username),
               collector.username,
               url_for('main.show_photo', photo_id=photo_id))
    notification = Notification(message=message, receiver=receiver)
    db.session.add(notification)
    db.session.commit()
Пример #8
0
def push_collect_notification(collector, photo_id, receiver):
    message = '{} <a href="{}">{}</a> {} <a href="{}">{}</a>'.format(
        _l('User'),
        url_for('user.index', username=collector.username),
        collector.username,
        _l('collected your'),
        url_for('main.show_photo', photo_id=photo_id),
        _l('photo')
        )                                                                    
    notification = Notification(message=message, receiver=receiver)
Пример #9
0
def fake_admin():
    admin = User(name='Grey Li',
                 username='******',
                 email='*****@*****.**',
                 bio=fake.sentence(),
                 website='http://greyli.com',
                 confirmed=True)
    admin.set_password('helloflask')
    notification = Notification(message='Hello, welcome to Vshaurme.', receiver=admin)
    db.session.add(notification)
    db.session.add(admin)
    db.session.commit()
Пример #10
0
def fake_admin():
    admin = User(name='Grey Li',
                 username='******',
                 email='*****@*****.**',
                 bio=fake.sentence(),
                 website='http://greyli.com',
                 confirmed=True)
    admin.set_password('helloflask')
    notification = Notification(
        message='Привет, добро пожаловать в сервис Вшаурме.', receiver=admin)
    db.session.add(notification)
    db.session.add(admin)
    db.session.commit()
Пример #11
0
def push_follow_notification(follower, receiver):
    message = 'User <a href="%s">%s</a> followed you.' % \
              (url_for('user.index', username=follower.username), follower.username)
    notification = Notification(message=message, receiver=receiver)
Пример #12
0
def push_follow_notification(follower, receiver):
    message = 'Пользователь <a href="%s">%s</a> подписался на вас.' % \
              (url_for('user.index', username=follower.username), follower.username)
    notification = Notification(message=message, receiver=receiver)
    db.session.add(notification)
    db.session.commit()
Пример #13
0
def push_collect_notification(collector, photo_id, receiver):
    message = 'Пользователь <a href="%s">%s</a> взял ваше фото <a href="%s">photo</a> в коллекцию.' % \
              (url_for('user.index', username=collector.username),
               collector.username,
               url_for('main.show_photo', photo_id=photo_id))
    notification = Notification(message=message, receiver=receiver)
Пример #14
0
def push_comment_notification(photo_id, receiver, page=1):
    message = 'Под <a href="%s#comments">этим</a> фото появился комментарий/ответ.' % \
              (url_for('main.show_photo', photo_id=photo_id, page=page))
    notification = Notification(message=message, receiver=receiver)
    db.session.add(notification)
    db.session.commit()
Пример #15
0
def push_comment_notification(photo_id, receiver, page=1):
    message = _l('<a href="%s#comments">Под этой фотографией</a> появился новый комментарий/reply.') % \
              (url_for('main.show_photo', photo_id=photo_id, page=page))
    notification = Notification(message=message, receiver=receiver)
    db.session.add(notification)
    db.session.commit()
Пример #16
0
def push_comment_notification(photo_id, receiver, page=1):
    message = _l('<a href=\"%s#comments\">This photo</a> has new comment/reply.') % \
              (url_for('main.show_photo', photo_id=photo_id, page=page))
    notification = Notification(message=message, receiver=receiver)
    add_notification(notification)