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

View File

@@ -1,5 +1,6 @@
class WikiPageVersionsController < ApplicationController class WikiPageVersionsController < ApplicationController
respond_to :html, :xml, :json respond_to :html, :xml, :json
layout "sidebar"
def index def index
@wiki_page_versions = WikiPageVersion.search(search_params).paginate(params[:page], :limit => params[:limit], :search_count => params[:search]) @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 :member_only, :except => [:index, :search, :show, :show_or_new]
before_action :builder_only, :only => [:destroy] before_action :builder_only, :only => [:destroy]
before_action :normalize_search_params, :only => [:index] before_action :normalize_search_params, :only => [:index]
layout "sidebar"
def new def new
@wiki_page = WikiPage.new(wiki_page_params(:create)) @wiki_page = WikiPage.new(wiki_page_params(:create))
respond_with(@wiki_page) respond_with(@wiki_page)
@@ -30,6 +31,7 @@ class WikiPagesController < ApplicationController
end end
def search def search
render layout: "default"
end end
def show def show

View File

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

View File

@@ -1,155 +1,151 @@
<div id="c-posts"> <% content_for(:sidebar) do %>
<div id="a-show"> <%= render "posts/partials/common/search", :path => posts_path, :tags => params[:q], :tags_dom_id => "tags" %>
<aside id="sidebar">
<%= 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"> <section id="tag-list">
<%= @post.presenter.split_tag_list_html(current_query: params[:q], show_extra_links: CurrentUser.user.is_gold?) %> <%= @post.presenter.split_tag_list_html(current_query: params[:q], show_extra_links: CurrentUser.user.is_gold?) %>
</section> </section>
<section id="post-information"> <section id="post-information">
<h1>Information</h1> <h1>Information</h1>
<%= render "posts/partials/show/information", :post => @post %> <%= render "posts/partials/show/information", :post => @post %>
</section> </section>
<section id="post-share"> <section id="post-share">
<h1>Share</h1> <h1>Share</h1>
<%= render "posts/partials/show/share", :post => @post %> <%= render "posts/partials/show/share", :post => @post %>
</section> </section>
<section id="post-options"> <section id="post-options">
<h1>Options</h1> <h1>Options</h1>
<%= render "posts/partials/show/options", :post => @post %> <%= render "posts/partials/show/options", :post => @post %>
</section> </section>
<section id="post-history"> <section id="post-history">
<h1>History</h1> <h1>History</h1>
<ul> <ul>
<li id="post-history-tags"><%= link_to "Tags", post_versions_path(search: { post_id: @post.id }) %></li> <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-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-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-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-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> <li id="post-history-replacements"><%= link_to "Replacements", post_replacements_path(search: {post_id: @post.id }) %></li>
</ul> </ul>
</section> </section>
</aside> <% end %>
<section id="content"> <% content_for(:content) do %>
<% if @post.presenter.has_nav_links?(self) %> <% if @post.presenter.has_nav_links?(self) %>
<%= render "posts/partials/show/nav_links", :post => @post, :position => "top" %> <%= render "posts/partials/show/nav_links", :post => @post, :position => "top" %>
<% end %> <% 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 -%> <%= content_tag(:section, { id: "image-container" }.merge(PostPresenter.data_attributes(@post))) do -%>
<div id="note-container"></div> <div id="note-container"></div>
<div id="note-preview"></div> <div id="note-preview"></div>
<%= render "posts/partials/show/embedded", post: @post %> <%= render "posts/partials/show/embedded", post: @post %>
<% end -%> <% 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>
<% if CurrentUser.is_member? %> <% if CurrentUser.is_member? %>
<div id="add-to-pool-dialog" title="Add to pool" style="display: none;"> <%= content_tag(:div, class: "fav-buttons fav-buttons-#{@post.is_favorited?}") do %>
<%= render "pool_elements/new" %> <%= form_tag(favorites_path(post_id: @post.id), method: "post", id: "add-fav-button", "data-remote": true) do %>
</div> <%= 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;"> <%= form_tag(favorite_path(@post.id), method: "delete", id: "remove-fav-button", "data-remote": true) do %>
<%= render "artist_commentaries/form", :post => @post %> <%= 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") %>
</div> <% end %>
<% end %>
<% end %>
<div id="add-to-favgroup-dialog" title="Add to favorite group" style="display: none;"> <section id="mark-as-translated-section" style="display: none;">
<%= render "favorite_groups/add_to_favgroup_dialog", :post => @post %> <%= 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> </div>
<% end %> <% 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 %> <%= post_view_count_js %>

View File

@@ -1,18 +1,18 @@
<div id="c-wiki-page-versions"> <%= render "wiki_pages/sidebar" %>
<div id="a-diff">
<h1>Wiki Page: <%= @thispage.title %></h1>
<% if @thispage.visible? %> <% content_for(:content) do %>
<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> <h1>Wiki Page: <%= @thispage.title %></h1>
<div> <% if @thispage.visible? %>
<%= wiki_page_diff(@thispage, @otherpage) %> <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>
<% else %> <div>
<p>The artist requested removal of this page.</p> <%= wiki_page_diff(@thispage, @otherpage) %>
<% end %> </div>
</div> <% else %>
</div> <p>The artist requested removal of this page.</p>
<% end %>
<% end %>
<%= render "wiki_pages/secondary_links" %> <%= render "wiki_pages/secondary_links" %>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,26 +1,17 @@
<div id="c-wiki-pages"> <%= render "sidebar" %>
<div id="a-new">
<%= render "sidebar" %>
<section id="content"> <% content_for(:content) do %>
<h1>New Wiki Page</h1> <h1>New Wiki Page</h1>
<% if @wiki_page.title.present? %> <% if @wiki_page.title.present? %>
<div class="notice notice-info notice-small" id="new-wiki-page-notice"> <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. 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> </div>
<% end %> <% end %>
<%= render "form" %> <%= render "form" %>
<%= wiki_page_alias_and_implication_list(@wiki_page)%>
<%= wiki_page_alias_and_implication_list(@wiki_page)%> <%= wiki_page_post_previews(@wiki_page) %>
<% end %>
<%= wiki_page_post_previews(@wiki_page) %>
<div class="clearfix"></div>
</section>
</div>
</div>
<%= render "secondary_links" %> <%= render "secondary_links" %>

View File

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

View File

@@ -1,25 +1,21 @@
<div id="c-wiki-pages"> <%= render "sidebar" %>
<div id="a-show">
<%= render "sidebar" %>
<section id="content"> <% content_for(:content) do %>
<h1 id="wiki-page-title"> <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}" %>
</h1> </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>
<% 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>
</div> </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" %> <%= render "secondary_links" %>