Merge branch 'master' into attribute-searching

This commit is contained in:
evazion
2020-08-17 14:23:00 -05:00
committed by GitHub
155 changed files with 2834 additions and 2169 deletions

View File

@@ -12,7 +12,6 @@
</ul>
<div style="margin: 1em 0;">
<h2>Script</h2>
<div class="prose">
<%= format_text @bulk_update_request.processor.to_dtext %>
</div>

View File

@@ -17,12 +17,12 @@
<% end %>
data-is-voted="<%= comment.voted_by?(CurrentUser.user) %>">
<div class="author">
<h4>
<div class="author-name">
<%= link_to_user comment.creator %>
<% if comment.is_deleted? %>
(deleted)
<% end %>
</h4>
</div>
<%= link_to time_ago_in_words_tagged(comment.created_at), post_path(comment.post, anchor: "comment_#{comment.id}"), class: "message-timestamp" %>
</div>
<div class="content">

View File

@@ -4,8 +4,7 @@
<div id="c-dmails">
<div id="a-show">
<div class="dmail">
<h1>Show Message</h1>
<h2><%= @dmail.title %></h2>
<h1><%= @dmail.title %></h1>
<ul style="margin-bottom: 1em;">
<li><strong>Sender</strong>: <%= link_to_user @dmail.from %></li>
@@ -13,7 +12,6 @@
<li><strong>Date</strong>: <%= compact_time(@dmail.created_at) %></li>
</ul>
<h3>Body</h3>
<div class="prose">
<%= format_text(@dmail.body) %>

View File

@@ -1,14 +1,30 @@
<% page_title "Change Email" %>
<div id="c-emails">
<div id="a-edit">
<h1>Change Email</h1>
<div id="a-edit" class="fixed-width-container">
<% if @user.email_address.present? %>
<% page_title "Change Email" %>
<h1>Change Email</h1>
<p>You must confirm your password in order to change your email address.</p>
<p>Your current email address is <strong><%= @user.email_address.address %></strong>.
You must re-enter your password in order to update your email address.</p>
<% else %>
<% page_title "Add Email" %>
<h1>Add Email</h1>
<p>Add a new email address below. You must re-enter your password in
order to update your email address.</p>
<% end %>
<% if @user.is_restricted? %>
<p>Your account is restricted because you signed up from a proxy or VPN.
You can still use the site, but you won't be able to leave comments, edit
tags, or upload posts until you add a verified email address to your
account. Disposable or throwaway email addresses can't be used to verify
your account.</p>
<% end %>
<%= edit_form_for(@user, url: user_email_path(@user)) do |f| %>
<%= f.input :email, as: :email, label: "New Email", input_html: { value: "" } %>
<%= f.input :password %>
<%= f.input :email, as: :email, input_html: { value: "" } %>
<%= f.submit "Save" %>
<% end %>
</div>

View File

@@ -0,0 +1,20 @@
<% page_title "Verify account" %>
<div id="c-emails">
<div id="a-verify" class="fixed-width-container">
<h1>Verify account</h1>
<% if @user.is_restricted? %>
<p>Your account is restricted because you signed up from a VPN or proxy.
You can still use the site, but you won't be able to leave comments, edit
tags, or upload posts until you verify your account.</p>
<% end %>
<p>Click below to send an email to <strong><%= @email_address.address %></strong>
to verify your account.</p>
<%= edit_form_for(@user, method: :post, url: send_confirmation_user_email_path(@user)) do |f| %>
<%= f.submit "Send confirmation email" %>
<% end %>
</div>
</div>

View File

@@ -6,12 +6,12 @@
<% end %>
data-creator="<%= forum_post.creator.name %>">
<div class="author">
<h4>
<div class="author-name">
<%= link_to_user forum_post.creator %>
<% if forum_post.is_deleted? %>
(deleted)
<% end %>
</h4>
</div>
<%= link_to time_ago_in_words_tagged(forum_post.created_at), forum_post, class: "message-timestamp" %>
</div>
<div class="content">

View File

@@ -1,2 +1 @@
$("article[data-forum-post-id=<%= @forum_post.id %>] div.author h4").append(" (deleted)");
$("article[data-forum-post-id=<%= @forum_post.id %>] div.author div.author-name").append(" (deleted)");

View File

