diff --git a/common/locales/en/maintenance.json b/common/locales/en/maintenance.json
new file mode 100644
index 0000000000..72c6aa2bd9
--- /dev/null
+++ b/common/locales/en/maintenance.json
@@ -0,0 +1,34 @@
+{
+ "habiticaBackSoon": "Don't worry, Habitica will be back soon!",
+ "importantMaintenance": "We are doing important maintenance that we estimate will last until <%= localDate %> in your timezone.",
+ "maintenance": "Maintenance",
+ "maintenanceMoreInfo": "Want more information about the maintenance? <%= linkStart %>Check out our info page<%= linkEnd %>.",
+ "noDamageKeepStreaks": "You will NOT take damage or lose streaks!",
+ "thanksForPatience": "Thanks for your patience!",
+ "twitterMaintenanceUpdates": "For the most recent updates, watch our Twitter, where we will be posting status information.",
+ "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 our Twitter account. 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 The Forge, our dev blog.",
+ "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 admin@habitica.com 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 updates on our Twitter.",
+ "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": "If you know that you will need to see your task list on Saturday to remind yourself what you have to do, we recommend that before the maintenance begins, you take a screenshot of your tasks so that you can use it as a reference.",
+ "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 contributor paglias, with lots of help from Blade, TheHollidayInn, SabreCat, Victor Pudeyev, TheUnknown, and Alys.",
+ "maintenanceInfoTesting": "The new version was also tirelessly tested by a bunch of our amazing open-source volunteers. Thank you -- we couldn't have done this without you."
+}
diff --git a/config.json.example b/config.json.example
index 6aeb8ac74a..e85bb0e0e0 100644
--- a/config.json.example
+++ b/config.json.example
@@ -73,5 +73,7 @@
"APP": "app-name",
"SECRET": "secret",
"ENABLED": "false"
- }
+ },
+ "MAINTENANCE_START": "Sat May 21 2016 20:00:00 UTC",
+ "MAINTENANCE_END": "Sat May 22 2016 5:00:00 UTC"
}
diff --git a/website/src/middlewares/locals.js b/website/src/middlewares/locals.js
index 2f238a6a99..c6daa36a88 100644
--- a/website/src/middlewares/locals.js
+++ b/website/src/middlewares/locals.js
@@ -9,6 +9,10 @@ var forceRefresh = require('./forceRefresh');
var tavernQuest = require('../models/group').tavernQuest;
var mods = require('../models/user').mods;
+// TODO Remove once v3 maintenance is done
+const MAINTENANCE_START = nconf.get('MAINTENANCE_START');
+const MAINTENANCE_END = nconf.get('MAINTENANCE_END');
+
// To avoid stringifying more data then we need,
// items from `env` used on the client will have to be specified in this array
var clientVars = ['language', 'isStaticPage', 'avalaibleLanguages', 'translations',
@@ -55,6 +59,9 @@ module.exports = function(req, res, next) {
// Defined here and not outside of the middleware because tavernQuest might be an
// empty object until the query to fetch it finishes
worldDmg: (tavernQuest && tavernQuest.extra && tavernQuest.extra.worldDmg) || {},
+ // TODO Remove once v3 maintenance is done
+ maintenanceStart: MAINTENANCE_START,
+ maintenanceEnd: MAINTENANCE_END,
});
// Put query-string party (& guild but use partyInvite for backward compatibility)
diff --git a/website/src/routes/pages.js b/website/src/routes/pages.js
index 21bece6cfd..04766d9551 100644
--- a/website/src/routes/pages.js
+++ b/website/src/routes/pages.js
@@ -23,7 +23,7 @@ router.get('/', i18n.getUserLanguage, locals, function(req, res) {
// -------- Static Pages --------
-var pages = ['front', 'privacy', 'terms', 'api', 'features', 'videos', 'contact', 'plans', 'new-stuff', 'community-guidelines', 'old-news', 'press-kit', 'faq', 'overview', 'apps', 'clear-browser-data', 'merch'];
+var pages = ['front', 'privacy', 'terms', 'api', 'features', 'videos', 'contact', 'plans', 'new-stuff', 'community-guidelines', 'old-news', 'press-kit', 'faq', 'overview', 'apps', 'clear-browser-data', 'merch', 'maintenance-info'];
_.each(pages, function(name){
router.get('/static/' + name, i18n.getUserLanguage, locals, function(req, res) {
diff --git a/website/views/shared/new-stuff.jade b/website/views/shared/new-stuff.jade
index 92e764e31c..0e4baa40f7 100644
--- a/website/views/shared/new-stuff.jade
+++ b/website/views/shared/new-stuff.jade
@@ -1,27 +1,43 @@
-h2 5/17/2016 - TREELING PET QUEST AND CHALLENGE SPOTLIGHT!
+h2 5/19/2016 - IMPORTANT: UPCOMING MAINTENANCE!
hr
tr
td
- .Pet-Treeling-Base.pull-right
- h3 New Pet Quest: The Tangle Tree (Treelings)
- p We've released a new Pet Quest: The Tangle Tree! The Garden Competition has been disrupted by a terrible multi-tasking tree. Can you defeat this wooden warrior? If so, you'll earn some treeling eggs!
- p.small.muted by Lemoness and SabreCat
- p.small.muted Art by fuzzytrees, PainterProphet, and aurakami
- p.small.muted Writing by Flutter Bee
- tr
- td
- h3 Challenge Spotlight
- p There's a new Challenge Spotlight on our blog! Check it out for some great Challenges that can help you simplify your digital life.
+ h3 Maintenance to Take Place May 21
+ p This Saturday, we will be performing important maintenance on Habitica to build out the groundwork for some exciting upcoming features! We'll be doing everything we can to make this as smooth as possible, but unfortunately, there will be significant downtime for much of the day.
br
- p Have you made a Challenge that you think deserves to be in the spotlight? Submit it to be featured on our blog! Any Challenge with a Gem prize and a concrete end date is eligible. And feel free to tell us what you think about this month's spotlight in the comments, or on Twitter, Facebook, or Tumblr. Enjoy!
- p.small.muted by redphoenix
- p.small.muted Challenges by ArynChris, Janelle Rowe, and BeanieB
+ p.strong We expect that on Saturday, May 21st, Habitica will be unavailable between 1 PM and 10 PM Pacific Time (8 pm - 5 am UTC).
+ ul
+ li Don't worry, you will NOT lose any streaks or take any damage during this weekend, not even from Bosses! This maintenance will not harm your accounts.
+ li If you will need to see your task list on Saturday, we recommend taking a screenshot of your tasks before the maintenance begins so that you can use them as a reference during downtime.
+ li At the end of the maintenance, to thank people for their patience, everyone will receive a rare Veteran pet!
+ li This maintenance should not result in any major visible differences to the site; it's all behind-the-scenes work. However, at the end of it, we will release new updates to the mobile apps, which will be required in order for the apps to work properly with the new changes! Be sure to download those updates on Saturday as soon as they are released.
+ li For more information, please check out our detailed info page about the maintenance! And if you have any further questions or concerns, feel free to reach out to Leslie (leslie@habitica.com), and she will be happy to help you.
+ p We understand that it's very frustrating to have Habitica unavailable for such a long part of the day. Rest assured that we'll be doing everything we can to make the maintenance go as quickly as possible, but with over a million Habitican accounts to migrate, this is a hefty task! During the maintenance on Saturday we will be posting regular status reports on our Twitter account, so you can follow us for the most accurate updates.
+ br
+ p Thank you for your patience, and for using Habitica!
if menuItem !== 'oldNews'
hr
a(href='/static/old-news', target='_blank') Read older news
mixin oldNews
+ h2 5/17/2016 - TREELING PET QUEST AND CHALLENGE SPOTLIGHT!
+ tr
+ td
+ .Pet-Treeling-Base.pull-right
+ h3 New Pet Quest: The Tangle Tree (Treelings)
+ p We've released a new Pet Quest: The Tangle Tree! The Garden Competition has been disrupted by a terrible multi-tasking tree. Can you defeat this wooden warrior? If so, you'll earn some treeling eggs!
+ p.small.muted by Lemoness and SabreCat
+ p.small.muted Art by fuzzytrees, PainterProphet, and aurakami
+ p.small.muted Writing by Flutter Bee
+ tr
+ td
+ h3 Challenge Spotlight
+ p There's a new Challenge Spotlight on our blog! Check it out for some great Challenges that can help you simplify your digital life.
+ br
+ p Have you made a Challenge that you think deserves to be in the spotlight? Submit it to be featured on our blog! Any Challenge with a Gem prize and a concrete end date is eligible. And feel free to tell us what you think about this month's spotlight in the comments, or on Twitter, Facebook, or Tumblr. Enjoy!
+ p.small.muted by redphoenix
+ p.small.muted Challenges by ArynChris, Janelle Rowe, and BeanieB
h2 5/14/2016 - IMPORTANT ANDROID UPDATE AND HABITICA ON SOCIAL MEDIA
tr
td
diff --git a/website/views/static/maintenance-info.jade b/website/views/static/maintenance-info.jade
new file mode 100644
index 0000000000..eca615d348
--- /dev/null
+++ b/website/views/static/maintenance-info.jade
@@ -0,0 +1,49 @@
+- var t = t || env.t;
+- var maintenanceStart = maintenanceStart || env.maintenanceStart;
+- var maintenanceEnd = maintenanceEnd || env.maintenanceEnd;
+
+title Habitica |
+ =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
+ .container
+ h1.text-center=t('maintenanceInfoTitle')
+ img.img-rendering-auto.center-block.img-responsive(src='https://d2afqr2xdmyzvu.cloudfront.net/assets/scene_maintenance.png')
+ h2=t('maintenanceInfoWhat')
+ p!=t('maintenanceInfoWhatText')
+ img.pull-left(src='https://d2afqr2xdmyzvu.cloudfront.net/assets/scene_new.png')
+ 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')
+ img.pull-right(src='https://d2afqr2xdmyzvu.cloudfront.net/assets/scene_chatter.png')
+ p!=t('maintenanceInfoHowLongText', {localStartTime: '' + maintenanceStart + '', localEndTime: '' + maintenanceEnd + ''})
+ h3=t('maintenanceInfoStatsAffected')
+ p=t('maintenanceInfoStatsAffectedText1')
+ p=t('maintenanceInfoStatsAffectedText2')
+ h3=t('maintenanceInfoSeeTasks')
+ p=t('maintenanceInfoSeeTasksText')
+ h3=t('maintenanceInfoRarePet')
+ p=t('maintenanceInfoRarePetText')
+ img.pull-left(src='https://d2afqr2xdmyzvu.cloudfront.net/assets/scene_coding.png')
+ h3=t('maintenanceInfoWho')
+ p=t('maintenanceInfoWhoText')
+ p=t('maintenanceInfoTesting')
+
+ script.
+ var startTime = document.getElementById('start-time');
+ var endTime = document.getElementById('end-time');
+
+ var startUtc = startTime.innerHTML;
+ var endUtc = endTime.innerHTML;
+
+ startTime.innerHTML = new Date(startUtc).toLocaleString();
+ endTime.innerHTML = new Date(endUtc).toLocaleString();