discourse/app/assets/javascripts/discourse/views/post_link_view.js
Robin Ward d554a59102 Support for a new site setting: newuser_spam_host_threshold. If a new user posts a link
to the same host enough tiles, they will not be able to post the same link again.

Additionally, the site will flag all their previous posts with links as spam and they will
be instantly hidden via the auto hide workflow.
2013-05-16 12:19:50 -04:00

31 lines
803 B
JavaScript

/**
This view renders a link within a post
@class PostLinkView
@extends Discourse.View
@namespace Discourse
@module Discourse
**/
Discourse.PostLinkView = Discourse.View.extend({
tagName: 'li',
classNameBindings: ['direction'],
direction: function() {
if (this.get('content.reflection')) return 'incoming';
return null;
}.property('content.reflection'),
render: function(buffer) {
var clicks;
buffer.push("<a href='" + (this.get('content.url')) + "' class='track-link'>\n");
buffer.push("<i class='icon icon-arrow-right'></i>");
buffer.push(this.get('content.title'));
if (clicks = this.get('content.clicks')) {
buffer.push("\n<span class='badge badge-notification clicks'>" + clicks + "</span>");
}
return buffer.push("</a>");
}
});