Merge branch 'master' of github.com:r888888888/danbooru

This commit is contained in:
r888888888
2017-09-23 13:15:05 -07:00
7 changed files with 35 additions and 41 deletions

View File

@@ -15,9 +15,9 @@ GIT
GIT GIT
remote: https://github.com/r888888888/dtext_rb.git remote: https://github.com/r888888888/dtext_rb.git
revision: d93eace454647413a617cf9969f760806f88cc2f revision: cde341011c0b7ceddcd0123c88bd67e1cdd9743c
specs: specs:
dtext_rb (1.5.1) dtext_rb (1.6.0)
nokogiri (~> 1.6) nokogiri (~> 1.6)
GIT GIT

View File

@@ -217,12 +217,6 @@
} }
Danbooru.Post.initialize_links = function() { Danbooru.Post.initialize_links = function() {
$("#side-edit-link").click(function(e) {
$("#post-edit-link").trigger("click");
$("#post_tag_string").trigger("focus");
e.preventDefault();
});
$("#copy-notes").click(function(e) { $("#copy-notes").click(function(e) {
var current_post_id = $("meta[name=post-id]").attr("content"); var current_post_id = $("meta[name=post-id]").attr("content");
var other_post_id = parseInt(prompt("Enter the ID of the post to copy all notes to:"), 10); var other_post_id = parseInt(prompt("Enter the ID of the post to copy all notes to:"), 10);

View File

@@ -229,6 +229,7 @@ div#c-posts {
.fav-buttons { .fav-buttons {
font-size: 14pt; font-size: 14pt;
text-align: center; text-align: center;
margin: 0.5em 0;
input[type=submit] { input[type=submit] {
padding: 0.2em 0.75em; padding: 0.2em 0.75em;

View File

@@ -55,8 +55,24 @@
} }
form { form {
input[type=text], input[type=submit], select { input[type=text] {
font-size: 1.5em; vertical-align: top;
font-size: 24pt;
border: 1px solid #c5c5c5;
}
textarea {
vertical-align: top;
border: 1px solid #c5c5c5;
}
input[type=submit] {
font-size: 160%;
}
input[type=submit].tiny {
font-size: 120%;
vertical-align: top;
} }
} }
@@ -70,17 +86,17 @@
} }
div.paginator { div.paginator {
font-size: 20pt; font-size: 24pt;
font-weight: bold; font-weight: bold;
text-align: left; text-align: center;
width: 100%; width: 100%;
padding: 0; padding: 0;
margin: 0; margin: 0;
margin-top: 1em; margin-top: 1em;
li { li {
width: 30vw;
display: inline-block; display: inline-block;
margin: 0 0.25em;
a, span { a, span {
margin: 0; margin: 0;
@@ -104,27 +120,24 @@
article.post-preview { article.post-preview {
margin: 0.5vw; margin: 0.5vw;
width: 32vw; width: 48.5vw;
height: 32vw; height: 48.5vw;
text-align: center; text-align: center;
vertical-align: middle; vertical-align: middle;
display: inline-block; display: inline-block;
a { a {
width: 32vw; width: 48.5vw;
display: block; display: block;
margin: 0 auto; margin: 0 auto;
} }
img { img {
object-fit: cover; object-fit: contain;
width: 32vw; width: 48.5vw;
height: 32vw; height: 48.5vw;
margin: 0 auto; margin: 0 auto;
border: none !important; border: none !important;
} }
img.cropped-true {
object-fit: cover;
}
&[data-tags~=animated]:before, &[data-file-ext=swf]:before, &[data-file-ext=webm]:before, &[data-file-ext=mp4]:before, &[data-file-ext=zip]:before { &[data-tags~=animated]:before, &[data-file-ext=swf]:before, &[data-file-ext=webm]:before, &[data-file-ext=mp4]:before, &[data-file-ext=zip]:before {
left: 0.5vw; left: 0.5vw;
@include animated-icon; @include animated-icon;

View File

@@ -57,6 +57,8 @@ class PostReplacement < ApplicationRecord
if md5_changed if md5_changed
post.comments.create!({creator: User.system, body: comment_replacement_message, do_not_bump_post: true}, without_protection: true) post.comments.create!({creator: User.system, body: comment_replacement_message, do_not_bump_post: true}, without_protection: true)
ModAction.log(modaction_replacement_message) ModAction.log(modaction_replacement_message)
else
post.queue_backup
end end
post.save! post.save!

View File

@@ -2,19 +2,17 @@
<li><%= link_to "Resize to window", "#", :id => "image-resize-to-window-link" %></li> <li><%= link_to "Resize to window", "#", :id => "image-resize-to-window-link" %></li>
<li><%= link_to "Favorite", favorites_path(:post_id => post.id), :remote => true, :method => :post, :id => "add-to-favorites", :title => "Shortcut is F" %></li> <li><%= link_to "Favorite", favorites_path(:post_id => post.id), :remote => true, :method => :post, :id => "add-to-favorites", :title => "Shortcut is F" %></li>
<li><%= link_to "Unfavorite", favorite_path(post), :remote => true, :method => :delete, :id => "remove-from-favorites" %></li> <li><%= link_to "Unfavorite", favorite_path(post), :remote => true, :method => :delete, :id => "remove-from-favorites" %></li>
<li><%= link_to "Edit", "#", :id => "side-edit-link" %></li>
<li><%= link_to_if post.visible?, "Download", post.file_url, :download => post.presenter.humanized_essential_tag_string + " - " + post.file_name %></li> <li><%= link_to_if post.visible?, "Download", post.file_url, :download => post.presenter.humanized_essential_tag_string + " - " + post.file_name %></li>
<li id="random-post-list"><%= link_to "Random post", random_posts_path(:tags => params[:tags]), :id => "random-post" %></li>
<li id="add-to-pool-list"><%= link_to "Add to pool", "#", :id => "pool" %></li> <li id="add-to-pool-list"><%= link_to "Add to pool", "#", :id => "pool" %></li>
<% if post.is_note_locked? %> <% if post.is_note_locked? %>
<li id="add-notes-list"><span id="note-locked-notice">Note locked</span></li> <li id="add-notes-list"><span id="note-locked-notice">Note locked</span></li>
<% else %> <% else %>
<li id="add-notes-list"><%= link_to "Add notes", "#", :id => "translate", :title => "Shortcut is N" %></li> <li id="add-notes-list"><%= link_to "Add note", "#", :id => "translate", :title => "Shortcut is N" %></li>
<% end %> <% end %>
<% if CurrentUser.is_builder? && post.has_notes? %> <% if CurrentUser.is_builder? && post.has_notes? %>
<li id="copy-all-notes-list"><%= link_to "Copy all notes", "#", :id => "copy-notes" %></li> <li id="copy-all-notes-list"><%= link_to "Copy notes", "#", :id => "copy-notes" %></li>
<% end %> <% end %>
<li id="add-artist-commentary-list"><%= link_to "Add artist commentary", "#", :id => "add-commentary" %></li> <li id="add-artist-commentary-list"><%= link_to "Add commentary", "#", :id => "add-commentary" %></li>
<li><%= link_to "Add to favorite group", "#", :id => "open-favgroup-dialog-link" %></li> <li><%= link_to "Add to favorite group", "#", :id => "open-favgroup-dialog-link" %></li>
<li><%= link_to "Find similar", iqdb_queries_path(:post_id => post.id), :method => :post, :remote => true %></li> <li><%= link_to "Find similar", iqdb_queries_path(:post_id => post.id), :method => :post, :remote => true %></li>

View File

@@ -32,20 +32,6 @@ end
new_new_spammers = Set.new(Dmail.where("from_id >= ? and title in (?) and from_id not in (?)", MIN_USER_ID, BAD_TITLES, (spammers + new_spammers).to_a).pluck(:from_id)) new_new_spammers = Set.new(Dmail.where("from_id >= ? and title in (?) and from_id not in (?)", MIN_USER_ID, BAD_TITLES, (spammers + new_spammers).to_a).pluck(:from_id))
combined_spammers = spammers + new_spammers + new_new_spammers combined_spammers = spammers + new_spammers + new_new_spammers
User.without_timeout do
combined_spammers.each do |uid|
user = User.find(uid)
tag_change_count = PostArchive.where(updater_id: uid).count
vote_count = PostVote.where(user_id: uid).count
comment_count = Comment.where(creator_id: uid).count
dmail_count = Dmail.where(from_id: uid).count
if tag_change_count + vote_count + comment_count > 0
puts "#{user.name},#{uid},#{tag_change_count},#{vote_count},#{comment_count},#{dmail_count}"
end
end
end
combined_spammers.each do |uid| combined_spammers.each do |uid|
unless Ban.where(user_id: uid).exists? unless Ban.where(user_id: uid).exists?
Ban.create!(duration: 10000, reason: "Spam (automated ref f6147ace)", user_id: uid) Ban.create!(duration: 10000, reason: "Spam (automated ref f6147ace)", user_id: uid)