Example #1
0
    def prettify(self, for_uid=None):
        # Let's try and work out why this user is being notified of a comment
        reason = subscription_reason(for_uid, self.post_id)

        if reason == SubscriptionReasons.POSTER:
            sr = 'posted'
        elif reason == SubscriptionReasons.COMMENTER:
            sr = 'commented on'
        elif reason == SubscriptionReasons.TAGEE:
            sr = 'were tagged in'
        else:
            # This should never really happen but let's play ball eh?
            sr = 'are subscribed to'

        return '<a href="{0}">{1}</a> ' \
               'commented on a <a href="{2}">post</a> you {3}' \
               .format(url_for('users.profile',
                               username=self.user.get('username')),
                       do_capitalize(self.user.get('username')), self.url(),
                       sr)
Example #2
0
 def prettify(self, for_uid=None):
     return '<a href="{0}">{1}</a> tagged you in a <a href="{2}">post</a>' \
            .format(url_for('users.profile',
                            username=self.user.get('username')),
                    do_capitalize(self.user.get('username')), self.url())
Example #3
0
 def prettify(self, for_uid=None):
     return '<a href="{0}">{1}</a> has started following you' \
            .format(url_for('users.profile',
                            username=self.user.get('username')),
                    do_capitalize(self.user.get('username')))
Example #4
0
 def prettify(self, for_uid=None):
     return '<a href="{0}">{1}</a> has started following you' \
            .format(url_for('users.profile',
                            username=self.user.get('username')),
                    do_capitalize(self.user.get('username')))
Example #5
0
 def prettify(self, for_uid=None):
     return '<a href="{0}">{1}</a> tagged you in a <a href="{2}">post</a>' \
            .format(url_for('profile', username=self.get_username()),
                    do_capitalize(self.get_username()),
                    url_for('view_post', username=self.author_username(),
                            pid=self.pid))