Browse Source

Fix linking of remote hashtags in UI, add public view of hashtags

master
Eugen Rochko 8 years ago
parent
commit
a698b767c1
3 changed files with 12 additions and 1 deletions
  1. +1
    -1
      app/assets/javascripts/components/components/status_content.jsx
  2. +3
    -0
      app/controllers/tags_controller.rb
  3. +8
    -0
      app/views/tags/show.html.haml

+ 1
- 1
app/assets/javascripts/components/components/status_content.jsx View File

@ -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');

+ 3
- 0
app/controllers/tags_controller.rb View File

@ -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

+ 8
- 0
app/views/tags/show.html.haml View File

@ -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

Loading…
Cancel
Save