Skip to content

Allow admins to remove CKAN flag#437

Closed
HebaruSan wants to merge 1 commit intoKSP-SpaceDock:alphafrom
HebaruSan:feature/admin-rm-ckan
Closed

Allow admins to remove CKAN flag#437
HebaruSan wants to merge 1 commit intoKSP-SpaceDock:alphafrom
HebaruSan:feature/admin-rm-ckan

Conversation

@HebaruSan
Copy link
Copy Markdown
Member

Motivation

Currently the CKAN badge can't be removed from a mod even if the CKAN team decides not to add it to CKAN. This may confuse users who think it would be there and can't find it, and it also causes some minor unnecessary network traffic from SpaceDock to the CKAN webhooks when the mod is edited or updated.

Changes

Now admin users will see a new X button within the CKAN badge:

image

When you click it, a confirmation dialog appears:

image

If you click the Remove CKAN Flag button, then a new /mod/<mod_id>/unckan route removes the flag and refreshes the page so you can see the badge is gone.

Also the mod page's div.header previously had a background: transparent; style which was immediately overridden by background-color: #FFFFFF;. In practice all this accomplished was to mess up the layout of the header graphic. This is now removed so the header graphic will appear as it was intended to.

@HebaruSan HebaruSan added Area: Backend Related to the Python code that runs inside gunicorn Priority: Low Type: Feature Status: Ready Area: Frontend Related to HTML, JS, CSS, or other browser things Scope: Trivial Simple changes that should be easy to develop and review labels Dec 13, 2021
@HebaruSan HebaruSan requested a review from DasSkelett December 13, 2021 05:14
@DasSkelett
Copy link
Copy Markdown
Member

if not ckan and mod.ckan:
if not mod.published or newly_published or current_user.admin:
# Allow unchecking the CKAN badge while the mod isn't published yet
# or all the time for admins.
mod.ckan = False

#337

?

@HebaruSan
Copy link
Copy Markdown
Member Author

Oh, I forgot that! I thought we had a conversation recently about the need to add this.
Never mind!

@HebaruSan HebaruSan closed this Dec 13, 2021
@HebaruSan HebaruSan deleted the feature/admin-rm-ckan branch December 13, 2021 15:06
@HebaruSan
Copy link
Copy Markdown
Member Author

Will need to find a new home for the transparent side fix, though. #420 maybe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Backend Related to the Python code that runs inside gunicorn Area: Frontend Related to HTML, JS, CSS, or other browser things Priority: Low Scope: Trivial Simple changes that should be easy to develop and review Status: Ready Type: Feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants