Merge branch 'catalog-tile-patch' into 'new-dev'

Option to hide (including totally catalog stubs) and moderate/report on catalog tiles?

See merge request fatchan/jschan!231
jschan
Thomas Lynch 3 years ago
commit 8c68924dc5
  1. 2
      gulp/res/js/csstoggles.js
  2. 4
      gulp/res/js/filters.js
  3. 6
      views/mixins/catalogtile.pug

@ -42,7 +42,7 @@ class CssToggle {
};
//define the css
const hidePostStubsCss = `.post-container.hidden, .catalog-tile.hidden { visibility: hidden;margin-top: -1.5em;height: 0; }`;
const hidePostStubsCss = `.post-container.hidden, .catalog-tile.hidden { display: none;margin-top: -1.5em;height: 0; }`;
const hideThumbnailsCss = `.file-thumb, .catalog-thumb { visibility: hidden !important; }`;
const hideRecursiveCss = `.op.hidden ~ .anchor, .op.hidden ~ .post-container { display: none; }`;
const heightUnlimitCss = `img, video { max-height: unset; }`;

@ -77,9 +77,7 @@ const togglePostsHidden = (posts, state, single) => {
} else {
elem.classList['add']('hidden');
}
if (!isCatalog) {
elem.querySelector('.postmenu').children[0].textContent = (showing ? 'Hide' : 'Show');
}
}
};
@ -239,7 +237,7 @@ const moderatePost = (postContainer) => {
}
const postMenuChange = function(e) {
const postContainer = this.parentElement.parentElement.parentElement;
const postContainer = this.closest(isCatalog ? '.catalog-tile': '.post-container');
const postDataset = postContainer.dataset
const filterType = this.value;
const hiding = !postContainer.classList.contains('hidden');

@ -37,6 +37,12 @@ mixin catalogtile(post, index, overboard=false)
span(class=`flag flag-${post.country.code.toLowerCase()}` title=post.country.name alt=post.country.name)
|
a.no-decoration.post-subject(href=postURL) #{post.subject || 'No subject'}
|
select.jsonly.postmenu
option(value='single') Hide
option(value='fsub') Filter Subject
if !overboard
option(value='moderate') Moderate
br
span(title='Replies') R: #{post.replyposts}
| /

Loading…
Cancel
Save