@@ -50,7 +50,7 @@
<%= render "news_updates/listing" %>
<header id="top">
<h1 id="app-name-header"><%= link_to Danbooru.config.app_name, "/" %></h1>
<%= link_to Danbooru.config.app_name, root_path, id: "app-name-header", class: "heading" %>
<div id="maintoggle" class="mobile-only">
<a href="#"><i id="maintoggle-on" class="fas fa-bars"></i></a>
@@ -68,6 +68,8 @@
</header>
<div id="page">
<%= render "users/verification_notice" %>
<% if !CurrentUser.is_anonymous? && !CurrentUser.is_gold? && cookies[:hide_upgrade_account_notice].blank? && params[:action] != "upgrade_information" %>
<%= render "users/upgrade_notice" %>
<% end %>
@@ -88,6 +90,11 @@
<%= yield :layout %>
</div>
<div id="tooltips">
<div id="post-tooltips"></div>
<div id="user-tooltips"></div>
</div>
<script type="application/javascript">
if (typeof window.Danbooru !== "object") {
window.Danbooru = {};

View File

@@ -1,25 +0,0 @@
<table class="striped">
<caption>Appeals</caption>
<thead>
<tr>
<th>Post</th>
<th>User</th>
<th>Flags</th>
<th>Appeals</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<% @dashboard.appeals.each do |post| %>
<tr>
<td><%= PostPresenter.preview(post, show_deleted: true) %></td>
<td><%= mod_link_to_user post.uploader, :negative %></td>
<td><%= render "post_flags/reasons", flags: post.flags %></td>
<td><%= render "post_appeals/reasons", appeals: post.appeals %></td>
<td><%= post.score %></td>
</tr>
<% end %>
</tbody>
</table>
<p><%= link_to "View all appeals", post_appeals_path %></p>

View File

@@ -11,14 +11,12 @@
<div id="column-left" class="column column-expand">
<div class="activity"><%= render "activity_upload" %></div>
<div class="activity"><%= render "activity_note" %></div>
<div class="activity"><%= render "activity_tag" %></div>
<div class="activity"><%= render "activity_wiki_page" %></div>
<div class="activity"><%= render "activity_artist" %></div>
<div class="activity"><%= render "activity_comment" %></div>
</div>
<div id="column-right" class="column column-expand">
<div class="activity"><%= render "activity_appeal" %></div>
<div class="activity"><%= render "activity_comment" %></div>
<div class="activity"><%= render "activity_user_feedback" %></div>
<div class="activity"><%= render "activity_mod_action" %></div>
</div>

View File

@@ -1,26 +0,0 @@
<h1>Delete Post</h1>
<div>
<%= PostPresenter.preview(@post, show_deleted: true) %>
</div>
<%= form_tag(delete_moderator_post_post_path, :style => "clear: both;", :class => "simple_form") do %>
<% if @post.parent_id %>
<div class="input">
<label for="move_favorites">
<%= check_box_tag "move_favorites" %>
Move favorites to parent?
</label>
</div>
<% end %>
<p style="font-weight: bold;">Note: If the reason you are planning to delete this post is because it is from a banned artist, please <%= link_to "ban", confirm_ban_moderator_post_post_path(@post) %> this post instead of deleting it.</p>
<div class="input">
<label for="reason">Reason</label>
<%= text_area_tag "reason" %>
</div>
<%= submit_tag "Delete" %>
<%= submit_tag "Cancel" %>
<% end %>

View File

@@ -1,6 +1,6 @@
<%= content_tag(:div, { id: "post-#{post.id}", class: ["post", "mod-queue-preview", "column-container", *PostPresenter.preview_class(post)].join(" ") }.merge(PostPresenter.data_attributes(post))) do %>
<aside class="column column-shrink">
<%= PostPresenter.preview(post, size: true) %>
<%= PostPresenter.preview(post, size: true, show_deleted: true) %>
</aside>
<section class="column column-expand">
@@ -64,14 +64,14 @@
<% if post.is_flagged? %>
<span class="info">
<strong>Flagged</strong>
<%= render "post_flags/reasons", flags: post.flags %>
<%= render "post_flags/reasons", flag: post.flags.select(&:pending?).last %>
</span>
<% end %>
<% if (post.is_flagged? || post.is_deleted?) && post.appeals.any? %>
<% if post.is_appealed? %>
<span class="info">
<strong>Appeals</strong>
<%= render "post_appeals/reasons", appeals: post.appeals %>
<%= render "post_appeals/reasons", appeal: post.appeals.select(&:pending?).last %>
</span>
<% end %>
</div>

View File

@@ -12,7 +12,7 @@
<%= render "posts/partials/index/blacklist" %>
<p id="modqueue-sidebar-status" class="sidebar-section">
<h6>Status</h6>
<h2>Status</h2>
<ul>
<li>
<%= link_to "status:pending", modqueue_index_path(search: { tags: "status:pending" }) %>
@@ -22,6 +22,10 @@
<%= link_to "status:flagged", modqueue_index_path(search: { tags: "status:flagged" }) %>
<span class="post-count"><%= @flagged_post_count %></span>
</li>
<li>
<%= link_to "status:appealed", modqueue_index_path(search: { tags: "status:appealed" }) %>
<span class="post-count"><%= @appealed_post_count %></span>
</li>
<% @disapproval_reasons.each do |reason, count| %>
<li>
@@ -33,7 +37,7 @@
</p>
<p id="modqueue-sidebar-uploaders" class="sidebar-section">
<h6>Uploaders</h6>
<h2>Uploaders</h2>
<ul>
<% @uploaders.each do |uploader, count| %>
<li>
@@ -46,7 +50,7 @@
</p>
<p id="modqueue-sidebar-tags" class="sidebar-section">
<h6>Tags</h6>
<h2>Tags</h2>
<%= render "tag_list", tags: @artist_tags %>
<%= render "tag_list", tags: @copyright_tags %>

View File

@@ -3,7 +3,6 @@
<%= edit_form_for(post_appeal, format: :js, remote: true) do |f| %>
<%= f.hidden_field :post_id %>
<%= f.input :reason, as: :dtext, inline: true %>
<%= dtext_preview_button "post_appeal_reason" %>
<%= f.input :reason, as: :dtext, inline: true, placeholder: "Optional" %>
<% end %>
</div>

View File

@@ -1,9 +1,11 @@
<ul class="post-appeal-reasons list-bulleted">
<% appeals.each do |appeal| %>
<li class="post-appeal-reason">
<ul class="post-appeal-reason list-bulleted">
<li>
<% if appeal.reason.present? %>
<span class="prose"><%= format_text(appeal.reason, inline: true) %></span>
- <%= link_to_user(appeal.creator) %>
- <%= time_ago_in_words_tagged(appeal.created_at) %>
</li>
<% end %>
<% else %>
<span class="prose"><em>no reason</em></span>
<% end %>
(<%= link_to_user(appeal.creator) %>, <%= time_ago_in_words_tagged(appeal.created_at) %>)
</li>
</ul>

View File

@@ -3,6 +3,6 @@
<%= f.input :post_tags_match, label: "Tags", input_html: { value: params[:search][:post_tags_match], data: { autocomplete: "tag-query" } } %>
<%= f.input :post_id, label: "Post ID", input_html: { value: params[:search][:post_id] } %>
<%= f.input :creator_name, label: "Creator", input_html: { value: params[:search][:creator_name], data: { autocomplete: "user" } } %>
<%= f.input :is_resolved, label: "Resolved?", collection: [["Yes", true], ["No", false]], include_blank: true, selected: params[:search][:is_resolved] %>
<%= f.input :status, collection: PostAppeal.statuses, include_blank: true, selected: params[:search][:status] %>
<%= f.submit "Search" %>
<% end %>

View File

@@ -16,8 +16,8 @@
<% t.column "Appeals", width: "1%" do |post_appeal| %>
<%= link_to post_appeal.post.appeals.size, post_appeals_path(search: { post_id: post_appeal.post_id }) %>
<% end %>
<% t.column "Resolved?", width: "5%" do |post_appeal| %>
<%= link_to post_appeal.is_resolved.to_s, post_appeals_path(search: params[:search].merge(is_resolved: post_appeal.is_resolved)) %>
<% t.column "Status", width: "5%" do |post_appeal| %>
<%= link_to post_appeal.status, post_appeals_path(search: { status: post_appeal.status }) %>
<% end %>
<% t.column "Uploaded", width: "15%" do |post_appeal| %>
<%= compact_time post_appeal.post.created_at %>

View File

@@ -1,4 +1,4 @@
<% if (CurrentUser.can_approve_posts? || post.created_at < 3.days.ago) && disapprovals.length > 0 %>
<% if (CurrentUser.can_approve_posts? || post.created_at < Danbooru.config.moderation_period.ago) && disapprovals.length > 0 %>
<% if disapprovals.map(&:reason).grep("breaks_rules").count > 0 %>
(breaks rules: <%= disapprovals.map(&:reason).grep("breaks_rules").count %>)
<% end %>

View File

@@ -1,4 +1,4 @@
<% if (CurrentUser.can_approve_posts? || post.created_at < 3.days.ago) && disapprovals.length > 0 %>
<% if (CurrentUser.can_approve_posts? || post.created_at < Danbooru.config.moderation_period.ago) && disapprovals.length > 0 %>
<p>
It has been reviewed by <%= pluralize disapprovals.length, "approver" %>.

View File

@@ -4,6 +4,14 @@
<%= table_for @events, class: "striped autofit", width: "100%" do |t| %>
<% t.column :type_name, name: "Type" %>
<% t.column "Description", td: { class: "col-expand" } do |event| %>
<div class="prose">
<%= format_text event.reason %>
</div>
<% end %>
<% t.column "Status" do |event| %>
<%= event.status %>
<% end %>
<% t.column "User" do |event| %>
<% if event.is_creator_visible? %>
<%= link_to_user event.creator %>
@@ -12,12 +20,6 @@
<% end %>
<br><%= time_ago_in_words_tagged event.created_at %>
<% end %>
<% t.column "Description", td: { class: "col-expand" } do |event| %>
<div class="prose">
<%= format_text event.reason %>
</div>
<% end %>
<% t.column :is_resolved, name: "Resolved" %>
<% end %>
</div>
</div>

View File

@@ -1,17 +1,11 @@
<ul class="post-flag-reasons list-bulleted">
<% flags.each do |flag| %>
<li class="post-flag-reason">
<span class="prose"><%= format_text(flag.reason, inline: true) %></span>
<ul class="post-flag-reason list-bulleted">
<li>
<span class="prose"><%= format_text(flag.reason, inline: true) %></span>
<% if policy(flag).can_view_flagger? %>
- <%= link_to_user(flag.creator) %>
<% end %>
- <%= time_ago_in_words_tagged(flag.created_at) %>
<% if flag.is_resolved? %>
<span class="resolved">RESOLVED</span>
<% end %>
</li>
<% end %>
<% if policy(flag).can_view_flagger? %>
(<%= link_to_user(flag.creator) %>, <%= time_ago_in_words_tagged(flag.created_at) %>)
<% else %>
(<%= time_ago_in_words_tagged(flag.created_at) %>)
<% end %>
</li>
</ul>

View File

@@ -5,7 +5,7 @@
<% if policy(PostFlag).can_search_flagger? %>
<%= f.input :creator_name, label: "Creator", input_html: { value: params[:search][:creator_name], data: { autocomplete: "user" } } %>
<% end %>
<%= f.input :is_resolved, label: "Resolved?", collection: [["Yes", true], ["No", false]], include_blank: true, selected: params[:search][:is_resolved] %>
<%= f.input :category, label: "Category", collection: ["normal", "unapproved", "rejected", "deleted"], include_blank: true, selected: params[:search][:category] %>
<%= f.input :status, collection: PostFlag.statuses, include_blank: true, selected: params[:search][:status] %>
<%= f.submit "Search" %>
<% end %>

View File

@@ -19,8 +19,8 @@
<% t.column "Category", width: "1%" do |post_flag| %>
<%= link_to post_flag.category.to_s, post_flags_path(search: params[:search].merge(category: post_flag.category)) %>
<% end %>
<% t.column "Resolved?", width: "1%" do |post_flag| %>
<%= link_to post_flag.is_resolved?.to_s, post_flags_path(search: params[:search].merge(is_resolved: post_flag.is_resolved?)) %>
<% t.column "Status", width: "5%" do |post_flag| %>
<%= link_to post_flag.status, post_flags_path(search: { status: post_flag.status }) %>
<% end %>
<% t.column "Uploaded", width: "15%" do |post_flag| %>
<%= compact_time post_flag.post.created_at %>

View File

@@ -13,7 +13,8 @@
<%= f.input :updater_name, label: "Updater", input_html: { "data-autocomplete": "user", value: params.dig(:search, :updater_name) } %>
<%= f.input :added_tags_include_all, label: "Added Tags", input_html: { "data-autocomplete": "tag-query", value: params.dig(:search, :added_tags_include_all) } %>
<%= f.input :removed_tags_include_all, label: "Removed Tags", input_html: { "data-autocomplete": "tag-query", value: params.dig(:search, :removed_tags_include_all) } %>
<%= f.input :changed_tags, label: "Changed Tags", input_html: { "data-autocomplete": "tag-query", value: params.dig(:search, :changed_tags) } %>
<%= f.input :all_changed_tags, label: "All Changed Tags", input_html: { "data-autocomplete": "tag-query", value: params.dig(:search, :all_changed_tags) }, hint: "All tags must appear in either tag adds or removes" %>
<%= f.input :any_changed_tags, label: "Any Changed Tags", input_html: { "data-autocomplete": "tag-query", value: params.dig(:search, :any_changed_tags) }, hint: "Any tag must appear in either tag adds or removes" %>
<%= f.submit "Search" %>
<%= link_to "Advanced", search_post_versions_path(params.except(:controller, :action, :index, :commit, :type).permit!), class: "advanced-search-link" %>
<% end %>

View File

@@ -7,7 +7,7 @@
<%= f.input :updater_name, label: "Updater", input_html: { value: params.dig(:search, :updater_name), "data-autocomplete": "user" } %>
<%= f.input :added_tags_include_all, label: "Added tags", input_html: { value: params.dig(:search, :added_tags_include_all), "data-autocomplete": "tag-query" } %>
<%= f.input :removed_tags_include_all, label: "Removed tags", input_html: { value: params.dig(:search, :removed_tags_include_all), "data-autocomplete": "tag-query" } %>
<%= f.input :changed_tags, label: "Changed tags", input_html: { value: params.dig(:search, :changed_tags), "data-autocomplete": "tag-query" } %>
<%= f.input :changed_tags, label: "Changed Tags", input_html: { "data-autocomplete": "tag-query", value: params.dig(:search, :changed_tags) }, hint: "Added or removed tags" %>
<%= f.input :post_id, input_html: { value: params.dig(:search, :post_id) } %>
<%= f.input :parent_id, input_html: { value: params.dig(:search, :parent_id) } %>
<%= f.input :rating, input_html: { value: params.dig(:search, :rating) } %>

View File

@@ -0,0 +1,5 @@
<% if params[:commit] == "Delete" %>
location.reload();
<% else %>
Danbooru.Utility.dialog("Delete Post", "<%= j render "posts/partials/show/delete_dialog", post: @post %>");
<% end %>

View File

@@ -6,7 +6,7 @@
<%= render "posts/partials/index/blacklist" %>
<section id="tag-box">
<h1>Tags</h1>
<h2>Tags</h2>
<%= @post_set.tag_list_html(current_query: params[:tags], show_extra_links: policy(Post).show_extra_links?) %>
</section>

View File

@@ -1,7 +1,7 @@
<%# path, tags %>
<section id="search-box">
<h1>Search</h1>
<h2>Search</h2>
<%= form_tag(path, method: "get", id: "search-box-form") do %>
<% if params[:random] %>
<%= hidden_field_tag :random, params[:random] %>

View File

@@ -1,5 +1,5 @@
<div id="blacklist-box" class="sidebar-blacklist">
<h1>Blacklisted (<%= link_to_wiki "help", "help:blacklists" %>)</h1>
<h2>Blacklisted (<%= link_to_wiki "help", "help:blacklists" %>)</h2>
<ul id="blacklist-list" class="list-bulleted"></ul>
<%= link_to "Disable all", "#", :id => "disable-all-blacklists", :style => "display: none;" %>
<%= link_to "Re-enable all", "#", :id => "re-enable-all-blacklists", :style => "display: none;" %>

View File

@@ -1,5 +1,5 @@
<div id="quick-edit-div" style="display: none;">
<h1>Edit</h1>
<h2>Edit</h2>
<%= edit_form_for(:post, html: { id: "quick-edit-form" }) do |f| %>
<%= f.input :tag_string, label: "Tags", as: :text, input_html: { "data-autocomplete": "tag-edit" } %>

View File

@@ -40,13 +40,13 @@
<% end %>
<% elsif post_set.pool.present? %>
<% post_set.pool.tap do |pool| %>
<h4>
<h2>
<%= pool.pretty_category %>:
<%= link_to pool.pretty_name, pool_path(pool), :class => "pool-category-#{pool.category}" %>
<% if pool.is_deleted? %>
<span class="inactive">(deleted)</span>
<% end %>
</h4>
</h2>
<div id="description" class="prose">
<%= format_text(post_set.pool.description) %>
@@ -57,10 +57,10 @@
</p>
<% end %>
<% elsif post_set.favgroup.present? %>
<h4>
<h2>
Favorite Group:
<%= link_to post_set.favgroup.pretty_name, favorite_group_path(post_set.favgroup) %>
</h4>
</h2>
Creator: <%= link_to_user post_set.favgroup.creator %>
<% elsif post_set.has_blank_wiki? %>
<p>There is currently no wiki page for the tag <%= link_to_wiki post_set.tag.pretty_name %>. You can <%= link_to "create one", new_wiki_page_path(wiki_page: { title: post_set.tag.name }), rel: "nofollow" %>.</p>

View File

@@ -1,6 +1,6 @@
<% if policy(Post).can_use_mode_menu? %>
<section id="mode-box">
<h1>Mode</h1>
<h2>Mode</h2>
<form action="/">
<select name="mode">
<option value="view">View</option>

View File

@@ -1,5 +1,5 @@
<section id="options-box">
<h1>Options</h1>
<h2>Options</h2>
<ul>
<% if policy(SavedSearch).create? %>
<li><%= button_tag(tag.i(class: "fas fa-bookmark") + " Save search", id: "save-search", class: "ui-button ui-widget ui-corner-all sub") %></li>

View File

@@ -1,5 +1,5 @@
<section id="related-box">
<h1>Related</h1>
<h2>Related</h2>
<ul id="related-list">
<% if discover_mode? %>
<li id="secondary-links-posts-hot"><%= link_to "Hot", posts_path(:tags => "order:rank") %></li>

View File

@@ -0,0 +1,9 @@
<div class="delete-post-dialog-body">
<%= edit_form_for(post, method: :delete, remote: true) do |f| %>
<input type="hidden" name="commit" value="Delete">
<%= f.input :reason, as: :dtext, inline: true, input_html: { value: "" } %>
<% if post.parent_id.present? %>
<%= f.input :move_favorites, label: "Move favorites to parent", as: :boolean, input_html: { checked: false } %>
<% end %>
<% end %>
</div>

View File

@@ -21,13 +21,13 @@
<%= f.input :rating, collection: [["Explicit", "e"], ["Questionable", "q"], ["Safe", "s"]], as: :radio_buttons, boolean_style: :inline %>
<% end %>
<fieldset class="inline-fieldset">
<fieldset class="inline-fieldset post_has_embedded_notes_fieldset">
<label>Notes</label>
<%= f.input :has_embedded_notes, label: "Embed notes", as: :boolean, boolean_style: :inline, disabled: post.is_note_locked? %>
</fieldset>
<% if policy(post).can_lock_rating? || policy(post).can_lock_notes? || policy(post).can_lock_status? %>
<fieldset class="inline-fieldset">
<fieldset class="inline-fieldset post_lock_fieldset">
<label>Lock</label>
<% if policy(post).can_lock_rating? %>
@@ -49,11 +49,8 @@
<div class="header">
<%= f.label :tag_string, "Tags" %>
<span class="options">
<i id="face" class="fas"></i>
<span class="count"></span>
<a href="javascript:void(0)"><i id="open-edit-dialog" class="fas fa-arrows-alt" title="detach" data-shortcut="shift+e"></i></a>
</span>
<span data-tag-counter data-for="#post_tag_string"></span>
<a href="javascript:void(0)"><i id="open-edit-dialog" class="fas fa-external-link-alt" title="detach" data-shortcut="shift+e"></i></a>
</div>
<div>

View File

@@ -1,3 +1,6 @@
<% if policy(post).visible? %>
<%= image_tag(post.file_url_for(CurrentUser.user), width: post.image_width_for(CurrentUser.user), height: post.image_height_for(CurrentUser.user), id: "image", class: "fit-width", "data-original-width": post.image_width, "data-original-height": post.image_height, "data-large-width": post.large_image_width, "data-large-height": post.large_image_height, "data-tags": post.tag_string, alt: post.presenter.humanized_essential_tag_string, "data-uploader": post.uploader.name, "data-rating": post.rating, "data-flags": post.status_flags, "data-parent-id": post.parent_id, "data-has-children": post.has_children?, "data-has-active-children": post.has_active_children?, "data-score": post.score, "data-fav-count": post.fav_count) %>
<%= content_tag(:picture) do -%>
<%= tag.source media: "(max-width: 660px)", srcset: post.tagged_large_file_url -%>
<%= tag.img width: post.image_width_for(CurrentUser.user), height: post.image_height_for(CurrentUser.user), id: "image", class: "fit-width", alt: post.presenter.humanized_essential_tag_string, src: post.file_url_for(CurrentUser.user) %>
<% end -%>
<% end %>

View File

@@ -43,22 +43,18 @@
Status:
<% if post.is_pending? %>
Pending
<% end %>
<% if post.is_deleted? %>
Deleted
<% end %>
<% if post.is_flagged? %>
<% elsif post.is_flagged? %>
Flagged
<% elsif post.is_appealed? %>
Appealed
<% elsif post.is_deleted? %>
Deleted
<% else %>
Active
<% end %>
<% if post.is_banned? %>
Banned
<% end %>
<% if !post.is_pending? && !post.is_deleted? && !post.is_banned? %>
Active
<% end %>
</li>
</ul>

View File

@@ -1,22 +1,33 @@
<% if post.is_flagged? && !post.is_deleted? && post.flags.any? %>
<div class="notice notice-small post-notice post-notice-flagged">
<p>This post was flagged for review (<%= link_to_wiki "learn more", "howto:flag" %>): </p>
<%= render "post_flags/reasons", flags: post.flags %>
</div>
<% end %>
<% if post.is_banned? %>
<div class="notice notice-small post-notice post-notice-banned">
The artist requested removal of this page
</div>
<% end %>
<% if post.is_deleted? %>
<% if post.in_modqueue? %>
<div class="notice notice-small post-notice post-notice-pending">
<% if post.is_pending? %>
This post is pending approval. (<%= link_to_wiki "learn more", "about:mod_queue" %>)
<% elsif post.is_flagged? %>
This post was flagged and is pending approval (<%= link_to_wiki "learn more", "howto:flag" %>)
<%= render "post_flags/reasons", flag: post.flags.select(&:pending?).last %>
<% elsif post.is_appealed? %>
This post was appealed and is pending approval (<%= link_to_wiki "learn more", "about:mod_queue" %>)
<%= render "post_appeals/reasons", appeal: post.appeals.select(&:pending?).last %>
<% end %>
<%= render "post_disapprovals/counts", :disapprovals => post.disapprovals, :post => post %>
<% if policy(PostDisapproval).create? && !post.disapproved_by?(CurrentUser.user) %>
<%= render "modqueue/quick_mod", post: post %>
<%= render "post_disapprovals/detailed_rejection_dialog" %>
<% end %>
</div>
<% elsif post.is_deleted? %>
<div class="notice notice-small post-notice post-notice-deleted">
<% if post.flags.any? %>
<p>This post was deleted for the following reasons: </p>
<%= render "post_flags/reasons", flags: post.flags %>
<% if post.flags.succeeded.last.present? %>
<p>This post was deleted for the following reason: </p>
<%= render "post_flags/reasons", flag: post.flags.succeeded.last %>
<% else %>
<p>This post was deleted</p>
<% end %>
@@ -30,31 +41,6 @@
</div>
<% end %>
<% if post.is_pending? || post.is_flagged? %>
<div class="notice notice-small post-notice post-notice-pending">
<% if post.is_pending? %>
This post is pending approval.
(<%= link_to_wiki "learn more", "about:mod_queue" %>)
<% else %>
This post was flagged and is pending approval (<%= link_to_wiki "learn more", "about:mod_queue" %>)
<% end %>
<%= render "post_disapprovals/counts", :disapprovals => post.disapprovals, :post => post %>
<% if policy(PostDisapproval).create? && !post.disapproved_by?(CurrentUser.user) %>
<%= render "modqueue/quick_mod", post: post %>
<%= render "post_disapprovals/detailed_rejection_dialog" %>
<% end %>
</div>
<% end %>
<% if (post.is_flagged? || post.is_deleted?) && post.appeals.any? %>
<div class="notice notice-small post-notice post-notice-appealed">
<p>This post was appealed:</p>
<%= render "post_appeals/reasons", appeals: post.appeals %>
</div>
<% end %>
<% if post.parent.present? %>
<div class="notice notice-small post-notice post-notice-child">
<%= render "posts/partials/show/parent_notice", parent: post.parent, children: @sibling_posts.to_a %>
@@ -67,7 +53,7 @@
</div>
<% end %>
<% if policy(post).visible? && post.has_large? && !post.is_ugoira? %>
<% if policy(post).visible? && post.has_large? && !post.is_ugoira? && post.resize_percentage.floor < 100 %>
<div class="notice notice-small post-notice post-notice-resized" id="image-resize-notice">
Resized to <%= number_to_percentage post.resize_percentage.floor, precision: 0 %> of original (<%= link_to "view original", post.tagged_file_url, class: "image-view-original-link" %>)
</div>

View File

@@ -51,25 +51,24 @@
<% if post.is_status_locked? %>
<li id="post-option-status-locked">Status locked</li>
<% else %>
<% if (!post.is_deleted? && !post.is_pending? && !post.is_flagged?) && policy(PostFlag).create? %>
<% if post.is_active? && policy(PostFlag).create? %>
<li id="post-option-flag"><%= link_to "Flag", new_post_flag_path(post_flag: { post_id: post.id }), remote: true %></li>
<% elsif (post.is_flagged? || post.is_deleted?) && policy(PostAppeal).create? %>
<% elsif post.is_appealable? && policy(PostAppeal).create? %>
<li id="post-option-appeal"><%= link_to "Appeal", new_post_appeal_path(post_appeal: { post_id: post.id }), remote: true %></li>
<% end %>
<% if policy(PostApproval).create? %>
<% if post.is_deleted? %>
<li id="post-option-undelete"><%= link_to "Undelete", post_approvals_path(post_id: post.id), remote: true, method: :post, "data-confirm": "Are you sure you want to undelete this post?" %></li>
<% if policy(post).move_favorites? %>
<li id="post-option-move-favorites"><%= link_to "Move favorites", confirm_move_favorites_moderator_post_post_path(post_id: post.id) %></li>
<% end %>
<% elsif policy(post).delete? %>
<li id="post-option-delete"><%= link_to "Delete", confirm_delete_moderator_post_post_path(post_id: post.id) %></li>
<% if post.is_approvable? %>
<li id="post-option-approve"><%= link_to (post.is_deleted? ? "Undelete" : "Approve"), post_approvals_path(post_id: post.id), remote: true, method: :post, "data-shortcut": "shift+o", "data-confirm": "Are you sure you want to approve this post?" %></li>
<li id="post-option-disapprove"><%= link_to "Hide from queue", post_disapprovals_path(post_disapproval: { post_id: post.id, reason: "disinterest" }), remote: true, method: :post %></li>
<% end %>
<% if post.is_approvable? && !post.is_deleted? %>
<li id="post-option-approve"><%= link_to "Approve", post_approvals_path(post_id: post.id), remote: true, method: :post, id: "approve", "data-shortcut": "shift+o", "data-confirm": "Are you sure you want to approve this post?" %></li>
<li id="post-option-disapprove"><%= link_to "Hide from queue", post_disapprovals_path(post_disapproval: { post_id: post.id, reason: "disinterest" }), remote: true, method: :post, id: "disapprove" %></li>
<% if post.is_deleted? && policy(post).move_favorites? %>
<li id="post-option-move-favorites"><%= link_to "Move favorites", confirm_move_favorites_moderator_post_post_path(post_id: post.id) %></li>
<% end %>
<% if !post.is_deleted? && policy(post).delete? %>
<li id="post-option-delete"><%= link_to "Delete", post, method: :delete, remote: true %></li>
<% end %>
<% if policy(post).unban? %>

View File

@@ -5,19 +5,6 @@
:class => "fit-width",
:width => post.image_width,
:height => post.image_height,
"data-original-width" => post.image_width,
"data-original-height" => post.image_height,
"data-large-width" => post.image_width,
"data-large-height" => post.image_height,
"data-tags" => post.tag_string,
"data-uploader" => post.uploader.name,
"data-rating" => post.rating,
"data-flags" => post.status_flags,
"data-parent-id" => post.parent_id,
"data-has-children" => post.has_children?,
"data-has-active-children" => post.has_active_children?,
"data-score" => post.score,
"data-fav-count" => post.fav_count,
"data-ugoira-frames" => post.pixiv_ugoira_frame_data.data.to_json,
"data-ugoira-content-type" => post.pixiv_ugoira_frame_data.content_type.to_json,
) %>

