views: convert helpers to partials.
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
|
||||
<div>
|
||||
<%= render "artists/summary", artist: artist %>
|
||||
<%= artist_alias_and_implication_list(artist) %>
|
||||
<%= render "tag_relationships/alias_and_implication_list", tag: artist.tag %>
|
||||
|
||||
<p class="links">
|
||||
<%= link_to "View wiki", artist.wiki_page %> |
|
||||
@@ -29,7 +29,7 @@
|
||||
<% end %>
|
||||
|
||||
<%= format_text(wiki_page.presenter.excerpt) %>
|
||||
<%= wiki_page_alias_and_implication_list(wiki_page) %>
|
||||
<%= render "tag_relationships/alias_and_implication_list", tag: wiki_page.tag %>
|
||||
|
||||
<p class="links">
|
||||
<%= link_to_wiki "View wiki", wiki_page.title %>
|
||||
@@ -64,7 +64,7 @@
|
||||
<% if post_set.tag_string.present? %>
|
||||
<p>There is currently no wiki page for the tag "<%= post_set.tag_string %>". You can <%= link_to "create one", new_wiki_page_path(:wiki_page => {:title => post_set.tag_string}) %>.</p>
|
||||
|
||||
<%= alias_and_implication_list(post_set.tag) %>
|
||||
<%= render "tag_relationships/alias_and_implication_list", tag: post_set.tag %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
9
app/views/reports/_tag_diff_list.html.erb
Normal file
9
app/views/reports/_tag_diff_list.html.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
<span class="diff-list">
|
||||
<% added_tags.each do |tag| %>
|
||||
<ins>+<%= link_to wordbreakify(tag), posts_path(tags: tag) %></ins>
|
||||
<% end %>
|
||||
|
||||
<% removed_tags.each do |tag| %>
|
||||
<del>-<%= link_to wordbreakify(tag), posts_path(tags: tag) %></del>
|
||||
<% end %>
|
||||
</span>
|
||||
@@ -12,7 +12,7 @@
|
||||
<%= TagSetPresenter.new(upload_report.uploader_tags_array).inline_tag_list_html %>
|
||||
<% end %>
|
||||
<% t.column "Tags added by uploader", width: "45%" do |upload_report| %>
|
||||
<%= diff_to_current(upload_report) %>
|
||||
<%= render "reports/tag_diff_list", added_tags: upload_report.added_tags_array, removed_tags: upload_report.removed_tags_array %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
<% if tag.antecedent_alias %>
|
||||
<p class="fineprint">
|
||||
This tag has been aliased to <%= link_to_wiki(tag.antecedent_alias.consequent_name) %>
|
||||
(<%= link_to_wiki "learn more", "help:tag_aliases" %>).
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<% if tag.consequent_aliases.present? %>
|
||||
<p class="fineprint">
|
||||
The following tags are aliased to this tag:
|
||||
<%= to_sentence(tag.consequent_aliases.map { |ta| link_to_wiki ta.antecedent_name }) %>
|
||||
(<%= link_to_wiki "learn more", "help:tag_aliases" %>).
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<% TagImplication.automatic_tags_for([tag.name]).tap do |automatic_tags| %>
|
||||
<% if automatic_tags.present? %>
|
||||
<p class="fineprint">
|
||||
This tag automatically adds
|
||||
<%= to_sentence(automatic_tags.map { |tag| link_to_wiki tag }) %>
|
||||
(<%= link_to_wiki "learn more", "help:autotags" %>).
|
||||
</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if tag.antecedent_implications.present? %>
|
||||
<p class="fineprint">
|
||||
This tag implicates
|
||||
<%= to_sentence(tag.antecedent_implications.map { |ti| link_to_wiki ti.consequent_name }) %>
|
||||
(<%= link_to_wiki "learn more", "help:tag_implications" %>).
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<% if tag.consequent_implications.present? %>
|
||||
<p class="fineprint">
|
||||
The following tags implicate this tag:
|
||||
<%= to_sentence(tag.consequent_implications.map { |ti| link_to_wiki ti.antecedent_name }) %>
|
||||
(<%= link_to_wiki "learn more", "help:tag_implications" %>).
|
||||
</p>
|
||||
<% end %>
|
||||
7
app/views/wiki_pages/_posts.html.erb
Normal file
7
app/views/wiki_pages/_posts.html.erb
Normal file
@@ -0,0 +1,7 @@
|
||||
<% if wiki_page.tag.present? && wiki_page.tag.post_count > 0 %>
|
||||
<div id="wiki-page-posts">
|
||||
<h2>Posts (<%= link_to "view all", posts_path(tags: wiki_page.title) %>)</h2>
|
||||
|
||||
<%= wiki_page.post_set.presenter.post_previews_html(self) %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -19,8 +19,8 @@
|
||||
<%= dtext_preview_button "wiki_page", "body" %>
|
||||
<% end %>
|
||||
|
||||
<%= wiki_page_alias_and_implication_list(@wiki_page)%>
|
||||
<%= wiki_page_post_previews(@wiki_page) %>
|
||||
<%= render "tag_relationships/alias_and_implication_list", tag: @wiki_page.tag %>
|
||||
<%= render "wiki_pages/posts", wiki_page: @wiki_page %>
|
||||
<% end %>
|
||||
|
||||
<%= render "secondary_links" %>
|
||||
|
||||
@@ -29,13 +29,13 @@
|
||||
<p><%= link_to "View artist", @wiki_page.artist %></p>
|
||||
<% end %>
|
||||
|
||||
<%= wiki_page_alias_and_implication_list(@wiki_page) %>
|
||||
<%= render "tag_relationships/alias_and_implication_list", tag: @wiki_page.tag %>
|
||||
<% else %>
|
||||
<p>This artist has requested removal of their information.</p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= wiki_page_post_previews(@wiki_page) %>
|
||||
<%= render "wiki_pages/posts", wiki_page: @wiki_page %>
|
||||
<% end %>
|
||||
|
||||
<% content_for(:page_title) do %>
|
||||
|
||||
Reference in New Issue
Block a user