~cadence/Frames

523a8130744c60d2bb5d75e5084f2431fbb0b6db — Cadence Ember 7 months ago 65f1231 main
Cancel them. Cancel them all.
6 files changed, 19 insertions(+), 3 deletions(-)

M api/view.js
M pug/feed.pug
M pug/includes/post.pug
M pug/post.pug
M sass/includes/post.sass
A utils/cancelled.js
M api/view.js => api/view.js +3 -0
@@ 1,5 1,6 @@
const {render} = require("pinski/plugins")
const {redirect, message} = require("../utils/plugins")
const cancelled = require("../utils/cancelled")
const auth = require("../utils/auth")
const db = require("../utils/db")



@@ 18,6 19,7 @@ module.exports = [
					viewer,
					handle,
					isSelf: handle === viewer.row.handle,
					isCancelled: cancelled.some(x => viewer.row.handle.endsWith(x)),
					post: db.prepare("SELECT * FROM Posts WHERE handle = ? AND id = ?").get(handle, id)
				})
			} else {


@@ 26,6 28,7 @@ module.exports = [
					viewer,
					handle,
					isSelf: handle === viewer.row.handle,
					isCancelled: cancelled.some(x => viewer.row.handle.endsWith(x)),
					posts: db.prepare("SELECT * FROM Posts WHERE handle = ? ORDER BY id DESC").all(handle),
					openAllCWs
				})

M pug/feed.pug => pug/feed.pug +1 -1
@@ 36,6 36,6 @@ block main

        button.pop-button Publish
  each post in posts
    +post(post, {openAllCWs})
    +post(post, {openAllCWs, isCancelled})
  else
    .no-posts No frames, yet.

M pug/includes/post.pug => pug/includes/post.pug +2 -1
@@ 9,7 9,8 @@ mixin post(post, options = {})
    +post-optional-cw(post, options)
      if post.content
        .post__content= post.content
      a(href=post.url): img(src=post.url).post__image
      a(href=post.url)
        img(src=post.url class={"post__image--distorted": options.isCancelled}).post__image

mixin post-optional-cw(post, options)
  if post.cw

M pug/post.pug => pug/post.pug +1 -1
@@ 13,6 13,6 @@ block main
  div You are #[span.highlight viewing a frame] from #{handle}
  if post
    div #[a(href=`/view/${handle}`) View all frames] from #{handle}
    +post(post, {showDelete: isSelf})
    +post(post, {showDelete: isSelf, isCancelled})
  else
    div.highlight Frame not found.

M sass/includes/post.sass => sass/includes/post.sass +4 -0
@@ 28,6 28,10 @@
    max-width: 100%
    max-height: 80vh

    &--distorted
      filter: invert(1) hue-rotate(200deg) brightness(0.7)
      transform: translate(31%, 9%) skewX(15deg) scale(1.2)

  &__cw
    @include theme("color", "text-warning")


A utils/cancelled.js => utils/cancelled.js +8 -0
@@ 0,0 1,8 @@
module.exports = [
	"freespeechextremist.com",
	"gleasonator.com",
	"neckbeard.xyz",
	"poa.st",
	"spinster.xyz",
	"yggdrasil.social"
]