views: factor out sidebar layout template.

* Factor out common sidebar layout template.
* Convert wiki pages and posts to use this template.
* Add data-layout attribute to <body> element indicating the current layout.
This commit is contained in:
evazion
2019-09-28 17:05:18 -05:00
parent f7d7ed4b23
commit 960e5d4ae0
16 changed files with 316 additions and 339 deletions

View File

@@ -1,6 +1,7 @@
class PostsController < ApplicationController
before_action :member_only, :except => [:show, :show_seq, :index, :home, :random]
respond_to :html, :xml, :json
layout "sidebar"
def index
if params[:md5].present?

View File

@@ -1,5 +1,6 @@
class WikiPageVersionsController < ApplicationController
respond_to :html, :xml, :json
layout "sidebar"
def index
@wiki_page_versions = WikiPageVersion.search(search_params).paginate(params[:page], :limit => params[:limit], :search_count => params[:search])

View File

@@ -3,7 +3,8 @@ class WikiPagesController < ApplicationController
before_action :member_only, :except => [:index, :search, :show, :show_or_new]
before_action :builder_only, :only => [:destroy]
before_action :normalize_search_params, :only => [:index]
layout "sidebar"
def new
@wiki_page = WikiPage.new(wiki_page_params(:create))
respond_with(@wiki_page)
@@ -30,6 +31,7 @@ class WikiPagesController < ApplicationController
end
def search
render layout: "default"
end
def show

View File

@@ -187,6 +187,7 @@ module ApplicationHelper
data: {
controller: controller_param,
action: action_param,
layout: controller.class.send(:_layout),
**data_attributes_for(user, "user", attributes)
}
}

View File

@@ -0,0 +1,15 @@
<% content_for(:layout) do %>
<div id="c-<%= params[:controller].parameterize.dasherize %>">
<div id="a-<%= params[:action].parameterize.dasherize %>">
<aside id="sidebar">
<%= yield :sidebar %>
</aside>
<section id="content">
<%= yield :content %>
</section>
</div>
</div>
<% end %>
<%= render template: "layouts/default" %>

View File

