Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Announcements and blog fixes #303

Merged
merged 1 commit into from
Jul 11, 2020

Conversation

HebaruSan
Copy link
Contributor

@HebaruSan HebaruSan commented Jun 29, 2020

Motivation

When SpaceDock has a planned downtime, it's a struggle to notify users ahead of time. The only place that all SpaceDock users go is SpaceDock itself (unless you count CKAN users who don't even do that), but currently it has no ability to display such notifications.

Changes

Now a new "Global announcement at top of all pages" checkbox appears when creating or editing a blog post. If checked, a new BlogPost.announcement column is set to true. All blog posts with that column set to true are pulled in to (Markdown-enabled) banners across the top of every page. To make sure this is fast, the new column is indexed.

image

To remove an announcement, the admin can edit the blog post and uncheck the checkbox.

This pull request also attempts to make the blog somewhat usable.

Problems Changes
The blog listing only shows the first paragraph of each post, which is extremely short and not enough information to decide whether to read the rest Now the first three paragraphs are shown
When the blog listing truncates a post, there is no indication whether there is more text Now an ellipsis badge appears if the post has been truncated
The blog listing is pretty minimal and not too easy on the eyes Now the top heading and post titles are more prominent, and each post is put inside its own gray box
The individual blog post view is also not very pretty Now the post text goes in a nice gray box, and there's a new "Back to SpaceDock.info Blog" link at the bottom
The blog backend uses BlogPost.query.filter(BlogPost.id == id).first() to load a record Now it uses BlogPost.query.get(id) instead
If you delete a blog post, you get booted out to the main index page Now you go to the blog listing
A blog post's creation timestamp is shown in the listing but not in the individual post view Now it's shown in both
If you set disqus_id in config.ini, Disqus functionality is enabled. If you don't set it, the links are still there but they don't work. Now if the disqus_id setting isn't set, the Disqus functionality is not shown (including the "leave a comment, etc" blurb). This fixes #241.
To create, edit, or delete a blog post, the admin has to navigate to the admin pages or open an individual blog post Now the blog listing gives admins new buttons for New Blog Post, Edit, and Delete
The blog post editing page has no HTML title set Now it's "Edit Blog Post on Spacedock.info", and the in-page header is changed from Edit Post to Edit Blog Post
The blog post editing page has a Save button but no Cancel button. If you make some changes and decide you don't want to save them, you have to use your browser's back button or otherwise navigate away. Now there's a Cancel button

@HebaruSan HebaruSan added Type: Bug Type: Improvement Area: Backend Related to the Python code that runs inside gunicorn Priority: Normal Type: Feature Status: Ready Area: Frontend Related to HTML, JS, CSS, or other browser things labels Jun 29, 2020
templates/layout.html Outdated Show resolved Hide resolved
Copy link
Member

@DasSkelett DasSkelett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Looks good, works fine.

@HebaruSan HebaruSan merged commit 2f67cfe into KSP-SpaceDock:alpha Jul 11, 2020
@HebaruSan HebaruSan deleted the feature/announcements branch July 11, 2020 17:21
@HebaruSan HebaruSan added the Area: Migration Related to Alembic database migrations label Jul 11, 2020
This was referenced Oct 5, 2020
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 Area: Migration Related to Alembic database migrations Priority: Normal Status: Ready Type: Bug Type: Feature Type: Improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants