Merge branch 'api-v3' into api-v3-groups

This commit is contained in:
Blade Barringer
2016-01-18 18:04:20 -06:00
12 changed files with 78 additions and 46 deletions

View File

@@ -3,7 +3,7 @@ FROM ubuntu:trusty
MAINTAINER Sabe Jones <sabe@habitica.com>
# Avoid ERROR: invoke-rc.d: policy-rc.d denied execution of start.
RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d
RUN echo -e '#!/bin/sh\nexit 0' > /usr/sbin/policy-rc.d
# Install prerequisites
RUN apt-get update
@@ -22,20 +22,19 @@ RUN apt-get install -y nodejs
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/*
# Clone Habitica repo and install dependencies
RUN git clone https://github.com/HabitRPG/habitrpg.git
# Install global packages
RUN npm install -g gulp grunt-cli bower
RUN cd /habitrpg && npm install
RUN cd /habitrpg && bower install --allow-root
# Clone Habitica repo and install dependencies
WORKDIR /habitrpg
RUN git clone https://github.com/HabitRPG/habitrpg.git /habitrpg
RUN npm install
RUN bower install --allow-root
# Create environment config file and build directory
RUN cd /habitrpg && cp config.json.example config.json
RUN mkdir -p /habitrpg/website/build
# Point config.json to Mongo instance. Edit the IP address to your running Mongo container's IP before running.
RUN cd /habitrpg && sed -i 's/localhost/0.0.0.0/g' config.json
RUN cp config.json.example config.json
RUN mkdir -p ./website/build
# Start Habitica
EXPOSE 3000
WORKDIR /habitrpg/
CMD ["npm", "start"]

View File

@@ -6,7 +6,7 @@
"questEvilSantaDropBearCubPolarMount": "Polar Bear (Mount)",
"questEvilSanta2Text": "Find The Cub",
"questEvilSanta2Notes": "When Trapper Santa captured the polar bear mount, her cub ran off into the icefields. You hear twig-snaps and snow crunch through the crystaline sound of the forest. Paw prints! You start racing to follow the trail. Find all the prints and broken twigs, and retrieve the cub!",
"questEvilSanta2Notes": "When Trapper Santa captured the polar bear mount, her cub ran off into the icefields. You hear twig-snaps and snow crunch through the crystalline sound of the forest. Paw prints! You start racing to follow the trail. Find all the prints and broken twigs, and retrieve the cub!",
"questEvilSanta2Completion": "You've found the cub! It will keep you company forever.",
"questEvilSanta2CollectTracks": "Tracks",
"questEvilSanta2CollectBranches": "Broken Twigs",
@@ -42,7 +42,7 @@
"questOctopusText": "The Call of Octothulu",
"questOctopusNotes": "@Urse, a wild-eyed young scribe, has asked for your help exploring a mysterious cave by the sea shore. Among the twilight tidepools stands a massive gate of stalactites and stalagmites. As you near the gate, a dark whirlpool begins to spin at its base. You stare in awe as a squid-like dragon rises through the maw. \"The sticky spawn of the stars has awakened,\" roars @Urse madly. \"After vigintillions of years, the great Octothulu is loose again, and ravening for delight!\"",
"questOctopusCompletion": "Completion: With a final blow, the creature slips away into the whirlpool from which it came. You cannot tell if @Urse is happy with your victory or saddened to see the beast go. Wordlessly, your companion points to three slimy, gargantuan eggs in a nearby tidepool, set in a nest of gold coins. \"Probably just octopus eggs,\" you say nervously. As you return home, @Urse frantically scribbles in a journal and you suspect this is not the last time you will hear of the great Octothulu.",
"questOctopusCompletion": "With a final blow, the creature slips away into the whirlpool from which it came. You cannot tell if @Urse is happy with your victory or saddened to see the beast go. Wordlessly, your companion points to three slimy, gargantuan eggs in a nearby tidepool, set in a nest of gold coins. \"Probably just octopus eggs,\" you say nervously. As you return home, @Urse frantically scribbles in a journal and you suspect this is not the last time you will hear of the great Octothulu.",
"questOctopusBoss": "Octothulu",
"questOctopusDropOctopusEgg": "Octopus (Egg)",
"questOctopusUnlockText": "Unlocks purchasable octopus eggs in the Market",

View File

@@ -1,14 +1,14 @@
{
"subscription": "Subscription",
"subscriptions": "Subscriptions",
"subDescription": "Buy gems with gold, get monthly mystery items, retain progress history, double daily drop-caps, support the devs. Click for more info.",
"subDescription": "Buy Gems with gold, get monthly mystery items, retain progress history, double daily drop-caps, support the devs. Click for more info.",
"buyGemsGold": "Buy Gems with Gold",
"buyGemsGoldText": "Alexander the Merchant will sell you gems at a cost of <%= gemCost %> gold per gem. His monthly shipments are initially capped at <%= gemLimit %> gems per month, but this cap increases by 5 gems for every three months of consecutive subscription, up to a maximum of 50 gems per month!",
"buyGemsGoldText": "Alexander the Merchant will sell you Gems at a cost of <%= gemCost %> gold per gem. His monthly shipments are initially capped at <%= gemLimit %> Gems per month, but this cap increases by 5 Gems for every three months of consecutive subscription, up to a maximum of 50 Gems per month!",
"retainHistory": "Retain full history entries",
"retainHistoryText": "Makes your full history available in graphs and export. Non-subscriber histories get consolidated for database optimization.",
"doubleDrops": "Daily drop-caps doubled",
"doubleDropsText": "Complete your stable faster!",
"mysteryItem": "Exclusive Monthly Items",
"mysteryItem": "Exclusive monthly items",
"mysteryItemText": "Each month you will receive a unique cosmetic item for your avatar! Plus, for every three months of consecutive subscription, the Mysterious Time Travelers will grant you access to historic (and futuristic!) cosmetic items.",
"supportDevs": "Supports the developers",
"supportDevsText": "Your subscription helps keep Habitica thriving and helps fund the development of new features. Thank you for your generosity!",
@@ -47,9 +47,9 @@
"timeSupportText": "We will provide support for training, bugs, installation, and feature requests.",
"gameFeatures": "Game features",
"gold2Gem": "Gems purchasable with gold",
"gold2GemText": "Members will be able to purchase gems with gold, meaning none of your participants need to buy anything with real money.",
"infiniteGem": "Infinite leader gems",
"infiniteGemText": "We will provide the organization leaders with as many gems as they need, for things like challenge prizes, guild-creation, etc.",
"gold2GemText": "Members will be able to purchase Gems with gold, meaning none of your participants need to buy anything with real money.",
"infiniteGem": "Infinite leader Gems",
"infiniteGemText": "We will provide the organization leaders with as many Gems as they need, for things like challenge prizes, guild-creation, etc.",
"notYetPlan": "Plan not yet available, but click to contact us and we'll keep you updated.",
"contactUs": "Contact Us",
"checkout": "Checkout",
@@ -60,11 +60,12 @@
"subGemPop": "Because you subscribe to Habitica, you can purchase a number of Gems each month using Gold. You can see how many Gems are available to buy at the corner of the Gem icon.",
"subGemName": "Subscriber Gems",
"freeGemsTitle": "Obtain Gems for Free",
"maxBuyGems": "You have bought all the gems you can this month. Thanks for subscribing!",
"maxBuyGems": "You have bought all the Gems you can this month. More will become available within the first three days of next month. Thanks for subscribing!",
"buyGemsAllow1": "You can buy",
"buyGemsAllow2": "more gems this month",
"buyGemsAllow2": "more Gems this month",
"purchaseGemsSeparately": "Purchase Additional Gems",
"subFreeGemsHow": "Habitica players can earn gems for free by winning <a href=\"/#/options/groups/challenges\">challenges</a> that award gems as a prize, or as a <a href=\"http://habitica.wikia.com/wiki/Contributing_to_Habitica\">contributor reward by helping the development of Habitica.</a>",
"subFreeGemsHow": "Habitica players can earn Gems for free by winning <a href=\"/#/options/groups/challenges\">challenges</a> that award Gems as a prize, or as a <a href=\"http://habitica.wikia.com/wiki/Contributing_to_Habitica\">contributor reward by helping the development of Habitica.</a>",
"seeSubscriptionDetails": "Go to <a href='/#/options/settings/subscription'>Settings &gt; Subscription</a> to see your subscription details!",
"timeTravelers": "Time Travelers",
"timeTravelersTitleNoSub": "<%= linkStartTyler %>Tyler<%= linkEnd %> and <%= linkStartVicky %>Vicky<%= linkEnd %>",
"timeTravelersTitle": "Mysterious Time Travelers",

3
docker-compose.dev.yml Normal file
View File

@@ -0,0 +1,3 @@
web:
volumes:
- '.:/habitrpg'

13
docker-compose.yml Normal file
View File

@@ -0,0 +1,13 @@
web:
build: .
ports:
- "3000:3000"
links:
- mongo
environment:
- NODE_DB_URI=mongodb://mongo/habitrpg
mongo:
image: mongo
ports:
- "27017:27017"

View File

@@ -99,14 +99,14 @@
"test:api-v3": "mocha test/api/v3 --recursive",
"test:api-v3:unit": "mocha test/api/v3/unit --recursive",
"test:api-v3:integration": "mocha test/api/v3/integration --recursive",
"test:api-legacy": "istanbul cover -i \"website/src/**\" --dir coverage/api mocha test/api-legacy",
"test:api-legacy": "istanbul cover -i \"website/src/**\" --dir coverage/api ./node_modules/mocha/bin/_mocha test/api-legacy",
"test:common": "mocha test/common",
"test:content": "mocha test/content",
"test:karma": "karma start --single-run",
"test:karma:watch": "karma start",
"test:prepare:webdriver": "webdriver-manager update",
"test:e2e:webdriver": "webdriver-manager start",
"test:e2e": "DISPLAY=:99 NODE_ENV=testing protractor protractor.conf.js",
"test:e2e": "protractor protractor.conf.js",
"test:nodemon": "gulp test:nodemon",
"start": "gulp run:dev",
"sprites": "gulp sprites:compile",

View File

@@ -11,6 +11,7 @@ import psTree from 'ps-tree';
import gulp from 'gulp';
import Q from 'q';
import runSequence from 'run-sequence';
import os from 'os';
const TEST_SERVER_PORT = 3003
const TEST_DB = 'habitrpg_test'
@@ -36,7 +37,15 @@ let testCount = (stdout, regexp) => {
}
let testBin = (string, additionalEnvVariables = '') => {
return `NODE_ENV=testing ${additionalEnvVariables} ${string}`;
if(os.platform() === "win32") {
if(additionalEnvVariables != '') {
additionalEnvVariables = additionalEnvVariables.split(' ').join('&&set ');
additionalEnvVariables = 'set ' + additionalEnvVariables + '&&';
}
return `set NODE_ENV=testing&&${additionalEnvVariables}${string}`;
} else {
return `NODE_ENV=testing ${additionalEnvVariables} ${string}`;
}
};
gulp.task('test:nodemon', (done) => {
@@ -57,7 +66,7 @@ gulp.task('test:prepare:mongo', (cb) => {
gulp.task('test:prepare:server', ['test:prepare:mongo'], () => {
if (!server) {
server = exec(`NODE_ENV="TESTING" NODE_DB_URI="${TEST_DB_URI}" PORT="${TEST_SERVER_PORT}" node ./website/src/index.js`, (error, stdout, stderr) => {
server = exec(testBin(`node ./website/src/index.js`, `NODE_DB_URI=${TEST_DB_URI} PORT=${TEST_SERVER_PORT}`), (error, stdout, stderr) => {
if (error) { throw `Problem with the server: ${error}`; }
if (stderr) { console.error(stderr); }
});
@@ -250,7 +259,7 @@ gulp.task('test:karma:safe', ['test:prepare:build'], (cb) => {
gulp.task('test:e2e', ['test:prepare', 'test:prepare:server'], (cb) => {
let support = [
'Xvfb :99 -screen 0 1024x768x24 -extension RANDR',
'npm run test:e2e:webdriver',
testBin('npm run test:e2e:webdriver', 'DISPLAY=:99'),
].map(exec);
support.push(server);
@@ -360,7 +369,7 @@ gulp.task('test:api-v3:integration:watch', ['test:prepare:server'], () => {
gulp.task('test:api-v3:safe', ['test:prepare:server'], (done) => {
awaitPort(TEST_SERVER_PORT).then(() => {
let runner = exec(
testBin(API_V3_TEST_COMMAND, 'API_VERSION=v3'),
testBin(API_V3_TEST_COMMAND),
(err, stdout, stderr) => {
testResults.push({
suite: 'API V3 Specs\t',

BIN
website/public/community-guidelines-images/staff.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -107,3 +107,6 @@ li.spaced
.row-margin
margin: auto auto 1em auto
.reduce-top-margin
margin-top: -10px

View File

@@ -328,9 +328,9 @@ script(id='partials/options.settings.notifications.html', type="text/ng-template
script(id='partials/options.settings.subscription.html',type='text/ng-template')
//-h2=env.t('individualSub')
.container-fluid(ng-init='_subscription={key:"basic_earned"}')
h3= env.t('benefits')
.row
.col-md-6
h3= env.t('benefits')
+subPerks()
.col-md-6
@@ -354,7 +354,7 @@ script(id='partials/options.settings.subscription.html',type='text/ng-template')
li #{env.t('mysticHourglasses')} {{user.purchased.plan.consecutive.trinkets}}
div(ng-if='!user.purchased.plan.customerId || (user.purchased.plan.customerId && user.purchased.plan.dateTerminated)')
h4(ng-if='(user.purchased.plan.customerId && user.purchased.plan.dateTerminated)')= env.t("resubscribe")
.form-group
.form-group.reduce-top-margin
.radio(ng-repeat='block in Content.subscriptionBlocks | toArray | omit: "discount==true" | orderBy:"months"')
label
input(type="radio", name="subRadio", ng-value="block.key", ng-model='_subscription.key')
@@ -370,19 +370,20 @@ script(id='partials/options.settings.subscription.html',type='text/ng-template')
input.form-control(type='text', ng-model='_subscription.coupon', placeholder= env.t('couponPlaceholder'))
.form-group
button.pull-right.btn.btn-small(type='button',ng-click='applyCoupon(_subscription.coupon)')= env.t("apply")
p.resubscribe
small.muted=env.t('subscribeUsing')
a.purchase.btn.btn-primary(ng-click='Payments.showStripe({subscription:_subscription.key, coupon:_subscription.coupon})', ng-disabled='!_subscription.key')= env.t('card')
.container-fluid.slight-vertical-padding
.row.text-center
.col-xs-6
a.purchase(href='/paypal/subscribe?_id={{user._id}}&apiToken={{user.apiToken}}&sub={{_subscription.key}}{{_subscription.coupon ? "&coupon="+_subscription.coupon : ""}}', ng-disabled='!_subscription.key')
img(src='https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-small.png',alt=env.t('paypal'))
.col-xs-6
a.purchase(ng-click="Payments.amazonPayments.init({type: 'subscription', subscription:_subscription.key, coupon:_subscription.coupon})")
img(src='https://payments.amazon.com/gp/cba/button',alt=env.t('amazonPayments'))
div(ng-if='user.purchased.plan.customerId')
.btn.btn-primary(ng-if='!user.purchased.plan.dateTerminated && user.purchased.plan.paymentMethod=="Stripe"', ng-click='Payments.showStripeEdit()')=env.t('subUpdateCard')
.btn.btn-sm.btn-danger(ng-if='!user.purchased.plan.dateTerminated', ng-click='Payments.cancelSubscription()')=env.t('cancelSub')
.container-fluid.slight-vertical-padding(ng-if='!user.purchased.plan.customerId || (user.purchased.plan.customerId && user.purchased.plan.dateTerminated)')
small.muted=env.t('subscribeUsing')
.row.text-center
.col-xs-4
a.purchase.btn.btn-primary(ng-click='Payments.showStripe({subscription:_subscription.key, coupon:_subscription.coupon})', ng-disabled='!_subscription.key')= env.t('card')
.col-xs-4
a.purchase(href='/paypal/subscribe?_id={{user._id}}&apiToken={{user.apiToken}}&sub={{_subscription.key}}{{_subscription.coupon ? "&coupon="+_subscription.coupon : ""}}', ng-disabled='!_subscription.key')
img(src='https://www.paypalobjects.com/webstatic/en_US/i/buttons/pp-acceptance-small.png',alt=env.t('paypal'))
.col-xs-4
a.purchase(ng-click="Payments.amazonPayments.init({type: 'subscription', subscription:_subscription.key, coupon:_subscription.coupon})")
img(src='https://payments.amazon.com/gp/cba/button',alt=env.t('amazonPayments'))

View File

@@ -47,6 +47,7 @@ script(id='modals/buyGems.html', type='text/ng-template')
p=env.t('buyGemsAllow1')
| &nbsp;{{Shared.planGemLimits.convCap + User.user.purchased.plan.consecutive.gemCapExtra - User.user.purchased.plan.gemsBought}}&nbsp;
=env.t('buyGemsAllow2')
p!=env.t('seeSubscriptionDetails')
div(ng-if='user.purchased.plan.customerId')
.well
h3=env.t('purchaseGemsSeparately')
@@ -70,6 +71,7 @@ script(id='modals/buyGems.html', type='text/ng-template')
h3=env.t('becomeSubscriber')
div(ng-include="'partials/options.settings.subscription.html'")
.modal-footer
button.btn.btn-default(ng-click='$close()')=env.t('cancel')
div(ng-if='user.purchased.plan.customerId').pull-left
p!=env.t('seeSubscriptionDetails')
.text-right
button.btn.btn-default(ng-click='$close()')=env.t('close')

View File

@@ -73,6 +73,8 @@ block content
strong SabreCat (Sabe)
li
strong paglias (Matteo)
li
strong viirus (Phillip)
p=env.t('commGuidePara010')
p
@@ -371,4 +373,3 @@ block content
li Shaner
li Starsystemic
li UncommonCriminal