@@ -1,58 +1,53 @@
<div id="c-posts">
<div id="a-index">
<aside id="sidebar">
<%= render "posts/partials/common/search", :path => posts_path, :tags => params[:tags], :tags_dom_id => "tags" %>
<% content_for(:sidebar) do %>
<%= render "posts/partials/common/search", :path => posts_path, :tags => params[:tags], :tags_dom_id => "tags" %>
<%= render "posts/partials/index/mode_menu" %>
<%= render "posts/partials/index/mode_menu" %>
<%= render "posts/partials/index/blacklist" %>
<%= render "posts/partials/index/blacklist" %>
<section id="tag-box">
<h1>Tags</h1>
<%= @post_set.presenter.tag_list_html(current_query: params[:tags], show_extra_links: CurrentUser.user.is_gold?) %>
</section>
<section id="tag-box">
<h1>Tags</h1>
<%= @post_set.presenter.tag_list_html(current_query: params[:tags], show_extra_links: CurrentUser.user.is_gold?) %>
</section>
<section id="tag-box">
<h1>Share</h1>
<%= render "posts/partials/index/share" %>
</section>
<section id="tag-box">
<h1>Share</h1>
<%= render "posts/partials/index/share" %>
</section>
<%= render "posts/partials/index/options" %>
<%= render "posts/partials/index/options" %>
<%= render "posts/partials/index/related" %>
</aside>
<%= render "posts/partials/index/related" %>
<% end %>
<section id="content">
<menu id="post-sections">
<li class="active"><a href="#" id="show-posts-link">Posts</a></li>
<% content_for(:content) do %>
<menu id="post-sections">
<li class="active"><a href="#" id="show-posts-link">Posts</a></li>
<% if @post_set.artist.present? %>
<li><%= link_to "Artist", artist_path(@post_set.artist), :id => "show-excerpt-link" %></li>
<% elsif @post_set.wiki_page.present? %>
<li><%= link_to "Wiki", wiki_page_path(@post_set.wiki_page), :id => "show-excerpt-link" %></li>
<% elsif @post_set.has_pool? %>
<li><%= link_to "Pool", pool_path(@post_set.pool), :id => "show-excerpt-link" %></li>
<% elsif @post_set.has_favgroup? %>
<li><%= link_to "Favorite Group", favorite_group_path(@post_set.favgroup), :id => "show-excerpt-link" %></li>
<% elsif @post_set.has_blank_wiki? %>
<li><%= link_to "Wiki", new_wiki_page_path(wiki_page: { title: @post_set.tag_string }), id: "show-excerpt-link" %></li>
<% end %>
<% if @post_set.artist.present? %>
<li><%= link_to "Artist", artist_path(@post_set.artist), :id => "show-excerpt-link" %></li>
<% elsif @post_set.wiki_page.present? %>
<li><%= link_to "Wiki", wiki_page_path(@post_set.wiki_page), :id => "show-excerpt-link" %></li>
<% elsif @post_set.has_pool? %>
<li><%= link_to "Pool", pool_path(@post_set.pool), :id => "show-excerpt-link" %></li>
<% elsif @post_set.has_favgroup? %>
<li><%= link_to "Favorite Group", favorite_group_path(@post_set.favgroup), :id => "show-excerpt-link" %></li>
<% elsif @post_set.has_blank_wiki? %>
<li><%= link_to "Wiki", new_wiki_page_path(wiki_page: { title: @post_set.tag_string }), id: "show-excerpt-link" %></li>
<% end %>
<li id="searchbox-redirect-link"><a href="#search-box">Search &raquo;</a></li>
</menu>
<li id="searchbox-redirect-link"><a href="#search-box">Search &raquo;</a></li>
</menu>
<%= render "posts/partials/index/edit" %>
<%= render "posts/partials/index/excerpt", :post_set => @post_set %>
<%= render "posts/partials/index/posts", :post_set => @post_set %>
</section>
<%= render "posts/partials/index/edit" %>
<%= render "posts/partials/index/excerpt", :post_set => @post_set %>
<%= render "posts/partials/index/posts", :post_set => @post_set %>
<% end %>
<%= post_search_count_js %>
<%= post_search_count_js %>
<div id="saved-searches-nav">
<%= render "saved_searches/interface" %>
</div>
</div>
<div id="saved-searches-nav">
<%= render "saved_searches/interface" %>
</div>
<% if params[:tags] =~ /search:/ %>

View File

