-
Notifications
You must be signed in to change notification settings - Fork 53
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
New announcement system for TheyWorkForYou #1711
Conversation
Things not covered in this PR:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing major, but a few bugs and things to fix
<?php } else { ?> | ||
|
||
<?php if ( count($featured) > 0 ) { | ||
include 'featured.php'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means the featured.php will be shown twice on the page if there's no homepage announcement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I couldn't see a good way around this because some content we want in this box above the search (the alerts link) on the right all the time. My assumption (which hopefully won't be wrong) is we'll always have something there, and if not, it won't be immediately apparent to most people landing it's duplicated above and below the search.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could set a global flag so if it's being included the first time and the second time checks if the flag has been set and doesn't show it again, but as you say, no biggie.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've done this just so it isn't a surprise later (or when we first turn it on). Looks like it works fine.
www/includes/easyparliament/templates/html/homepage/featured-content.php
Outdated
Show resolved
Hide resolved
Should have fixed all of the big things and it looks like it works okay. If seems alright, I'll fix up the history to something sensible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the one bug I think, and one query, is all.
OK! Should be almost there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's one issue as to whether the new if
is around a bit too much, but not very important :)
@@ -93,6 +94,7 @@ | |||
</div> | |||
</div> | |||
|
|||
<?php if ( $featured_debate_shown == false ) { ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this if go round just the lines 101-105, otherwise the topics aren't shown if featured has been shown above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, can do that.
- Stores json config in 'banner' and 'announcements' editoral option. - Checks valid json (not valid schema) before save.
- use 'script' directory to mirror script-to-rule-them-all elsewhere - shortcut for css updating - create-superuser script for use in development envs - shortcut for changing cookie-domain in codespaces
- Add new Announcement box above search - Falls back to featured/random debate - Featured/random debate seperately shown beneath search Co-authored-by: Lucas <[email protected]>
- Adds announcement location to MP sidebar - Adds 'donation' location to MP sidebar - Adds 'Browse content' green box to draw attention to sidebar. Co-authored-by: Lucas <[email protected]>
faa145c
to
c50647c
Compare
Okay! History tidied up (and spelling fixed). Will merge in this afternoon! |
This PR adds a more general announcement feature to TheyWorkForYou.
The three locations style content in slightly different ways:
The backend has been adapted to store JSON that stores details of multiple options. Format is shown here. Invalid Json throws an error (but is not checked against a specific schema):
Dev helpers:
For consistency with the script-to-rule-them-all approach elsewhere the 'script' directory as opposed to 'script', stores several useful management commands for use in dev. Currently this contains
watch-css
and `create-superuser'.Other styling changes: