about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-11-05 17:44:14 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-11-05 17:44:14 +0100
commita698b767c175e7ca59122da11412660a22519067 (patch)
tree04a7516a5845b6878663d78f2934f7f9a984983e
parent48b9619439818ecb344ae33c9c31a55ecb1aa27a (diff)
Fix linking of remote hashtags in UI, add public view of hashtags
-rw-r--r--app/assets/javascripts/components/components/status_content.jsx2
-rw-r--r--app/controllers/tags_controller.rb3
-rw-r--r--app/views/tags/show.html.haml8
3 files changed, 12 insertions, 1 deletions
diff --git a/app/assets/javascripts/components/components/status_content.jsx b/app/assets/javascripts/components/components/status_content.jsx
index 2006e965a..118635ed3 100644
--- a/app/assets/javascripts/components/components/status_content.jsx
+++ b/app/assets/javascripts/components/components/status_content.jsx
@@ -23,7 +23,7 @@ const StatusContent = React.createClass({
 
       if (mention) {
         link.addEventListener('click', this.onMentionClick.bind(this, mention), false);
-      } else if (link.text[0] === '#' || (link.previousSibling && link.previousSibling.text === '#')) {
+      } else if (link.text[0] === '#' || (link.previousSibling && link.previousSibling.text[link.previousSibling.text.length - 1] === '#')) {
         link.addEventListener('click', this.onHashtagClick.bind(this, link.text), false);
       } else {
         link.setAttribute('target', '_blank');
diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb
index c1aaf7e47..ca5ee2f83 100644
--- a/app/controllers/tags_controller.rb
+++ b/app/controllers/tags_controller.rb
@@ -1,4 +1,7 @@
 class TagsController < ApplicationController
+  layout 'public'
+
   def show
+    @statuses = Tag.find_by!(name: params[:id].downcase).statuses.order('id desc').with_includes.with_counters.paginate(page: params[:page], per_page: 10)
   end
 end
diff --git a/app/views/tags/show.html.haml b/app/views/tags/show.html.haml
index e69de29bb..0e6fd2db7 100644
--- a/app/views/tags/show.html.haml
+++ b/app/views/tags/show.html.haml
@@ -0,0 +1,8 @@
+- if @statuses.empty?
+  .accounts-grid
+    = render partial: 'accounts/nothing_here'
+- else
+  .activity-stream
+    = render partial: 'stream_entries/status', collection: @statuses, as: :status, cached: true
+
+= will_paginate @statuses, pagination_options