@@ -1,155 +1,151 @@
<div id="c-posts">
<div id="a-show">
<aside id="sidebar">
<%= render "posts/partials/common/search", :path => posts_path, :tags => params[:q], :tags_dom_id => "tags" %>
<% content_for(:sidebar) do %>
<%= render "posts/partials/common/search", :path => posts_path, :tags => params[:q], :tags_dom_id => "tags" %>
<%= render "posts/partials/index/blacklist" %>
<%= render "posts/partials/index/blacklist" %>
<section id="tag-list">
<%= @post.presenter.split_tag_list_html(current_query: params[:q], show_extra_links: CurrentUser.user.is_gold?) %>
</section>
<section id="tag-list">
<%= @post.presenter.split_tag_list_html(current_query: params[:q], show_extra_links: CurrentUser.user.is_gold?) %>
</section>
<section id="post-information">
<h1>Information</h1>
<%= render "posts/partials/show/information", :post => @post %>
</section>
<section id="post-information">
<h1>Information</h1>
<%= render "posts/partials/show/information", :post => @post %>
</section>
<section id="post-share">
<h1>Share</h1>
<%= render "posts/partials/show/share", :post => @post %>
</section>
<section id="post-share">
<h1>Share</h1>
<%= render "posts/partials/show/share", :post => @post %>
</section>
<section id="post-options">
<h1>Options</h1>
<%= render "posts/partials/show/options", :post => @post %>
</section>
<section id="post-options">
<h1>Options</h1>
<%= render "posts/partials/show/options", :post => @post %>
</section>
<section id="post-history">
<h1>History</h1>
<ul>
<li id="post-history-tags"><%= link_to "Tags", post_versions_path(search: { post_id: @post.id }) %></li>
<li id="post-history-pools"><%= link_to "Pools", pool_versions_path(search: { post_id: @post.id }) %></li>
<li id="post-history-notes"><%= link_to "Notes", note_versions_path(search: { post_id: @post.id }) %></li>
<li id="post-history-moderation"><%= link_to "Moderation", post_events_path(@post.id) %></li>
<li id="post-history-commentary"><%= link_to "Commentary", artist_commentary_versions_path(search: { post_id: @post.id }) %></li>
<li id="post-history-replacements"><%= link_to "Replacements", post_replacements_path(search: {post_id: @post.id }) %></li>
</ul>
</section>
</aside>
<section id="post-history">
<h1>History</h1>
<ul>
<li id="post-history-tags"><%= link_to "Tags", post_versions_path(search: { post_id: @post.id }) %></li>
<li id="post-history-pools"><%= link_to "Pools", pool_versions_path(search: { post_id: @post.id }) %></li>
<li id="post-history-notes"><%= link_to "Notes", note_versions_path(search: { post_id: @post.id }) %></li>
<li id="post-history-moderation"><%= link_to "Moderation", post_events_path(@post.id) %></li>
<li id="post-history-commentary"><%= link_to "Commentary", artist_commentary_versions_path(search: { post_id: @post.id }) %></li>
<li id="post-history-replacements"><%= link_to "Replacements", post_replacements_path(search: {post_id: @post.id }) %></li>
</ul>
</section>
<% end %>
<section id="content">
<% if @post.presenter.has_nav_links?(self) %>
<%= render "posts/partials/show/nav_links", :post => @post, :position => "top" %>
<% end %>
<% content_for(:content) do %>
<% if @post.presenter.has_nav_links?(self) %>
<%= render "posts/partials/show/nav_links", :post => @post, :position => "top" %>
<% end %>
<%= render "posts/partials/show/notices", :post => @post %>
<%= render "posts/partials/show/notices", :post => @post %>
<%= content_tag(:section, { id: "image-container" }.merge(PostPresenter.data_attributes(@post))) do -%>
<div id="note-container"></div>
<div id="note-preview"></div>
<%= render "posts/partials/show/embedded", post: @post %>
<% end -%>
<% if CurrentUser.is_member? %>
<%= content_tag(:div, class: "fav-buttons fav-buttons-#{@post.is_favorited?}") do %>
<%= form_tag(favorites_path(post_id: @post.id), method: "post", id: "add-fav-button", "data-remote": true) do %>
<%= button_tag tag.i(class: "far fa-heart"), class: "ui-button ui-widget ui-corner-all", "data-disable-with": tag.i(class: "fas fa-spinner fa-spin") %>
<% end %>
<%= form_tag(favorite_path(@post.id), method: "delete", id: "remove-fav-button", "data-remote": true) do %>
<%= button_tag tag.i(class: "fas fa-heart"), class: "ui-button ui-widget ui-corner-all", "data-disable-with": tag.i(class: "fas fa-spinner fa-spin") %>
<% end %>
<% end %>
<% end %>
<section id="mark-as-translated-section" style="display: none;">
<%= form_tag(mark_as_translated_post_path(@post), :class => "simple_form", :method => :put) do |f| %>
<%= hidden_field_tag :tags_query, params[:q] %>
<%= hidden_field_tag :pool_id, params[:pool_id] %>
<fieldset>
<label for="post_check_translation">
<%= check_box "post", "check_translation", :checked => @post.has_tag?("check_translation") %>
Check translation
</label>
<label for="post_partially_translated">
<%= check_box "post", "partially_translated", :checked => @post.has_tag?("partially_translated") %>
Partially translated
</label>
</fieldset>
<div class="input">
<%= submit_tag "Mark as translated" %>
</div>
<% end %>
</section>
<% if @post.artist_commentary && @post.artist_commentary.any_field_present? %>
<div id="artist-commentary">
<%= render "artist_commentaries/show", :artist_commentary => @post.artist_commentary %>
</div>
<% end %>
<% if @post.presenter.has_nav_links?(self) %>
<%= render "posts/partials/show/nav_links", :post => @post, :position => "bottom" %>
<% end %>
<menu id="post-sections">
<li class="active"><a href="#comments">Comments</a></li>
<% if RecommenderService.available_for_post?(@post) %>
<li><a href="#recommended">Recommended</a></li>
<% end %>
<% if CurrentUser.is_member? && @post.visible? %>
<li><a href="#edit" id="post-edit-link" data-shortcut="e">Edit</a></li>
<% end %>
</menu>
<% if RecommenderService.available_for_post?(@post) %>
<section id="recommended" style="display: none;">
<p><em>Loading...</em></p>
</section>
<% end %>
<section id="comments">
<% if !CurrentUser.user.is_builder? %>
<h2>Before commenting, read the <%= link_to "how to comment guide", wiki_pages_path(:search => {:title => "howto:comment"}) %>.</h2>
<% end %>
<%= render "comments/partials/index/list", comments: @comments, post: @post, page: :post %>
</section>
<section id="notes" style="display: none;">
<% if @post.has_notes? %>
<% cache("p/#{@post.id}/n/#{@post.last_noted_at.to_i}") do %>
<%= render :partial => "notes/note", :collection => @post.notes.active %>
<% end %>
<% end %>
</section>
<% if CurrentUser.is_member? && @post.visible? %>
<section id="edit" style="display: none;">
<%= render "posts/partials/show/edit", :post => @post %>
</section>
<% end %>
</section>
</div>
<%= content_tag(:section, { id: "image-container" }.merge(PostPresenter.data_attributes(@post))) do -%>
<div id="note-container"></div>
<div id="note-preview"></div>
<%= render "posts/partials/show/embedded", post: @post %>
<% end -%>
<% if CurrentUser.is_member? %>
<div id="add-to-pool-dialog" title="Add to pool" style="display: none;">
<%= render "pool_elements/new" %>
</div>
<%= content_tag(:div, class: "fav-buttons fav-buttons-#{@post.is_favorited?}") do %>
<%= form_tag(favorites_path(post_id: @post.id), method: "post", id: "add-fav-button", "data-remote": true) do %>
<%= button_tag tag.i(class: "far fa-heart"), class: "ui-button ui-widget ui-corner-all", "data-disable-with": tag.i(class: "fas fa-spinner fa-spin") %>
<% end %>
<div id="add-commentary-dialog" title="Add artist commentary" style="display: none;">
<%= render "artist_commentaries/form", :post => @post %>
</div>
<%= form_tag(favorite_path(@post.id), method: "delete", id: "remove-fav-button", "data-remote": true) do %>
<%= button_tag tag.i(class: "fas fa-heart"), class: "ui-button ui-widget ui-corner-all", "data-disable-with": tag.i(class: "fas fa-spinner fa-spin") %>
<% end %>
<% end %>
<% end %>
<div id="add-to-favgroup-dialog" title="Add to favorite group" style="display: none;">
<%= render "favorite_groups/add_to_favgroup_dialog", :post => @post %>
<section id="mark-as-translated-section" style="display: none;">
<%= form_tag(mark_as_translated_post_path(@post), :class => "simple_form", :method => :put) do |f| %>
<%= hidden_field_tag :tags_query, params[:q] %>
<%= hidden_field_tag :pool_id, params[:pool_id] %>
<fieldset>
<label for="post_check_translation">
<%= check_box "post", "check_translation", :checked => @post.has_tag?("check_translation") %>
Check translation
</label>
<label for="post_partially_translated">
<%= check_box "post", "partially_translated", :checked => @post.has_tag?("partially_translated") %>
Partially translated
</label>
</fieldset>
<div class="input">
<%= submit_tag "Mark as translated" %>
</div>
<% end %>
</section>
<% if @post.artist_commentary && @post.artist_commentary.any_field_present? %>
<div id="artist-commentary">
<%= render "artist_commentaries/show", :artist_commentary => @post.artist_commentary %>
</div>
<% end %>
</div>
<% if @post.presenter.has_nav_links?(self) %>
<%= render "posts/partials/show/nav_links", :post => @post, :position => "bottom" %>
<% end %>
<menu id="post-sections">
<li class="active"><a href="#comments">Comments</a></li>
<% if RecommenderService.available_for_post?(@post) %>
<li><a href="#recommended">Recommended</a></li>
<% end %>
<% if CurrentUser.is_member? && @post.visible? %>
<li><a href="#edit" id="post-edit-link" data-shortcut="e">Edit</a></li>
<% end %>
</menu>
<% if RecommenderService.available_for_post?(@post) %>
<section id="recommended" style="display: none;">
<p><em>Loading...</em></p>
</section>
<% end %>
<section id="comments">
<% if !CurrentUser.user.is_builder? %>
<h2>Before commenting, read the <%= link_to "how to comment guide", wiki_pages_path(:search => {:title => "howto:comment"}) %>.</h2>
<% end %>
<%= render "comments/partials/index/list", comments: @comments, post: @post, page: :post %>
</section>
<section id="notes" style="display: none;">
<% if @post.has_notes? %>
<% cache("p/#{@post.id}/n/#{@post.last_noted_at.to_i}") do %>
<%= render :partial => "notes/note", :collection => @post.notes.active %>
<% end %>
<% end %>
</section>
<% if CurrentUser.is_member? && @post.visible? %>
<section id="edit" style="display: none;">
<%= render "posts/partials/show/edit", :post => @post %>
</section>
<% end %>
<% end %>
<% if CurrentUser.is_member? %>
<div id="add-to-pool-dialog" title="Add to pool" style="display: none;">
<%= render "pool_elements/new" %>
</div>
<div id="add-commentary-dialog" title="Add artist commentary" style="display: none;">
<%= render "artist_commentaries/form", :post => @post %>
</div>
<div id="add-to-favgroup-dialog" title="Add to favorite group" style="display: none;">
<%= render "favorite_groups/add_to_favgroup_dialog", :post => @post %>
</div>
<% end %>
<%= post_view_count_js %>

