Merge branch 'master' of github.com:r888888888/danbooru
This commit is contained in:
@@ -7,6 +7,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
Danbooru.Dtext.call_preview = function(e, $button, $input, $preview) {
|
Danbooru.Dtext.call_preview = function(e, $button, $input, $preview) {
|
||||||
|
$button.val("Edit");
|
||||||
|
$input.hide();
|
||||||
|
$preview.text("Loading...").fadeIn("fast");
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "post",
|
type: "post",
|
||||||
url: "/dtext_preview",
|
url: "/dtext_preview",
|
||||||
@@ -14,8 +17,6 @@
|
|||||||
body: $input.val()
|
body: $input.val()
|
||||||
},
|
},
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
$button.val("Edit");
|
|
||||||
$input.hide();
|
|
||||||
$preview.html(data).fadeIn("fast");
|
$preview.html(data).fadeIn("fast");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -66,8 +66,18 @@ Danbooru.Note = {
|
|||||||
var $note_box_inner = $(e.currentTarget);
|
var $note_box_inner = $(e.currentTarget);
|
||||||
if (e.type === "mouseover") {
|
if (e.type === "mouseover") {
|
||||||
Danbooru.Note.Body.show($note_box_inner.data("id"));
|
Danbooru.Note.Body.show($note_box_inner.data("id"));
|
||||||
|
if (Danbooru.Note.editing) {
|
||||||
|
var $this = $(this);
|
||||||
|
$this.resizable("enable");
|
||||||
|
$this.draggable("enable");
|
||||||
|
}
|
||||||
} else if (e.type === "mouseout") {
|
} else if (e.type === "mouseout") {
|
||||||
Danbooru.Note.Body.hide($note_box_inner.data("id"));
|
Danbooru.Note.Body.hide($note_box_inner.data("id"));
|
||||||
|
if (Danbooru.Note.editing) {
|
||||||
|
var $this = $(this);
|
||||||
|
$this.resizable("disable");
|
||||||
|
$this.draggable("disable");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
@@ -162,10 +172,6 @@ Danbooru.Note = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
show: function(id) {
|
show: function(id) {
|
||||||
if (Danbooru.Note.editing) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Danbooru.Note.Body.hide_all();
|
Danbooru.Note.Body.hide_all();
|
||||||
Danbooru.Note.clear_timeouts();
|
Danbooru.Note.clear_timeouts();
|
||||||
var $note_body = Danbooru.Note.Body.find(id);
|
var $note_body = Danbooru.Note.Body.find(id);
|
||||||
@@ -312,7 +318,7 @@ Danbooru.Note = {
|
|||||||
$(".note-box").resizable("enable");
|
$(".note-box").resizable("enable");
|
||||||
$(".note-box").draggable("enable");
|
$(".note-box").draggable("enable");
|
||||||
});
|
});
|
||||||
// Danbooru.Note.editing = true;
|
Danbooru.Note.editing = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
parameterize_note: function($note_box, $note_body) {
|
parameterize_note: function($note_box, $note_body) {
|
||||||
@@ -410,7 +416,7 @@ Danbooru.Note = {
|
|||||||
var id = $this.data("id");
|
var id = $this.data("id");
|
||||||
Danbooru.Note.Box.find(id).remove();
|
Danbooru.Note.Box.find(id).remove();
|
||||||
Danbooru.Note.Body.find(id).remove();
|
Danbooru.Note.Body.find(id).remove();
|
||||||
$(this).dialog("close");
|
$this.dialog("close");
|
||||||
|
|
||||||
if (id.match(/\d/)) {
|
if (id.match(/\d/)) {
|
||||||
$.ajax("/notes/" + id + ".js", {
|
$.ajax("/notes/" + id + ".js", {
|
||||||
@@ -480,7 +486,7 @@ Danbooru.Note = {
|
|||||||
dragging: false,
|
dragging: false,
|
||||||
dragStartX: 0,
|
dragStartX: 0,
|
||||||
dragStartY: 0,
|
dragStartY: 0,
|
||||||
dragDistanceY: 0,
|
dragDistanceX: 0,
|
||||||
dragDistanceY: 0,
|
dragDistanceY: 0,
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0,
|
y: 0,
|
||||||
|
|||||||
@@ -137,10 +137,12 @@
|
|||||||
|
|
||||||
Danbooru.Post.initialize_post_relationship_previews = function() {
|
Danbooru.Post.initialize_post_relationship_previews = function() {
|
||||||
var current_post_id = $("meta[name=post-id]").attr("content");
|
var current_post_id = $("meta[name=post-id]").attr("content");
|
||||||
$("#post_" + current_post_id).css("background-color", "rgba(0,0,0,0.05)");
|
$("#post_" + current_post_id).addClass("current-post");
|
||||||
|
|
||||||
this.toggle_relationship_preview($("#has-children-relationship-preview"), $("#has-children-relationship-preview-link"));
|
if (Danbooru.Cookie.get("show-relationship-previews") === "0") {
|
||||||
this.toggle_relationship_preview($("#has-parent-relationship-preview"), $("#has-parent-relationship-preview-link"));
|
this.toggle_relationship_preview($("#has-children-relationship-preview"), $("#has-children-relationship-preview-link"));
|
||||||
|
this.toggle_relationship_preview($("#has-parent-relationship-preview"), $("#has-parent-relationship-preview-link"));
|
||||||
|
}
|
||||||
|
|
||||||
$("#has-children-relationship-preview-link").click(function(e) {
|
$("#has-children-relationship-preview-link").click(function(e) {
|
||||||
Danbooru.Post.toggle_relationship_preview($("#has-children-relationship-preview"), $(this));
|
Danbooru.Post.toggle_relationship_preview($("#has-children-relationship-preview"), $(this));
|
||||||
@@ -157,15 +159,21 @@
|
|||||||
preview.toggle();
|
preview.toggle();
|
||||||
if (preview.is(":visible")) {
|
if (preview.is(":visible")) {
|
||||||
preview_link.html("« hide");
|
preview_link.html("« hide");
|
||||||
|
Danbooru.Cookie.put("show-relationship-previews", "1");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
preview_link.html("show »");
|
preview_link.html("show »");
|
||||||
|
Danbooru.Cookie.put("show-relationship-previews", "0");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Danbooru.Post.initialize_favlist = function() {
|
Danbooru.Post.initialize_favlist = function() {
|
||||||
$("#favlist").hide();
|
$("#favlist").hide();
|
||||||
$("#hide-favlist-link").hide();
|
$("#hide-favlist-link").hide();
|
||||||
|
var fav_count = $("#show-favlist-link").prev().text();
|
||||||
|
if (fav_count === "0") {
|
||||||
|
$("#show-favlist-link").hide();
|
||||||
|
}
|
||||||
|
|
||||||
$("#show-favlist-link").click(function(e) {
|
$("#show-favlist-link").click(function(e) {
|
||||||
$("#favlist").show();
|
$("#favlist").show();
|
||||||
@@ -217,10 +225,10 @@
|
|||||||
|
|
||||||
if (border_colors.length > 1) {
|
if (border_colors.length > 1) {
|
||||||
$img.css("border", "2px solid");
|
$img.css("border", "2px solid");
|
||||||
if (border_colors.length === 3) {
|
if (border_colors.length === 2) {
|
||||||
$img.css("border-color", border_colors[0] + " " + border_colors[2] + " " + border_colors[2] + " " + border_colors[1]);
|
|
||||||
} else if (border_colors.length === 2) {
|
|
||||||
$img.css("border-color", border_colors[0] + " " + border_colors[1] + " " + border_colors[1] + " " + border_colors[0]);
|
$img.css("border-color", border_colors[0] + " " + border_colors[1] + " " + border_colors[1] + " " + border_colors[0]);
|
||||||
|
} else if (border_colors.length === 3) {
|
||||||
|
$img.css("border-color", border_colors[0] + " " + border_colors[2] + " " + border_colors[2] + " " + border_colors[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,8 +160,9 @@
|
|||||||
query = query.replace(/_/g, " ");
|
query = query.replace(/_/g, " ");
|
||||||
var header = $("<em/>");
|
var header = $("<em/>");
|
||||||
|
|
||||||
if (match = query.match(/^wiki:(.+)/)) {
|
var match = query.match(/^wiki:(.+)/);
|
||||||
header.html($("<a/>").attr("href", "/wiki_pages?title=" + match[1]).attr("target", "_blank").text(query));
|
if (match) {
|
||||||
|
header.html($("<a/>").attr("href", "/wiki_pages?title=" + encodeURIComponent(match[1])).attr("target", "_blank").text(query));
|
||||||
} else {
|
} else {
|
||||||
header.text(query);
|
header.text(query);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,4 +53,8 @@ div#c-forum-topics {
|
|||||||
span.locked-topic {
|
span.locked-topic {
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tr.forum-topic-row td:last-child {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,23 @@ a.blacklisted-active {
|
|||||||
border: 2px solid #F00;
|
border: 2px solid #F00;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.post-preview.current-post {
|
||||||
|
background-color: rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
#has-parent-relationship-preview, #has-children-relationship-preview {
|
||||||
|
overflow-x: auto;
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
|
article.post-preview {
|
||||||
|
float: none;
|
||||||
|
width: auto;
|
||||||
|
border: none;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 5px 5px 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.category-1 a, a.tag-type-1 {
|
.category-1 a, a.tag-type-1 {
|
||||||
color: #A00;
|
color: #A00;
|
||||||
}
|
}
|
||||||
@@ -153,8 +170,8 @@ div#c-posts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
div.nav-notice {
|
div.nav-notice {
|
||||||
padding: 0.5em 0.5em 0;
|
padding: 0.5em;
|
||||||
margin-bottom: 1em;
|
margin: 1em 0;
|
||||||
background: #EEE;
|
background: #EEE;
|
||||||
border: 1px solid #AAA;
|
border: 1px solid #AAA;
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -247,11 +264,6 @@ div#c-posts {
|
|||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
#nav-links {
|
|
||||||
margin: 1em 0;
|
|
||||||
padding: 0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
#content.with-ads {
|
#content.with-ads {
|
||||||
margin-right: 7em;
|
margin-right: 7em;
|
||||||
}
|
}
|
||||||
@@ -261,6 +273,10 @@ div#c-posts {
|
|||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#search-seq-nav + #pool-nav {
|
||||||
|
margin-top: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
#pool-nav, #search-seq-nav, #nav-help {
|
#pool-nav, #search-seq-nav, #nav-help {
|
||||||
li {
|
li {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@@ -27,4 +27,9 @@ div#c-wiki-pages {
|
|||||||
margin-left: 15em;
|
margin-left: 15em;
|
||||||
padding-left: 1em;
|
padding-left: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.redirected-from {
|
||||||
|
font-size: 0.8em;
|
||||||
|
margin-bottom: 1em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,8 +67,15 @@ class WikiPagesController < ApplicationController
|
|||||||
|
|
||||||
def show_or_new
|
def show_or_new
|
||||||
@wiki_page = WikiPage.find_by_title(params[:title])
|
@wiki_page = WikiPage.find_by_title(params[:title])
|
||||||
if @wiki_page
|
tag_alias = TagAlias.where("status = 'active' and antecedent_name = ?", params[:title]).first
|
||||||
redirect_to wiki_page_path(@wiki_page)
|
|
||||||
|
if tag_alias && params[:no_redirect].blank?
|
||||||
|
redirect_to show_or_new_wiki_pages_path(:title => tag_alias.consequent_name, :redirected_from => params[:title])
|
||||||
|
elsif @wiki_page
|
||||||
|
redirect_to wiki_page_path(@wiki_page, :redirected_from => params[:redirected_from])
|
||||||
|
else
|
||||||
|
@wiki_page = WikiPage.new(:title => params[:title])
|
||||||
|
respond_with(@wiki_page)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ module WikiPagesHelper
|
|||||||
|
|
||||||
if consequent_aliases.any?
|
if consequent_aliases.any?
|
||||||
html << "<p class='hint'>The following tags are aliased to this tag: "
|
html << "<p class='hint'>The following tags are aliased to this tag: "
|
||||||
html << raw(consequent_aliases.map {|x| link_to(x.antecedent_name, show_or_new_wiki_pages_path(:title => x.antecedent_name))}.join(", "))
|
html << raw(consequent_aliases.map {|x| link_to(x.antecedent_name, show_or_new_wiki_pages_path(:title => x.antecedent_name, :no_redirect => true))}.join(", "))
|
||||||
html << ".</p>"
|
html << ".</p>"
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -33,4 +33,17 @@ module WikiPagesHelper
|
|||||||
|
|
||||||
html.html_safe
|
html.html_safe
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def wiki_page_post_previews(wiki_page)
|
||||||
|
html = '<div id="wiki-page-posts">'
|
||||||
|
|
||||||
|
if Post.fast_count(wiki_page.title) > 0
|
||||||
|
html << "<h2>Posts</h2>"
|
||||||
|
html << wiki_page.post_set.presenter.post_previews_html(self)
|
||||||
|
end
|
||||||
|
|
||||||
|
html << "</div>"
|
||||||
|
|
||||||
|
html.html_safe
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ module Moderator
|
|||||||
|
|
||||||
def initialize(min_date, max_level)
|
def initialize(min_date, max_level)
|
||||||
@min_date = min_date.present? ? min_date.to_date : 1.week.ago
|
@min_date = min_date.present? ? min_date.to_date : 1.week.ago
|
||||||
@max_level = max_level.present? ? User::Levels::MEMBER : max_level.to_i
|
@max_level = max_level.present? ? max_level.to_i : User::Levels::MEMBER
|
||||||
end
|
end
|
||||||
|
|
||||||
def artists
|
def artists
|
||||||
|
|||||||
@@ -69,10 +69,6 @@ module PostSets
|
|||||||
tag_string =~ /\*/
|
tag_string =~ /\*/
|
||||||
end
|
end
|
||||||
|
|
||||||
def is_empty_search?
|
|
||||||
posts.count == 0
|
|
||||||
end
|
|
||||||
|
|
||||||
def current_page
|
def current_page
|
||||||
[page.to_i, 1].max
|
[page.to_i, 1].max
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ module PostSets
|
|||||||
class SearchError < Exception
|
class SearchError < Exception
|
||||||
end
|
end
|
||||||
|
|
||||||
class WikiPage < Post
|
class WikiPage < PostSets::Post
|
||||||
def presenter
|
def presenter
|
||||||
@presenter ||= ::PostSetPresenters::WikiPage.new(self)
|
@presenter ||= ::PostSetPresenters::WikiPage.new(self)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -47,6 +47,10 @@ class UserFeedback < ActiveRecord::Base
|
|||||||
q = q.where("creator_id = (select _.id from users _ where lower(_.name) = ?)", params[:creator_name].mb_chars.downcase)
|
q = q.where("creator_id = (select _.id from users _ where lower(_.name) = ?)", params[:creator_name].mb_chars.downcase)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if params[:category].present?
|
||||||
|
q = q.where("category = ?", params[:category])
|
||||||
|
end
|
||||||
|
|
||||||
q
|
q
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ module PostSetPresenters
|
|||||||
|
|
||||||
posts.each do |post|
|
posts.each do |post|
|
||||||
html << PostPresenter.preview(post, :tags => @post_set.tag_string)
|
html << PostPresenter.preview(post, :tags => @post_set.tag_string)
|
||||||
|
html << "\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
html.html_safe
|
html.html_safe
|
||||||
|
|||||||
@@ -9,9 +9,7 @@ module PostSetPresenters
|
|||||||
end
|
end
|
||||||
|
|
||||||
def related_tags
|
def related_tags
|
||||||
if post_set.is_empty_search?
|
if post_set.is_pattern_search?
|
||||||
suggested_tags
|
|
||||||
elsif post_set.is_pattern_search?
|
|
||||||
pattern_tags
|
pattern_tags
|
||||||
elsif post_set.is_tag_subscription?
|
elsif post_set.is_tag_subscription?
|
||||||
post_set.tag_subscription_tags
|
post_set.tag_subscription_tags
|
||||||
@@ -41,12 +39,6 @@ module PostSetPresenters
|
|||||||
Tag.name_matches(post_set.tag_string).all(:select => "name", :limit => Danbooru.config.tag_query_limit, :order => "post_count DESC").map(&:name)
|
Tag.name_matches(post_set.tag_string).all(:select => "name", :limit => Danbooru.config.tag_query_limit, :order => "post_count DESC").map(&:name)
|
||||||
end
|
end
|
||||||
|
|
||||||
def suggested_tags
|
|
||||||
if post_set.tag_string.length >= 3
|
|
||||||
Tag.name_matches("*#{post_set.tag_string}*").where("post_count > 0").all(:select => "name", :limit => Danbooru.config.tag_query_limit, :order => "post_count DESC").map(&:name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def related_tags_for_group
|
def related_tags_for_group
|
||||||
RelatedTagCalculator.calculate_from_sample_to_array(post_set.tag_string).map(&:first)
|
RelatedTagCalculator.calculate_from_sample_to_array(post_set.tag_string).map(&:first)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
module PostSetPresenters
|
module PostSetPresenters
|
||||||
class WikiPage < Post
|
class WikiPage < PostSetPresenters::Post
|
||||||
def posts
|
def posts
|
||||||
@post_set.posts
|
@post_set.posts
|
||||||
rescue ActiveRecord::StatementInvalid, PGError
|
rescue ActiveRecord::StatementInvalid, PGError
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<%= form_tag(comments_path, :class => "simple_form") do %>
|
<%= form_tag(comments_path, :class => "simple_form") do %>
|
||||||
<%= hidden_field "comment", "post_id", :value => post.id %>
|
<%= hidden_field "comment", "post_id", :value => post.id %>
|
||||||
<%= dtext_field "comment", "body", :input_id => "comment_response_for_#{post.id}", :preview_id => "dtext-preview-for-#{post.id}" %>
|
<%= dtext_field "comment", "body", :input_id => "comment_response_for_#{post.id}", :preview_id => "dtext-preview-for-#{post.id}" %>
|
||||||
|
<%= submit_tag "Post" %>
|
||||||
<%= dtext_preview_button "comment", "body", :input_id => "comment_response_for_#{post.id}", :preview_id => "dtext-preview-for-#{post.id}" %>
|
<%= dtext_preview_button "comment", "body", :input_id => "comment_response_for_#{post.id}", :preview_id => "dtext-preview-for-#{post.id}" %>
|
||||||
<%= submit_tag "Post" %> <%= check_box "comment", "do_not_bump_post", :id => "comment_do_not_bump_post_#{post.id}" %> <label for="comment_do_not_bump_post_<%= post.id %>">No bump</label>
|
<%= check_box "comment", "do_not_bump_post", :id => "comment_do_not_bump_post_#{post.id}" %> <label for="comment_do_not_bump_post_<%= post.id %>">No bump</label>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -5,5 +5,11 @@
|
|||||||
$("a#remove-from-favorites").show();
|
$("a#remove-from-favorites").show();
|
||||||
$("#score-for-post-<%= @post.id %>").html(<%= @post.score %>);
|
$("#score-for-post-<%= @post.id %>").html(<%= @post.score %>);
|
||||||
$("#favcount-for-post-<%= @post.id %>").html(<%= @post.fav_count %>);
|
$("#favcount-for-post-<%= @post.id %>").html(<%= @post.fav_count %>);
|
||||||
|
<% if CurrentUser.is_gold? %>
|
||||||
|
$("#favlist").html("<%= escape_javascript(post_favlist(@post)) %>");
|
||||||
|
if (!$("#favlist").is(":visible")) {
|
||||||
|
$("#show-favlist-link").show();
|
||||||
|
}
|
||||||
|
<% end %>
|
||||||
Danbooru.notice("You have favorited this post");
|
Danbooru.notice("You have favorited this post");
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -2,4 +2,10 @@ $("a#add-to-favorites").show();
|
|||||||
$("a#remove-from-favorites").hide();
|
$("a#remove-from-favorites").hide();
|
||||||
$("#score-for-post-<%= @post.id %>").html(<%= @post.score %>);
|
$("#score-for-post-<%= @post.id %>").html(<%= @post.score %>);
|
||||||
$("#favcount-for-post-<%= @post.id %>").html(<%= @post.fav_count %>);
|
$("#favcount-for-post-<%= @post.id %>").html(<%= @post.fav_count %>);
|
||||||
|
<% if CurrentUser.is_gold? %>
|
||||||
|
$("#favlist").html("<%= escape_javascript(post_favlist(@post)) %>");
|
||||||
|
<% if @post.fav_count == 0 %>
|
||||||
|
$("#show-favlist-link, #hide-favlist-link, #favlist").hide();
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
Danbooru.notice("You have unfavorited this post");
|
Danbooru.notice("You have unfavorited this post");
|
||||||
|
|||||||
@@ -37,8 +37,11 @@
|
|||||||
<li><%= link_to "Edit", edit_forum_post_path(forum_post.id) %></li>
|
<li><%= link_to "Edit", edit_forum_post_path(forum_post.id) %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<li><%= link_to "Parent", forum_topic_path(forum_post.topic, :page => forum_post.forum_topic_page, :anchor => "forum_post_#{forum_post.id}") %></li>
|
<% if params[:controller] == "forum_posts" %>
|
||||||
<li><%= link_to "Permalink", forum_post_path(forum_post) %></li>
|
<li><%= link_to "Parent", forum_topic_path(forum_post.topic, :page => forum_post.forum_topic_page, :anchor => "forum_post_#{forum_post.id}") %></li>
|
||||||
|
<% else %>
|
||||||
|
<li><%= link_to "Permalink", forum_post_path(forum_post) %></li>
|
||||||
|
<% end %>
|
||||||
</menu>
|
</menu>
|
||||||
</div>
|
</div>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
|||||||
@@ -17,10 +17,10 @@
|
|||||||
|
|
||||||
<section id="content" class="<%= Danbooru.config.can_see_ads?(CurrentUser.user) ? "with-ads" : "without-ads" %>">
|
<section id="content" class="<%= Danbooru.config.can_see_ads?(CurrentUser.user) ? "with-ads" : "without-ads" %>">
|
||||||
<menu id="post-sections">
|
<menu id="post-sections">
|
||||||
<li class="active"><a href="#posts" id="show-posts-link">Posts</a></li>
|
<li class="active"><a href="#" id="show-posts-link">Posts</a></li>
|
||||||
|
|
||||||
<% if @post_set.has_wiki? %>
|
<% if @post_set.has_wiki? %>
|
||||||
<li><a href="#wiki-except" id="show-wiki-excerpt-link">Wiki</a></li>
|
<li><%= link_to "Wiki", wiki_page_path(@post_set.wiki_page), :id => "show-wiki-excerpt-link" %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</menu>
|
</menu>
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<li>Rating: <%= post.pretty_rating %></li>
|
<li>Rating: <%= post.pretty_rating %></li>
|
||||||
<li>Score: <span id="score-for-post-<%= post.id %>"><%= post.score %></span> <% if CurrentUser.is_gold? %>(vote <%= link_to "up", post_votes_path(:post_id => post.id, :score => "up"), :remote => true, :method => :post %>/<%= link_to "down", post_votes_path(:post_id => post.id, :score => "down"), :remote => true, :method => :post %>)<% end %></li>
|
<li>Score: <span id="score-for-post-<%= post.id %>"><%= post.score %></span> <% if CurrentUser.is_gold? %>(vote <%= link_to "up", post_votes_path(:post_id => post.id, :score => "up"), :remote => true, :method => :post %>/<%= link_to "down", post_votes_path(:post_id => post.id, :score => "down"), :remote => true, :method => :post %>)<% end %></li>
|
||||||
<li>Favorites: <span id="favcount-for-post-<%= post.id %>"><%= post.fav_count %></span>
|
<li>Favorites: <span id="favcount-for-post-<%= post.id %>"><%= post.fav_count %></span>
|
||||||
<% if CurrentUser.is_gold? && post.fav_count > 0 %>
|
<% if CurrentUser.is_gold? %>
|
||||||
<%= link_to "»".html_safe, "#", :id => "show-favlist-link" %>
|
<%= link_to "»".html_safe, "#", :id => "show-favlist-link" %>
|
||||||
<%= link_to "«".html_safe, "#", :id => "hide-favlist-link" %>
|
<%= link_to "«".html_safe, "#", :id => "hide-favlist-link" %>
|
||||||
<div id="favlist"><%= post_favlist(post) %></div>
|
<div id="favlist"><%= post_favlist(post) %></div>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
<li><%= link_to "Help", wiki_pages_path(:search => {:title => "help:tags"}) %></li>
|
<li><%= link_to "Help", wiki_pages_path(:search => {:title => "help:tags"}) %></li>
|
||||||
<% if @tag %>
|
<% if @tag %>
|
||||||
<li>|</li>
|
<li>|</li>
|
||||||
|
<li><%= link_to "Posts (#{Post.fast_count(@tag.name)})", posts_path(:tags => @tag.name) %></li>
|
||||||
<li><%= link_to "Edit", edit_tag_path(@tag) %></li>
|
<li><%= link_to "Edit", edit_tag_path(@tag) %></li>
|
||||||
<% if @tag.post_count < 1_000 %>
|
<% if @tag.post_count < 1_000 %>
|
||||||
<li><%= link_to "Fix", new_tag_correction_path(:tag_id => @tag.id) %></li>
|
<li><%= link_to "Fix", new_tag_correction_path(:tag_id => @tag.id) %></li>
|
||||||
|
|||||||
@@ -3,9 +3,18 @@
|
|||||||
<h1>Search User Feedbacks</h1>
|
<h1>Search User Feedbacks</h1>
|
||||||
|
|
||||||
<%= form_tag(user_feedbacks_path, :method => :get, :class => "simple_form") do %>
|
<%= form_tag(user_feedbacks_path, :method => :get, :class => "simple_form") do %>
|
||||||
<%= search_field "user_name", :label => "User" %>
|
<div class="input">
|
||||||
<%= search_field "creator_name", :label => "Creator" %>
|
<%= search_field "user_name", :label => "User" %>
|
||||||
<%= submit_tag "Search" %>
|
|
||||||
|
<%= search_field "creator_name", :label => "Creator" %>
|
||||||
|
|
||||||
|
<label for="search_category">Category</label>
|
||||||
|
<%= select "search", "category", %w(positive negative neutral), :include_blank => true %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="input">
|
||||||
|
<%= submit_tag "Search" %>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,3 +11,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= render "wiki_pages/secondary_links" %>
|
<%= render "wiki_pages/secondary_links" %>
|
||||||
|
|
||||||
|
<% content_for(:page_title) do %>
|
||||||
|
Wiki Page Versions Comparison - <%= @thispage.pretty_title %> - <%= Danbooru.config.app_name %>
|
||||||
|
<% end %>
|
||||||
|
|||||||
@@ -15,12 +15,7 @@
|
|||||||
|
|
||||||
<%= wiki_page_alias_and_implication_list(@wiki_page)%>
|
<%= wiki_page_alias_and_implication_list(@wiki_page)%>
|
||||||
|
|
||||||
<div id="wiki-page-posts">
|
<%= wiki_page_post_previews(@wiki_page) %>
|
||||||
<% if Post.fast_count(@wiki_page.title) > 0 %>
|
|
||||||
<h2>Posts</h2>
|
|
||||||
<% end %>
|
|
||||||
<%= @wiki_page.post_set.presenter.post_previews_html(self) %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
|
|
||||||
|
|||||||
@@ -12,18 +12,17 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
|
<% if params[:redirected_from].present? %>
|
||||||
|
<div class="hint redirected-from">Redirected from <%= link_to params[:redirected_from], show_or_new_wiki_pages_path(:title => params[:redirected_from], :no_redirect => true) %>.</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<div id="wiki-page-body" class="prose">
|
<div id="wiki-page-body" class="prose">
|
||||||
<%= format_text(@wiki_page.body) %>
|
<%= format_text(@wiki_page.body) %>
|
||||||
|
|
||||||
<%= wiki_page_alias_and_implication_list(@wiki_page) %>
|
<%= wiki_page_alias_and_implication_list(@wiki_page) %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="wiki-page-posts">
|
<%= wiki_page_post_previews(@wiki_page) %>
|
||||||
<% if Post.fast_count(@wiki_page.title) > 0 %>
|
|
||||||
<h2>Posts</h2>
|
|
||||||
<% end %>
|
|
||||||
<%= @wiki_page.post_set.presenter.post_previews_html(self) %>
|
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,15 +4,25 @@
|
|||||||
|
|
||||||
<section id="content">
|
<section id="content">
|
||||||
<h1 id="wiki-page-title"><%= params[:title] %></h1>
|
<h1 id="wiki-page-title"><%= params[:title] %></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>
|
<% if params[:redirected_from].present? %>
|
||||||
|
<div class="hint redirected-from">Redirected from <%= link_to params[:redirected_from], show_or_new_wiki_pages_path(:title => params[:redirected_from], :no_redirect => true) %>.</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<div class="ui-corner-all ui-state-highlight notice">
|
||||||
|
This wiki page does not yet exist. <%= link_to "Create a new wiki page", new_wiki_page_path(:wiki_page => {:title => params[:title]}) %>.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<%= wiki_page_alias_and_implication_list(@wiki_page)%>
|
||||||
|
|
||||||
|
<%= wiki_page_post_previews(@wiki_page) %>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<%= render "secondary_links" %>
|
||||||
|
|
||||||
<% content_for(:page_title) do %>
|
<% content_for(:page_title) do %>
|
||||||
Wiki - <%= params[:title] %> - <%= Danbooru.config.app_name %>
|
Wiki - <%= params[:title] %> - <%= Danbooru.config.app_name %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= render "secondary_links" %>
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
set :stages, %w(production staging)
|
set :stages, %w(production staging)
|
||||||
set :default_stage, "staging"
|
set :default_stage, "staging"
|
||||||
|
set :unicorn_env, "staging"
|
||||||
require 'capistrano/ext/multistage'
|
require 'capistrano/ext/multistage'
|
||||||
|
|
||||||
require 'bundler/capistrano'
|
require 'bundler/capistrano'
|
||||||
|
|||||||
@@ -239,7 +239,13 @@ Danbooru::Application.routes.draw do
|
|||||||
match "/comment/index" => redirect {|params, req| "/comments?page=#{req.params[:page]}"}
|
match "/comment/index" => redirect {|params, req| "/comments?page=#{req.params[:page]}"}
|
||||||
match "/comment/show/:id" => redirect("/comments/%{id}")
|
match "/comment/show/:id" => redirect("/comments/%{id}")
|
||||||
match "/comment/new" => redirect("/comments")
|
match "/comment/new" => redirect("/comments")
|
||||||
match "/comment/search" => redirect("/comments/search")
|
match("/comment/search" => redirect do |params, req|
|
||||||
|
if req.params[:query] =~ /^user:(.+)/i
|
||||||
|
"/comments?group_by=comment&search[creator_name]=#{CGI::escape($1)}"
|
||||||
|
else
|
||||||
|
"/comments/search"
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
match "/favorite" => redirect {|params, req| "/favorites?page=#{req.params[:page]}"}
|
match "/favorite" => redirect {|params, req| "/favorites?page=#{req.params[:page]}"}
|
||||||
match "/favorite/index" => redirect {|params, req| "/favorites?page=#{req.params[:page]}"}
|
match "/favorite/index" => redirect {|params, req| "/favorites?page=#{req.params[:page]}"}
|
||||||
@@ -283,7 +289,10 @@ Danbooru::Application.routes.draw do
|
|||||||
match "/post/view/:id" => redirect("/posts/%{id}")
|
match "/post/view/:id" => redirect("/posts/%{id}")
|
||||||
match "/post/flag/:id" => redirect("/posts/%{id}")
|
match "/post/flag/:id" => redirect("/posts/%{id}")
|
||||||
|
|
||||||
match "/post_tag_history" => redirect {|params, req| "/post_versions?page=#{req.params[:page]}"}
|
match("/post_tag_history" => redirect do |params, req|
|
||||||
|
page = req.params[:before_id].present? ? "b#{req.params[:before_id]}" : req.params[:page]
|
||||||
|
"/post_versions?page=#{page}&search[updater_id]=#{req.params[:user_id]}"
|
||||||
|
end)
|
||||||
match "/post_tag_history/index" => redirect {|params, req| "/post_versions?page=#{req.params[:page]}"}
|
match "/post_tag_history/index" => redirect {|params, req| "/post_versions?page=#{req.params[:page]}"}
|
||||||
|
|
||||||
match "/tag/index.xml", :controller => "legacy", :action => "tags", :format => "xml"
|
match "/tag/index.xml", :controller => "legacy", :action => "tags", :format => "xml"
|
||||||
|
|||||||
Reference in New Issue
Block a user