Make large wiki/artist/pool title link to tag search
This commit is contained in:
@@ -77,6 +77,10 @@ class Artist < ActiveRecord::Base
|
|||||||
self.name = Artist.normalize_name(name)
|
self.name = Artist.normalize_name(name)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def pretty_name
|
||||||
|
name.tr("_", " ")
|
||||||
|
end
|
||||||
|
|
||||||
def other_names_array
|
def other_names_array
|
||||||
other_names.try(:split, /\s/)
|
other_names.try(:split, /\s/)
|
||||||
end
|
end
|
||||||
@@ -223,6 +227,10 @@ class Artist < ActiveRecord::Base
|
|||||||
TagAlias.active.find_by_antecedent_name(name).consequent_name
|
TagAlias.active.find_by_antecedent_name(name).consequent_name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def category_name
|
||||||
|
Tag.category_for(name)
|
||||||
|
end
|
||||||
|
|
||||||
def categorize_tag
|
def categorize_tag
|
||||||
if new_record? || name_changed?
|
if new_record? || name_changed?
|
||||||
Tag.find_or_create_by_name("artist:#{name}")
|
Tag.find_or_create_by_name("artist:#{name}")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<div id="c-artists">
|
<div id="c-artists">
|
||||||
<div id="a-show">
|
<div id="a-show">
|
||||||
<h1>Artist: <%= @artist.name.tr("_", " ") %></h1>
|
<h1>Artist: <%= link_to @artist.pretty_name, posts_path(:tags => @artist.name), :class => "tag-type-#{@artist.category_name}" %></h1>
|
||||||
|
|
||||||
<% if @artist.notes.present? && (!@artist.is_banned? || CurrentUser.user.is_member?) %>
|
<% if @artist.notes.present? && (!@artist.is_banned? || CurrentUser.user.is_member?) %>
|
||||||
<div class="prose">
|
<div class="prose">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div id="a-show">
|
<div id="a-show">
|
||||||
<h1>
|
<h1>
|
||||||
<%= @pool.pretty_category %>:
|
<%= @pool.pretty_category %>:
|
||||||
<%= link_to @pool.pretty_name, pool_path(@pool), :class => "pool-category-#{@pool.category}" %>
|
<%= link_to @pool.pretty_name, posts_path(:tags => "pool:#{@pool.id}"), :class => "pool-category-#{@pool.category}" %>
|
||||||
<% if @pool.is_deleted? %>
|
<% if @pool.is_deleted? %>
|
||||||
<span class="inactive">(deleted)</span>
|
<span class="inactive">(deleted)</span>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<section id="content">
|
<section id="content">
|
||||||
<h1 id="wiki-page-title">
|
<h1 id="wiki-page-title">
|
||||||
|
|
||||||
<%= link_to @wiki_page.pretty_title, wiki_page_path(@wiki_page), :class => "tag-type-#{@wiki_page.category_name}" %>
|
<%= link_to @wiki_page.pretty_title, posts_path(:tags => @wiki_page.title), :class => "tag-type-#{@wiki_page.category_name}" %>
|
||||||
|
|
||||||
<% if @wiki_page.is_locked? %>
|
<% if @wiki_page.is_locked? %>
|
||||||
(locked)
|
(locked)
|
||||||
|
|||||||
@@ -3,7 +3,9 @@
|
|||||||
<%= render "sidebar" %>
|
<%= render "sidebar" %>
|
||||||
|
|
||||||
<section id="content">
|
<section id="content">
|
||||||
<h1 id="wiki-page-title"><%= @wiki_page.pretty_title %></h1>
|
<h1 id="wiki-page-title">
|
||||||
|
<%= link_to @wiki_page.pretty_title, posts_path(:tags => @wiki_page.title), :class => "tag-type-#{@wiki_page.category_name}" %>
|
||||||
|
</h1>
|
||||||
<div id="wiki-page-body" class="prose">
|
<div id="wiki-page-body" class="prose">
|
||||||
<p>This wiki page does not exist. <%= link_to "Create new wiki page", new_wiki_page_path(:wiki_page => {:title => params[:title]}) %>.</p>
|
<p>This wiki page does not exist. <%= link_to "Create new wiki page", new_wiki_page_path(:wiki_page => {:title => params[:title]}) %>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user