View File

@@ -1,18 +1,18 @@
<div id="c-wiki-page-versions">
<div id="a-diff">
<h1>Wiki Page: <%= @thispage.title %></h1>
<%= render "wiki_pages/sidebar" %>
<% if @thispage.visible? %>
<p>Showing differences between <%= compact_time @thispage.updated_at %> (<%= link_to_user @thispage.updater %>) and <%= compact_time @otherpage.updated_at %> (<%= link_to_user @otherpage.updater %>)</p>
<% content_for(:content) do %>
<h1>Wiki Page: <%= @thispage.title %></h1>
<div>
<%= wiki_page_diff(@thispage, @otherpage) %>
</div>
<% else %>
<p>The artist requested removal of this page.</p>
<% end %>
</div>
</div>
<% if @thispage.visible? %>
<p>Showing differences between <%= compact_time @thispage.updated_at %> (<%= link_to_user @thispage.updater %>) and <%= compact_time @otherpage.updated_at %> (<%= link_to_user @otherpage.updater %>)</p>
<div>
<%= wiki_page_diff(@thispage, @otherpage) %>
</div>
<% else %>
<p>The artist requested removal of this page.</p>
<% end %>
<% end %>
<%= render "wiki_pages/secondary_links" %>

View File

@@ -1,19 +1,15 @@
<div id="c-wiki-page-versions">
<div id="a-index">
<%= render "wiki_pages/sidebar" %>
<%= render "wiki_pages/sidebar" %>
<section id="content">
<h1>Wiki Page History</h1>
<% content_for(:content) do %>
<h1>Wiki Page History</h1>
<% if params.dig(:search, :wiki_page_id).present? %>
<%= render "page_listing" %>
<% else %>
<%= render "global_listing" %>
<% end %>
<% if params.dig(:search, :wiki_page_id).present? %>
<%= render "page_listing" %>
<% else %>
<%= render "global_listing" %>
<% end %>
<%= numbered_paginator(@wiki_page_versions) %>
</section>
</div>
</div>
<%= numbered_paginator(@wiki_page_versions) %>
<% end %>
<%= render "wiki_pages/secondary_links" %>

View File

@@ -1,24 +1,20 @@
<div id="c-wiki-page-versions">
<div id="a-show">
<%= render "wiki_pages/sidebar" %>
<%= render "wiki_pages/sidebar" %>
<section id="content">
<h1 id="wiki-page-title"><%= @wiki_page_version.pretty_title %></h1>
<p class="fineprint"><%= time_ago_in_words_tagged(@wiki_page_version.updated_at) %></p>
<% content_for(:content) do %>
<h1 id="wiki-page-title"><%= @wiki_page_version.pretty_title %></h1>
<p class="fineprint"><%= time_ago_in_words_tagged(@wiki_page_version.updated_at) %></p>
<div id="wiki-page-body" class="dtext prose">
<% if @wiki_page_version.visible? %>
<% if @wiki_page_version.other_names.present? %>
<p><%= wiki_page_other_names_list(@wiki_page_version) %></p>
<% end %>
<div id="wiki-page-body" class="dtext prose">
<% if @wiki_page_version.visible? %>
<% if @wiki_page_version.other_names.present? %>
<p><%= wiki_page_other_names_list(@wiki_page_version) %></p>
<% end %>
<%= format_text(@wiki_page_version.body) %>
<% else %>
<p>The artist has requested removal of this page.</p>
<% end %>
</div>
</section>
<%= format_text(@wiki_page_version.body) %>
<% else %>
<p>The artist has requested removal of this page.</p>
<% end %>
</div>
</div>
<% end %>
<%= render "wiki_pages/secondary_links" %>