View File

@@ -15,17 +15,17 @@
</section>
<section id="post-information">
<h1>Information</h1>
<h2>Information</h2>
<%= render "posts/partials/show/information", :post => @post %>
</section>
<section id="post-options">
<h1>Options</h1>
<h2>Options</h2>
<%= render "posts/partials/show/options", :post => @post %>
</section>
<section id="post-history">
<h1>History</h1>
<h2>History</h2>
<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>
@@ -61,7 +61,7 @@
<% end %>
<% end %>
<section id="mark-as-translated-section" style="display: none;">
<section id="mark-as-translated-section">
<%= edit_form_for(@post, url: mark_as_translated_post_path(@post), method: :put) do |f| %>
<%= f.input :tags_query, as: :hidden, input_html: { id: nil, name: "tags_query", value: params[:q] } %>
<%= f.input :pool_id, as: :hidden, input_html: { id: nil, name: "pool_id", value: params[:pool_id] } %>

View File

@@ -3,7 +3,7 @@
<%= render "related_tags/tag_column", tags: source.translated_tags.map(&:name), title: "Translated Tags" %>
<div class="tag-column wide-column artist-related-tags-column">
<h6>Artist</h6>
<h3>Artist</h3>
<% if source.artists.size == 0 %>
none

View File

@@ -2,7 +2,7 @@
<%= content_tag(:div, class: ["tag-column", local_assigns[:class] || "#{title.parameterize}-related-tags-column", "is-empty-#{tags.empty?}"].join(" ")) do %>
<% if tags.present? %>
<h6><%= title %></h6>
<h3><%= title %></h3>
<%= TagSetPresenter.new(tags).tag_list_html(name_only: true) %>
<% end %>
<% end %>

View File

@@ -4,6 +4,6 @@
<p><%= @message %></p>
<% unless @expected %>
<h6>Details</h6>
<h3>Details</h3>
<%= render "static/backtrace", exception: @exception, backtrace: @backtrace %>
<% end %>

View File

@@ -6,7 +6,7 @@
<p>Your search took too long to execute and was cancelled.</p>
<h6>Why did this happen?</h6>
<h3>Why did this happen?</h3>
<p>
Some kinds of searches are slower than others. If your search is too slow
@@ -15,7 +15,7 @@
</p>
<% if params[:controller] == "posts" && params[:action] == "index" && params[:tags].present? %>
<h6>What can I do?</h6>
<h3>What can I do?</h3>
<p>Try changing your search:</p>
@@ -38,7 +38,7 @@
<% end %>
<% if !CurrentUser.is_gold? %>
<h6>Search limits</h6>
<h3>Search limits</h3>
<p>
Members are limited to searches that take up to 3 seconds long. You can

View File

@@ -4,7 +4,7 @@
<div id="a-site-map" class="fixed-width-container">
<section>
<ul>
<li><h1>Posts</h1></li>
<li><h2>Posts</h2></li>
<li><%= link_to_wiki "Help", "help:posts" %></li>
<li><%= link_to("Listing", posts_path) %></li>
<li><%= link_to("Upload", new_upload_path) %></li>
@@ -18,7 +18,7 @@
<% end %>
</ul>
<ul>
<li><h1>Post Events</h1></li>
<li><h2>Post Events</h2></li>
<li><%= link_to("Changes", post_versions_path) %></li>
<li><%= link_to("Approvals", post_approvals_path) %></li>
<li><%= link_to("Disapprovals", post_disapprovals_path) %></li>
@@ -27,7 +27,7 @@
<li><%= link_to("Replacements", post_replacements_path) %></li>
</ul>
<ul>
<li><h1>Tools</h1></li>
<li><h2>Tools</h2></li>
<li><%= link_to("Source Code", Danbooru.config.source_code_url) %></li>
<li><%= link_to("Bug Reports", Danbooru.config.issues_url) %></li>
<li><%= link_to("Keyboard Shortcuts", keyboard_shortcuts_path) %></li>
@@ -37,7 +37,7 @@
<li><%= link_to("Similar Images Search", iqdb_queries_path) %></li>
</ul>
<ul>
<li><h1>Artists</h1></li>
<li><h2>Artists</h2></li>
<li><%= link_to_wiki "Help", "help:artists" %></li>
<li><%= link_to("Listing", artists_path) %></li>
<li><%= link_to("Banned", banned_artists_path) %></li>
@@ -46,7 +46,7 @@
</section>
<section>
<ul>
<li><h1>Tags</h1></li>
<li><h2>Tags</h2></li>
<li><%= link_to_wiki "Help", "help:tags" %></li>
<li><%= link_to_wiki "Cheat sheet", "help:cheatsheet" %></li>
<li><%= link_to("Aliases", tag_aliases_path) %></li>
@@ -54,14 +54,14 @@
<li><%= link_to("Listing", tags_path) %></li>
</ul>
<ul>
<li><h1>Notes</h1></li>
<li><h2>Notes</h2></li>
<li><%= link_to_wiki "Help", "help:notes" %></li>
<li><%= link_to("Listing", notes_path) %></li>
<li><%= link_to("Search", search_notes_path) %></li>
<li><%= link_to("Changes", note_versions_path) %></li>
</ul>
<ul>
<li><h1>Pools</h1></li>
<li><h2>Pools</h2></li>
<li><%= link_to_wiki "Help", "help:pools" %></li>
<li><%= link_to("Listing", pools_path) %></li>
<li><%= link_to("Gallery", gallery_pools_path) %></li>
@@ -70,7 +70,7 @@
<% end %>
</ul>
<ul>
<li><h1>Reports</h1></li>
<li><h2>Reports</h2></li>
<li><%= link_to("Performance Reports", "https://isshiki.donmai.us/user-reports") %></li>
<li><%= link_to("Top Searches", searches_explore_posts_path) %></li>
<li><%= link_to("Missed Searches", missed_searches_explore_posts_path) %></li>
@@ -78,7 +78,7 @@
</section>
<section>
<ul>
<li><h1>Comments</h1></li>
<li><h2>Comments</h2></li>
<li><%= link_to_wiki "Help", "help:comments" %></li>
<li><%= link_to("Listing", comments_path) %></li>
<li><%= link_to("Search", search_comments_path) %></li>
@@ -86,7 +86,7 @@
<li><%= link_to("RSS", comments_path(:atom)) %></li>
</ul>
<ul>
<li><h1>Forum</h1></li>
<li><h2>Forum</h2></li>
<li><%= link_to_wiki "Help", "help:forum" %></li>
<li><%= link_to("Listing", forum_topics_path) %></li>
<li><%= link_to("Search", search_forum_posts_path) %></li>
@@ -94,14 +94,14 @@
<li><%= link_to("RSS", forum_topics_path(:atom)) %></li>
</ul>
<ul>
<li><h1>Wiki</h1></li>
<li><h2>Wiki</h2></li>
<li><%= link_to_wiki "Help", "help:wiki" %></li>
<li><%= link_to("Listing", wiki_pages_path) %></li>
<li><%= link_to("Search", search_wiki_pages_path) %></li>
<li><%= link_to("Changes", wiki_page_versions_path) %></li>
</ul>
<ul>
<li><h1>Artist commentary</h1></li>
<li><h2>Artist commentary</h2></li>
<li><%= link_to_wiki "Help", "help:artist_commentary" %></li>
<li><%= link_to("Listing", artist_commentaries_path) %></li>
<li><%= link_to("Search", search_artist_commentaries_path) %></li>
@@ -110,7 +110,7 @@
</section>
<section>
<ul>
<li><h1>Profile</h1></li>
<li><h2>Profile</h2></li>
<% if CurrentUser.is_anonymous? %>
<li><%= link_to "Login", login_path %></li>
<li><%= link_to "Sign up", new_user_path %></li>
@@ -128,7 +128,7 @@
<li><%= link_to "Upgrade information", new_user_upgrade_path %></li>
</ul>
<ul>
<li><h1>Users</h1></li>
<li><h2>Users</h2></li>
<% if CurrentUser.is_moderator? %>
<li><%= link_to("Dashboard", moderator_dashboard_path) %></li>
<% end %>
@@ -141,7 +141,7 @@
<li><%= link_to("Privacy Policy", privacy_policy_path) %></li>
</ul>
<ul>
<li><h1>Admin</h1></li>
<li><h2>Admin</h2></li>
<li><%= link_to("Mod Actions", mod_actions_path) %></li>
<li><%= link_to("Jobs", delayed_jobs_path) %></li>
<li><%= link_to("Bulk Update Requests", bulk_update_requests_path) %></li>

View File

@@ -65,11 +65,8 @@
<div class="header">
<%= f.label :tag_string, "Tags" %>
<span class="options">
<i id="face" class="fas"></i>
<span class="count"></span>
<a href="javascript:void(0)"><i id="open-edit-dialog" class="fas fa-arrows-alt" title="detach" data-shortcut="shift+e"></i></a>
</span>
<span data-tag-counter data-for="#upload_tag_string"></span>
<a href="javascript:void(0)"><i id="open-edit-dialog" class="fas fa-external-link-alt" title="detach" data-shortcut="shift+e"></i></a>
</div>
<%= f.input :tag_string, label: false, input_html: { size: "60x5", "data-autocomplete": "tag-edit", "data-shortcut": "e", spellcheck: false, value: params[:tag_string] } %>

View File

@@ -174,12 +174,12 @@
<td><%= presenter.comment_count(self) %> in <%= presenter.commented_posts_count(self) %> posts</td>
</tr>
<% if CurrentUser.user.id == user.id || CurrentUser.is_moderator? %>
<tr>
<th>Appeals</th>
<td><%= presenter.appeal_count(self) %></td>
</tr>
<tr>
<th>Appeals</th>
<td><%= presenter.appeal_count(self) %></td>
</tr>
<% if CurrentUser.user.id == user.id || CurrentUser.is_moderator? %>
<tr>
<th>Flags</th>
<td><%= presenter.flag_count(self) %></td>

