Skip to content

Commit

Permalink
auto deselect legacy automod deleted channels in ignore channels (#1582)
Browse files Browse the repository at this point in the history
* auto deselect legacy automod deleted channels in ignore channels

* auto deselect legacy automod deleted channels in ignore channels

---------

Co-authored-by: Ashish Jhanwar <ashishjh-bst@users.noreply.github.com>
  • Loading branch information
ashishjh-bst and ashishjh-bst authored Oct 27, 2023
1 parent 1ae8b1f commit 3cefdab
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
9 changes: 8 additions & 1 deletion automod_legacy/assets/automod_legacy.html
Original file line number Diff line number Diff line change
Expand Up @@ -262,5 +262,12 @@ <h3>Basic automod</h3>
</select>
</div>
<hr />
<script>
$(function(){
$('.deleted-channel').each(function(i,v) {
v.selected = false
})
})
</script>
{{end}}
<!-- END COMMON RULE FIELDS -->
<!-- END COMMON RULE FIELDS -->
2 changes: 2 additions & 0 deletions reddit/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ CREATE INDEX IF NOT EXISTS redidt_feeds_subreddit_idx ON reddit_feeds(subreddit)
`, `
ALTER TABLE reddit_feeds ADD COLUMN IF NOT EXISTS disabled BOOLEAN NOT NULL DEFAULT FALSE;
`, `
ALTER TABLE reddit_feeds ADD COLUMN IF NOT EXISTS spoilers_enabled BOOLEAN NOT NULL DEFAULT TRUE;
`}
2 changes: 1 addition & 1 deletion web/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func (g *channelOptsHTMLGenState) outputDeletedChannels() {
}
for _, sel := range g.selections {
if !exists[sel] {
g.output(fmt.Sprintf(`<option value="%[1]d" selected>Deleted channel: %[1]d</option>\n`, sel))
g.output(fmt.Sprintf(`<option value="%[1]d" selected class="deleted-channel">Deleted channel: %[1]d</option>\n`, sel))
}
}
}
Expand Down

0 comments on commit 3cefdab

Please sign in to comment.