View File

@@ -1,4 +1,4 @@
<aside id="sidebar">
<% content_for(:sidebar) do %>
<%= render "posts/partials/index/blacklist" %>
<%= render "wiki_pages/recent_changes" %>
</aside>
<% end %>

View File

@@ -1,17 +1,13 @@
<div id="c-wiki-pages">
<div id="a-edit">
<%= render "sidebar" %>
<%= render "sidebar" %>
<section id="content">
<h1>Edit Wiki</h1>
<% content_for(:content) do %>
<h1>Edit Wiki</h1>
<% if @wiki_page.visible? %>
<%= render "form" %>
<% else %>
<p>The artist requested removal of this page.</p>
<% end %>
</section>
</div>
</div>
<% if @wiki_page.visible? %>
<%= render "form" %>
<% else %>
<p>The artist requested removal of this page.</p>
<% end %>
<% end %>
<%= render "secondary_links" %>

View File

@@ -1,30 +1,26 @@
<div id="c-wiki-pages">
<div id="a-index">
<%= render "sidebar" %>
<%= render "sidebar" %>
<section id="content">
<h1>Wiki</h1>
<% content_for(:content) do %>
<h1>Wiki</h1>
<table class="striped" width="100%">
<thead>
<tr>
<th>Title</th>
<th>Last edited</th>
</tr>
</thead>
<tbody>
<% @wiki_pages.each do |wiki_page| %>
<tr>
<td class="category-<%= wiki_page.category_name %>"><%= link_to wiki_page.pretty_title, wiki_page_path(wiki_page, :noredirect => 1) %></td>
<td><%= wiki_page.updated_at.strftime("%Y-%m-%d %H:%M") %> by <%= h link_to_user wiki_page.updater %></td>
</tr>
<% end %>
</tbody>
</table>
<table class="striped" width="100%">
<thead>
<tr>
<th>Title</th>
<th>Last edited</th>
</tr>
</thead>
<tbody>
<% @wiki_pages.each do |wiki_page| %>
<tr>
<td class="category-<%= wiki_page.category_name %>"><%= link_to wiki_page.pretty_title, wiki_page_path(wiki_page, :noredirect => 1) %></td>
<td><%= wiki_page.updated_at.strftime("%Y-%m-%d %H:%M") %> by <%= h link_to_user wiki_page.updater %></td>
</tr>
<% end %>
</tbody>
</table>
<%= numbered_paginator(@wiki_pages) %>
</section>
</div>
</div>
<%= numbered_paginator(@wiki_pages) %>
<% end %>
<%= render "secondary_links" %>

View File