View File

@@ -4,7 +4,11 @@
none
<% else %>
<%= link_to user.upload_limit.used_upload_slots, posts_path(tags: "user:#{user.name} status:pending") %> /
<%= tag.abbr user.upload_limit.upload_slots, title: "#{pluralize(user.upload_limit.approvals_for_next_level - user.upload_limit.approvals_on_current_level, "approved post")} needed for next level (progress: #{user.upload_limit.approvals_on_current_level} / #{user.upload_limit.approvals_for_next_level}) " %>
<% if user.upload_limit.maxed? %>
<%= tag.abbr user.upload_limit.upload_slots, title: "Maximum amount of upload slots reached." %>
<% else %>
<%= tag.abbr user.upload_limit.upload_slots, title: "#{pluralize(user.upload_limit.approvals_for_next_level - user.upload_limit.approvals_on_current_level, "approved post")} needed for next level (progress: #{user.upload_limit.approvals_on_current_level} / #{user.upload_limit.approvals_for_next_level}) " %>
<% end %>
<% end %>
(<%= link_to_wiki "help", "about:upload_limits" %>)

View File

@@ -0,0 +1,10 @@
<% if CurrentUser.user.is_restricted? && (params[:controller] == "users" || cookies[:hide_verify_account_notice].blank?) %>
<div class="notice notice-info notice-large" id="verify-account-notice">
<h2>Your account is restricted.</h2>
<div>
You must verify your account because you signed up from a proxy or a VPN.
<%= link_to "Verify your account now", verify_user_email_path(CurrentUser.user) %>.
</div>
<div><%= link_to "Close this", "#", id: "hide-verify-account-notice" %></div>
</div>
<% end %>

