Skip to content

Commit

Permalink
WIP(maintenance): start adding info page
Browse files Browse the repository at this point in the history
  • Loading branch information
SabreCat committed May 19, 2016
1 parent 0ef92f9 commit 1165a39
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 7 deletions.
25 changes: 24 additions & 1 deletion common/locales/en/maintenance.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,28 @@
"noDamageKeepStreaks": "You will NOT take damage or lose streaks!",
"thanksForPatience": "Thanks for your patience!",
"twitterMaintenanceUpdates": "For the most recent updates, watch our <a href='https://twitter.com/habitica'>Twitter</a>, where we will be posting status information.",
"veteranPetAward": "At the end, you will receive a Veteran pet!"
"veteranPetAward": "At the end, you will receive a Veteran pet!",

"maintenanceInfoTitle": "Information about Upcoming Maintenance to Habitica",
"maintenanceInfoWhat": "What is happening?",
"maintenanceInfoWhatText": "On May 21, Habitica will be down for maintenance for most of the day. You will not take any damage or have your account harmed during that weekend, even if you can’t log in to check off your Dailies in time! We will be working very hard to make the downtime as short as possible, and will be posting regular updates on <a href='https://twitter.com/habitica'>our Twitter account</a> At the end of the downtime, to thank everyone for their patience, you will all receive a rare pet!",
"maintenanceInfoWhy": "Why is this happening?",
"maintenanceInfoWhyText": "For the past several months, we have been thoroughly revamping Habitica behind-the-scenes. Specifically, we have rewritten the API. While it may not look much different on the surface, it’s a whole new world underneath. This will allow us WAY more flexibility when we want to build features in the future, and lead to improved performance!",
"maintenanceInfoTechDetails": "Want more details on the technical side of the process? Visit <a href='http://devs.habitica.com/'>The Forge, our dev blog</a>.",
"maintenanceInfoMore": "More Information",
"maintenanceInfoAccountChanges": "What changes will I see to my account after the rewrite is complete?",
"maintenanceInfoAccountChangesText": "At first, there won’t be any notable changes aside from performance improvements for features such as Challenges. If you notice any changes that shouldn’t be there, email us at <a href='mailto:admin@habitica.com'>admin@habitica.com</a> and we will investigate them for you!",
"maintenanceInfoAddFeatures": "What kind of features will this allow Habitica to add?",
"maintenanceInfoAddFeaturesText": "Completing this rewrite will allow us to start building out group plans, improved chat and Guilds, and additional productivity features like Monthlies and the ability to record yesterday’s activity! Those are all involved features on their own, so it will take time to build them, but until we were finished with this rewrite, there was no way we could start them.",
"maintenanceInfoHowLong": "How long will the maintenance take?",
"maintenanceInfoHowLongText": "We have to migrate tasks and data for all 1.3 million Habitica users -- not an easy task! We anticipate that it will take place between approximately <%= localStartTime %> and <%= localEndTime %>. Rest assured that we’re doing everything we can to make it go as quickly as possible! You can follow <a href='https://twitter.com/habitica'>updates on our Twitter</a>.",
"maintenanceInfoStatsAffected": "How will my Dailies, Streaks, Buffs, and Quests be affected?",
"maintenanceInfoStatsAffectedText1": "You will NOT take any damage or lose any streaks that weekend, but otherwise, your day will reset normally! Dailies that you checked will become unchecked, buffs will reset, etc. If you are in a Collection Quest, you will still find items. If you are in a Boss Battle, you will still deal damage to the Boss, but the Boss will not deal damage to you. (Even monsters need a break!)",
"maintenanceInfoStatsAffectedText2": "After a lot of thought, our team concluded that this was the most fair way to handle the fact that many users will not be able to check off their Dailies normally during the maintenance. We’re sorry for any inconvenience this causes!",
"maintenanceInfoSeeTasks": "What if I need to see my task list?",
"maintenanceInfoSeeTasksText": "A read-only version of your tasks will be available on the maintenance screen. Unfortunately, you won’t be able to check any of them off, but at least they will still be there as a reminder!",
"maintenanceInfoRarePet": "What kind of rare pet will I receive?",
"maintenanceInfoRarePetText": "To thank you for your patience during the downtime, everyone will get a rare Veteran Pet. If you’ve never received a Veteran Pet before, you will receive a Veteran Wolf. If you already have a Veteran Wolf, you will receive a Veteran Tiger. And if you already have a Veteran Wolf and a Veteran Tiger, you will receive a never-before-seen Veteran pet! After the migration is completed, it may take several hours for your pet to show up, but never fear, everyone will get one.",
"maintenanceInfoWho": "Who worked on this massive project?",
"maintenanceInfoWhoText": "We’re glad you asked! It was spearheaded by our amazing contributors paglias and Blade, with lots of help from SabreCat, TheHollidayInn, Victor Pudeyev, and TheUnknown."
}
20 changes: 15 additions & 5 deletions website/server/middlewares/api-v3/maintenanceMode.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,24 @@ module.exports = function maintenanceMode (req, res, next) {
getUserLanguage(req, res, function (err) {
if (err) return next(err);

const MAINTENANCE_START = nconf.get('MAINTENANCE_START');
const MAINTENANCE_END = nconf.get('MAINTENANCE_END');

if (req.headers && req.headers.accept && req.headers.accept.indexOf('text/html') !== -1) {
return res.status(503).render('../../../views/static/maintenance', {
env: res.locals.habitrpg,
t: res.t,
maintenanceEnd: new Date(MAINTENANCE_END),
});
if (req.path === '/views/static/maintenance-info') {
return res.status(503).render('../../../views/static/maintenance-info', {
env: res.locals.habitrpg,
t: res.t,
maintenanceStart: new Date(MAINTENANCE_START),
maintenanceEnd: new Date(MAINTENANCE_END),
});
} else {
return res.status(503).render('../../../views/static/maintenance', {
env: res.locals.habitrpg,
t: res.t,
maintenanceEnd: new Date(MAINTENANCE_END),
});
}
} else {
return res.status(503).send({
error: 'Maintenance',
Expand Down
29 changes: 29 additions & 0 deletions website/views/static/maintenance-info.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
title Habitica &VerticalLine;&nbsp;
=t('maintenance')

head
link(rel='stylesheet', type='text/css', href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/css/bootstrap.min.css')

body
h1=t('maintenanceInfoTitle')
h2=t('maintenanceInfoWhat')
p=t('maintenanceInfoWhatText')
h2=t('maintenanceInfoWhy')
p=t('maintenanceInfoWhyText')
p!=t('maintenanceInfoTechDetails')
h2=t('maintenanceInfoMore')
h3=t('maintenanceInfoAccountChanges')
p=t('maintenanceInfoAccountChangesText')
h3=t('maintenanceInfoAddFeatures')
p=t('maintenanceInfoAddFeaturesText')
h3=t('maintenanceInfoHowLong')
p!=t('maintenanceInfoHowLongText', {localStartTime: maintenanceStart.toLocaleTimeString(), localEndTime: maintenanceEnd.toLocaleTimeString()})
h3=t('maintenanceInfoStatsAffected')
p=t('maintenanceInfoStatsAffectedText1')
p=t('maintenanceInfoStatsAffectedText2')
h3=t('maintenanceInfoSeeTasks')
p=t('maintenanceInfoSeeTasksText')
h3=t('maintenanceInfoRarePet')
p=t('maintenanceInfoRarePetText')
h3=t('maintenanceInfoWho')
p=t('maintenanceInfoWhoText')
2 changes: 1 addition & 1 deletion website/views/static/maintenance.jade
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ body.text-center
ul.lead(style='list-style-position:inside')
li=t('noDamageKeepStreaks')
li=t('veteranPetAward')
p!=t('maintenanceMoreInfo', {linkStart: '<a href="http://devs.habitica.com">', linkEnd: '</a>',})
p!=t('maintenanceMoreInfo', {linkStart: '<a href="/views/static/maintenance-info">', linkEnd: '</a>',})
p.lead=t('thanksForPatience')

0 comments on commit 1165a39

Please sign in to comment.