@@ -1,26 +1,17 @@
<div id="c-wiki-pages">
<div id="a-new">
<%= render "sidebar" %>
<%= render "sidebar" %>
<section id="content">
<h1>New Wiki Page</h1>
<% content_for(:content) do %>
<h1>New Wiki Page</h1>
<% if @wiki_page.title.present? %>
<div class="notice notice-info notice-small" id="new-wiki-page-notice">
This wiki page does not yet exist. The form below will allow you to create a new page for <%= @wiki_page.title %>. It will act as an explanation on how to use the tag for other users on the site.
</div>
<% end %>
<% if @wiki_page.title.present? %>
<div class="notice notice-info notice-small" id="new-wiki-page-notice">
This wiki page does not yet exist. The form below will allow you to create a new page for <%= @wiki_page.title %>. It will act as an explanation on how to use the tag for other users on the site.
</div>
<% end %>
<%= render "form" %>
<%= wiki_page_alias_and_implication_list(@wiki_page)%>
<%= wiki_page_post_previews(@wiki_page) %>
<div class="clearfix"></div>
</section>
</div>
</div>
<%= render "form" %>
<%= wiki_page_alias_and_implication_list(@wiki_page)%>
<%= wiki_page_post_previews(@wiki_page) %>
<% end %>
<%= render "secondary_links" %>

View File

@@ -1,43 +1,38 @@
<div id="c-wiki-pages">
<div id="a-show">
<%= render "sidebar" %>
<%= render "sidebar" %>
<section id="content">
<h1 id="wiki-page-title">
<% content_for(:content) do %>
<h1 id="wiki-page-title">
<%= link_to @wiki_page.pretty_title, posts_path(:tags => @wiki_page.title), :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? %>
(locked)
<% end %>
<% if @wiki_page.is_locked? %>
(locked)
<% end %>
<% if @wiki_page.is_deleted? %>
(deleted)
<% end %>
</h1>
<% if @wiki_page.is_deleted? %>
(deleted)
<% end %>
</h1>
<div id="wiki-page-body" class="prose">
<% if @wiki_page.visible? %>
<% if @wiki_page.other_names.present? %>
<p><%= wiki_page_other_names_list(@wiki_page) %></p>
<% end %>
<div id="wiki-page-body" class="prose">
<% if @wiki_page.visible? %>
<% if @wiki_page.other_names.present? %>
<p><%= wiki_page_other_names_list(@wiki_page) %></p>
<% end %>
<%= format_text(@wiki_page.body) %>
<%= format_text(@wiki_page.body) %>
<% if @wiki_page.artist %>
<p><%= link_to "View artist", @wiki_page.artist %></p>
<% end %>
<% if @wiki_page.artist %>
<p><%= link_to "View artist", @wiki_page.artist %></p>
<% end %>
<%= wiki_page_alias_and_implication_list(@wiki_page) %>
<% else %>
<p>This artist has requested removal of their information.</p>
<% end %>
</div>
<%= wiki_page_post_previews(@wiki_page) %>
</section>
<%= wiki_page_alias_and_implication_list(@wiki_page) %>
<% else %>
<p>This artist has requested removal of their information.</p>
<% end %>
</div>
</div>
<%= wiki_page_post_previews(@wiki_page) %>
<% end %>
<% content_for(:page_title) do %>
Wiki - <%= @wiki_page.pretty_title %> - <%= Danbooru.config.app_name %>

View File

@@ -1,25 +1,21 @@
<div id="c-wiki-pages">
<div id="a-show">
<%= render "sidebar" %>
<%= render "sidebar" %>
<section id="content">
<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">
<p>This wiki page does not exist. <%= link_to "Create new wiki page", new_wiki_page_path(:wiki_page => {:title => params[:title]}) %>.</p>
</div>
<% if @wiki_page.artist.present? %>
<p><%= link_to "View artist", @wiki_page.artist %></p>
<% end %>
<%= wiki_page_alias_and_implication_list(@wiki_page)%>
<%= wiki_page_post_previews(@wiki_page) %>
</section>
<% content_for(:content) do %>
<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">
<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>
<% if @wiki_page.artist.present? %>
<p><%= link_to "View artist", @wiki_page.artist %></p>
<% end %>
<%= wiki_page_alias_and_implication_list(@wiki_page)%>
<%= wiki_page_post_previews(@wiki_page) %>
<% end %>
<%= render "secondary_links" %>