Skip to content

Commit

Permalink
Add a check for DNP status
Browse files Browse the repository at this point in the history
  • Loading branch information
bitWolfy committed Nov 15, 2020
1 parent 5d11c8f commit 73104c3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
7 changes: 4 additions & 3 deletions public/projects/resolve.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ class="loading"
<video id="source-video" loop="loop" controls="controls" class="display-none">
</section>
<section id="image-data">
<a href="https://e621.net/posts/0" id="source-link" target="_blank" data-hotkey="p|*">#0</a> |
<span id="source-date">Loading</span> |
<a href="https://e621.net/post_versions?search[post_id]=0" id="source-history" target="_blank" data-hotkey="q|/">history</a>
<span><a href="https://e621.net/posts/0" id="source-link" target="_blank" data-hotkey="p|*">#0</a></span>
<span id="source-date">Loading</span>
<span id="dnp-notice" style="display: none;">On <a href="https://e621.net/wiki_pages/avoid_posting">DNP</a> list</span>
<span><a href="https://e621.net/post_versions?search[post_id]=0" id="source-history" target="_blank" data-hotkey="q|/">history</a></span>
</section>
<section id="title"><a href="/projects/<?php echo $project["meta"]; ?>"><?php echo $project["name"]; ?></a></section>
<section id="description"><?php echo $project["desc"]; ?></section>
Expand Down
6 changes: 6 additions & 0 deletions src/js/modules/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ export class Project {
$("#source-history").attr("href", "https://e621.net/post_versions?search[post_id]=" + post.id);
$("#tags-old, #tags-new").val(APIPost.getTagString(post));

// Check for DNP status
if (post.tags.artist.includes("avoid_posting") || post.tags.artist.includes("conditional_dnp")) {
$("#dnp-notice").removeAttr("style");
}

// Check for locked tags
const locked = new Set<string>();
for (const tag of post.locked_tags)
locked.add(tag.startsWith("-") ? tag.substr(1) : ("-" + tag));
Expand Down
6 changes: 6 additions & 0 deletions src/scss/pages/_project.resolve.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ section#image-data {
text-align: center;
padding: 0;
font-family: monospace;

span {
&:after { content: " | "; }
&:last-child:after { content: ""; }
}
#dnp-notice a { color: #ff3636; }
}

section#title {
Expand Down

0 comments on commit 73104c3

Please sign in to comment.