diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 21ec75472..1723d70ab 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -101,6 +101,14 @@ module ApplicationHelper time_tag(time.strftime("%Y-%m-%d %H:%M"), time) end + def external_link_to(url) + if url =~ %r!\Ahttps?://!i + link_to url, {}, {rel: :nofollow} + else + url + end + end + def link_to_ip(ip) link_to ip, moderator_ip_addrs_path(:search => {:ip_addr => ip}) end diff --git a/app/views/post_replacements/index.html.erb b/app/views/post_replacements/index.html.erb new file mode 100644 index 000000000..ce84f0af1 --- /dev/null +++ b/app/views/post_replacements/index.html.erb @@ -0,0 +1,54 @@ +
| Post | +Source | +Replacer | +
|---|---|---|
| <%= PostPresenter.preview(post_replacement.post) %> | +
+
|
+
+ <%= compact_time post_replacement.created_at %>
+ by <%= link_to_user post_replacement.creator %> + <%= link_to "ยป", post_replacements_path(search: params[:search].merge(creator_name: post_replacement.creator.name)) %> + |
+