View File

@@ -27,14 +27,14 @@
<p>
<% if @user.email_address.present? %>
<%= @user.email_address.address %>
<% if !@user.email_address.is_verified %>
<em>(unverified)</em>
<% end %>
<% else %>
<em>blank</em>
<% end %>
- <%= link_to "Change your email", edit_user_email_path(@user) %>
(<%= link_to "Change email", edit_user_email_path(@user) %>
<% if !@user.email_address.is_verified %>
| <%= link_to "Verify email", verify_user_email_path(@user) %>
<% end %>)
<% else %>
<%= link_to "Add email", edit_user_email_path(@user) %>
<% end %>
</p>
</div>

View File

@@ -1,5 +1,5 @@
<section>
<h1>Recent Changes (<%= link_to "all", wiki_page_versions_path %>)</h1>
<h2>Recent Changes (<%= link_to "all", wiki_page_versions_path %>)</h2>
<ul>
<% WikiPage.order(updated_at: :desc).includes(:tag).limit(25).each do |page| %>
<li><%= link_to page.pretty_title, wiki_page_path(page), class: tag_class(page.tag) %></li>

View File

@@ -3,7 +3,7 @@
<%= render "wiki_pages/recent_changes" %>
<% if @wiki_page.present? %>
<h4>Options</h4>
<h2>Options</h2>
<ul>
<% unless @wiki_page.is_meta_wiki? %>