app/views/tags/show.html.slim
/ SEO
- if params[:page] && params[:page].to_i > 1
- set_meta_tags title: ["Page #{params[:page]}", 'Tags', @tag.name]
- set_meta_tags canonical: tag_url(@tag.name, page: params[:page])
- set_meta_tags prev: tag_url(@tag.name, page: params[:page].to_i - 1)
- set_meta_tags next: tag_url(@tag.name, page: params[:page].to_i + 1)
- set_meta_tags description: "Reddit AMAs and Redditors tagged with #{@tag.name}. Page #{params[:page]}"
- else
- set_meta_tags title: ['Tags', @tag.name]
- set_meta_tags canonical: tag_url(@tag.name)
- set_meta_tags prev: tag_url(@tag.name)
- set_meta_tags next: tag_url(@tag.name, page: 2)
- set_meta_tags description: "Reddit AMAs and Redditors tagged with #{@tag.name}"
.row
.col-xs-12.col-sm-12.col-md-12.col-lg-12
h2
= params[:id]
small style="margin-left: 10px;"
= @taggings.count
| results found
- if @tag.description
blockquote
= @tag.description
.row
.col-xs-12.col-sm-12.col-md-12.col-lg-12
.list-group
- cache ["tag", params[:id], params[:page], @taggings.count], :expires_in => 12.hours do
- @taggings.each do |tagging|
- if tagging.taggable_type == 'Op'
= render partial: 'ops/snippet', locals: { op: Op.find(tagging.taggable_id) }
- elsif tagging.taggable_type == 'Ama'
= render partial: 'amas/snippet', locals: { ama: Ama.find(tagging.taggable_id) }
.row.sticky-scroll-bottom.text-center
/ = will_paginate @taggings
.row
.col-sm-12
ol.breadcrumb itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb"
li= link_to (root_path), itemprop: "url" do
span itemprop="title" BestofAMA
li= link_to (tags_path), itemprop: "url" do
span itemprop="title" Tags
- if params[:page].to_i > 1
li= link_to (tag_path(@tag.name)), itemprop: "url" do
span itemprop="title"= @tag.name
li.active= "Page #{params[:page]}"
- else
li.active= @tag.name