mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 20:12:19 +00:00
Merge branch 'develop'
This commit is contained in:
commit
456c4eba62
12 changed files with 102 additions and 77 deletions
10
locales/en/app.json
Normal file
10
locales/en/app.json
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"Habit": "Habit",
|
||||
"Daily": "Daily",
|
||||
"Todo": "Todo",
|
||||
"Reward": "Reward",
|
||||
"Habits": "Habits",
|
||||
"Dailies": "Dailies",
|
||||
"Todos": "Todos",
|
||||
"Rewards": "Rewards"
|
||||
}
|
||||
10
locales/he/app.json
Normal file
10
locales/he/app.json
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"Habit": "Habit",
|
||||
"Daily": "Daily",
|
||||
"Todo": "Todo",
|
||||
"Reward": "Reward",
|
||||
"Habits": "נווו קדימה!",
|
||||
"Dailies": "Dailies",
|
||||
"Todos": "Todos",
|
||||
"Rewards": "Rewards"
|
||||
}
|
||||
|
|
@ -26,7 +26,8 @@
|
|||
"superagent": "~0.12.4",
|
||||
"resolve": "~0.2.3",
|
||||
"browserify": "1.17.3",
|
||||
"expect.js": "~0.2.0"
|
||||
"expect.js": "~0.2.0",
|
||||
"derby-i18n": "0.0.1"
|
||||
},
|
||||
"private": true,
|
||||
"subdomain": "habitrpg",
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ setupTour = (model) ->
|
|||
}
|
||||
]
|
||||
|
||||
$('.main-avatar').popover('destroy') #remove previous popovers
|
||||
$('.main-herobox').popover('destroy') #remove previous popovers
|
||||
tour = new Tour()
|
||||
_.each tourSteps, (step) ->
|
||||
tour.addStep _.defaults step, {html:true}
|
||||
|
|
|
|||
|
|
@ -92,17 +92,17 @@ module.exports.app = (appExports, model) ->
|
|||
|
||||
user.on 'set', 'flags.customizationsNotification', (captures, args) ->
|
||||
return unless captures == true
|
||||
$('.main-avatar').popover('destroy') #remove previous popovers
|
||||
$('.main-herobox').popover('destroy') #remove previous popovers
|
||||
html = """
|
||||
Click your avatar to customize your appearance. <a href='#' onClick="$('.main-avatar').popover('hide');return false;">[Close]</a>
|
||||
Click your avatar to customize your appearance. <a href='#' onClick="$('.main-herobox').popover('hide');return false;">[Close]</a>
|
||||
"""
|
||||
$('.main-avatar').popover
|
||||
$('.main-herobox').popover
|
||||
title: "Customize Your Avatar"
|
||||
placement: 'bottom'
|
||||
trigger: 'manual'
|
||||
html: true
|
||||
content: html
|
||||
$('.main-avatar').popover 'show'
|
||||
$('.main-herobox').popover 'show'
|
||||
|
||||
|
||||
userSchema =
|
||||
|
|
|
|||
5
src/app/i18n.coffee
Normal file
5
src/app/i18n.coffee
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
i18n = require 'derby-i18n'
|
||||
|
||||
i18n.plurals.add 'he', (n) -> n
|
||||
|
||||
module.exports = i18n
|
||||
|
|
@ -1,10 +1,17 @@
|
|||
derby = require 'derby'
|
||||
app = derby.createApp module
|
||||
|
||||
{get, view, ready} = app
|
||||
derby.use require('derby-ui-boot'), {styles: []}
|
||||
derby.use require '../../ui'
|
||||
derby.use require 'derby-auth/components'
|
||||
|
||||
# Translations
|
||||
i18n = require './i18n'
|
||||
i18n.localize app,
|
||||
availableLocales: ['en', 'he']
|
||||
defaultLocale: 'en'
|
||||
|
||||
# Custom requires
|
||||
character = require './character'
|
||||
tasks = require './tasks'
|
||||
|
|
|
|||
|
|
@ -71,38 +71,31 @@ module.exports.partySubscribe = partySubscribe = (page, model, params, next, cb)
|
|||
module.exports.app = (appExports, model) ->
|
||||
user = model.at('_user')
|
||||
|
||||
unlockPartiesNotification = ->
|
||||
$('.main-avatar').popover('destroy') #remove previous popovers
|
||||
user.on 'set', 'flags.partyEnabled', (captures, args) ->
|
||||
return if (captures != true) or user.get('party.current')
|
||||
$('.user-menu').popover('destroy') #remove previous popovers
|
||||
html = """
|
||||
<div class='party-system-popover'>
|
||||
<img src='/img/party-unlocked.png' style='float:right;padding:5px;' />
|
||||
Congratulations, you have unlocked the Party System! You can now group with your friends by adding their User Ids.
|
||||
<a href='#' onClick="$('.main-avatar').popover('hide');return false;">[Close]</a>
|
||||
Be social, join a party and play Habit with your friends! You'll be better at your habits with accountability partners. LFG anyone?
|
||||
<a href='#' onClick="$('.user-menu').popover('hide');return false;">[Close]</a>
|
||||
</div>
|
||||
"""
|
||||
$('.main-avatar').popover
|
||||
title: "Party System Unlocked"
|
||||
$('.user-menu').popover
|
||||
title: "Party System"
|
||||
placement: 'bottom'
|
||||
trigger: 'manual'
|
||||
html: true
|
||||
content: html
|
||||
$('.main-avatar').popover 'show'
|
||||
$('.user-menu').popover 'show'
|
||||
|
||||
appExports.manuallyUnlockParties = ->
|
||||
$("#settings-modal").modal("hide")
|
||||
user.set('flags.partyEnabled', true)
|
||||
unlockPartiesNotification()
|
||||
|
||||
user.on 'set', 'flags.partyEnabled', (captures, args) ->
|
||||
unlockPartiesNotification() if captures == true
|
||||
|
||||
#TODO implement this when we have unsubscribe working properly
|
||||
model.on 'set', '_user.party.invitation', (after, before) ->
|
||||
if !before? and after? # they just got invited
|
||||
# if they haven't unlocked parties yet, unlock it for them
|
||||
user.set('flags.partyEnabled',true) unless user.get('flags.partyEnabled')
|
||||
window.setTimeout (-> window.location.reload true), 1000
|
||||
#partySubscribe(null, model, null, null, null)
|
||||
partyQ = model.query('parties').withId(after)
|
||||
partyQ.fetch (err, party) ->
|
||||
return next(err) if err
|
||||
model.ref '_party', party
|
||||
browser.resetDom(model)
|
||||
|
||||
appExports.partyCreate = ->
|
||||
newParty = model.get("_newParty")
|
||||
|
|
|
|||
|
|
@ -1,43 +1,43 @@
|
|||
<modals:>
|
||||
<app:modals:modal modalId="party-modal">
|
||||
{#if _user.party.current}
|
||||
<h2>{_party.name}</h2>
|
||||
<table class="table table-striped">
|
||||
{#each _partyMembers as :member}
|
||||
<tr><td>{username(:member.auth)}</td><td>({:member.id})</td></tr>
|
||||
{/}
|
||||
</table>
|
||||
<form class=form-inline x-bind="submit: partyInvite">
|
||||
{#if _view.partyError}
|
||||
<div class='alert alert-danger'>{_view.partyError}</div>
|
||||
{/}
|
||||
<div class='control-group'>
|
||||
<input type="text" class="input-medium" placeholder="User Id" value="{_newPartyMember}">
|
||||
<input type="submit" class="btn" value="Invite" />
|
||||
</div>
|
||||
</form>
|
||||
<a class='btn btn-danger' x-bind="click: partyLeave">Leave</a>
|
||||
<h2>{_party.name}</h2>
|
||||
<table class="table table-striped">
|
||||
{#each _partyMembers as :member}
|
||||
<tr><td>{username(:member.auth)}</td><td>({:member.id})</td></tr>
|
||||
{/}
|
||||
</table>
|
||||
<form class=form-inline x-bind="submit: partyInvite">
|
||||
{#if _view.partyError}
|
||||
<div class='alert alert-danger'>{_view.partyError}</div>
|
||||
{/}
|
||||
<div class='control-group'>
|
||||
<input type="text" class="input-medium" placeholder="User Id" value="{_newPartyMember}">
|
||||
<input type="submit" class="btn" value="Invite" />
|
||||
</div>
|
||||
</form>
|
||||
<a class='btn btn-danger' x-bind="click: partyLeave">Leave</a>
|
||||
|
||||
{else if _user.party.invitation}
|
||||
<!-- TODO show by whom -->
|
||||
<h2>You're Invited To {_party.name}</h2>
|
||||
<a class='btn btn-success' x-bind="click: partyAccept">Accept</a>
|
||||
<a class='btn btn-danger' x-bind="click: partyReject">Reject</a>
|
||||
<h2>You're Invited To {_party.name}</h2>
|
||||
<a class='btn btn-success' x-bind="click: partyAccept">Accept</a>
|
||||
<a class='btn btn-danger' x-bind="click: partyReject">Reject</a>
|
||||
|
||||
{else}
|
||||
<h2>Create A Party</h2>
|
||||
<!-- Not in a party , no invites - create a new one -->
|
||||
<p>You are not in a party. You can either create one and invite friends, or if you want to join an existing party, have them enter:</p>
|
||||
<pre class=prettyprint>{_user.id}</pre>
|
||||
<form class=form-inline x-bind="submit: partyCreate">
|
||||
{#if _view.partyError}
|
||||
<div class='alert alert-danger'>{_view.partyError}</div>
|
||||
{/}
|
||||
<div class=control-group>
|
||||
<input type="text" class="input-medium" placeholder="Party Name" value="{_newParty}" />
|
||||
<input type="submit" class="btn" value="Create" />
|
||||
</div>
|
||||
</form>
|
||||
<h2>Create A Party</h2>
|
||||
<!-- Not in a party , no invites - create a new one -->
|
||||
<p>You are not in a party. You can either create one and invite friends, or if you want to join an existing party, have them enter:</p>
|
||||
<pre class=prettyprint>{_user.id}</pre>
|
||||
<form class=form-inline x-bind="submit: partyCreate">
|
||||
{#if _view.partyError}
|
||||
<div class='alert alert-danger'>{_view.partyError}</div>
|
||||
{/}
|
||||
<div class=control-group>
|
||||
<input type="text" class="input-medium" placeholder="Party Name" value="{_newParty}" />
|
||||
<input type="submit" class="btn" value="Create" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{/}
|
||||
<@footer>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
<app:rewards:userTokens />
|
||||
{/}
|
||||
</span>
|
||||
<h2 class="task-column_title">Rewards</h2>
|
||||
<h2 class="task-column_title">{{t("Rewards")}}</h2>
|
||||
|
||||
<!-- if pets are enabled, make tabs -->
|
||||
{#if equal(_user.flags.petsEnabled,true)}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
<hr/>
|
||||
<h4>Misc</h4>
|
||||
<button x-bind="click:toggleHeader" class="btn">{#if _user.preferences.hideHeader}Show Header{else}Hide Header{/}</button>
|
||||
{#unless _user.flags.partyEnabled} <button x-bind="click:manuallyUnlockParties" data-dismiss='modal' rel=tooltip title="Parties are unlocked automatically for usability reasons, but you can override that here.">Enable Parties</button>{/}
|
||||
|
||||
{{#if _user.auth.local}}
|
||||
<hr/>
|
||||
|
|
@ -135,18 +134,18 @@
|
|||
|
||||
<menu:>
|
||||
<div class="user-menu">
|
||||
{#unless _loggedIn}
|
||||
<button class="task-action-btn tile solid" href="#" data-target="#login-modal" data-toggle="modal">Login / Register</button>
|
||||
{else}
|
||||
<ul class="nav site-nav">
|
||||
<li class="flyout">
|
||||
<h1 class="task-action-btn tile solid user-reporter">{username(_user.auth)}</h1>
|
||||
<ul class="flyout-content nav stacked">
|
||||
<li><a class="task-action-btn tile solid" data-target="#settings-modal" data-toggle="modal">Settings</a></li>
|
||||
<li>{#if _user.flags.partyEnabled}<a class="task-action-btn tile solid" data-target="#party-modal" data-toggle="modal">Party</a>{/}</li>
|
||||
<li><a class="task-action-btn tile solid" href="/logout">Logout</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
{/}
|
||||
{{#unless _loggedIn}}
|
||||
<button class="task-action-btn tile solid" href="#" data-target="#login-modal" data-toggle="modal">Login / Register</button>
|
||||
{{else}}
|
||||
<ul class="nav site-nav">
|
||||
<li class="flyout">
|
||||
<h1 class="task-action-btn tile solid user-reporter">{#if _user.party.invitation}<i class='icon-bell'></i> {/}{{username(_user.auth)}}</h1>
|
||||
<ul class="flyout-content nav stacked">
|
||||
<li><a class="task-action-btn tile solid" data-target="#settings-modal" data-toggle="modal">Settings</a></li>
|
||||
<li><a class="task-action-btn tile solid" data-target="#party-modal" data-toggle="modal">{#if _user.party.invitation}<i class='icon-bell'></i> {/}Party</a></li>
|
||||
<li><a class="task-action-btn tile solid" href="/logout">Logout</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
{{/}}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<!-- Habits Column -->
|
||||
<div class="module">
|
||||
<div class="task-column habits">
|
||||
<h2 class="task-column_title">Habits</h2>
|
||||
<h2 class="task-column_title">{{t("Habits")}}</h2>
|
||||
<app:tasks:newTask type="habit" inputValue="{_newHabit}" placeHolder="New Habit" />
|
||||
<ul class="habits">{#each _habitList as :task}<app:tasks:task />{/}</ul>
|
||||
</div>
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
<!-- Dailys Column -->
|
||||
<div class="module">
|
||||
<div class="task-column dailys">
|
||||
<h2 class="task-column_title">Daily</h2>
|
||||
<h2 class="task-column_title">{{t("Daily")}}</h2>
|
||||
<app:tasks:newTask type="daily" inputValue="{_newDaily}" placeHolder="New Daily" />
|
||||
<ul class='dailys'>{#each _dailyList as :task}<app:tasks:task />{/}</ul>
|
||||
</div>
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
<a class="option-action" href="/v1/users/{{_user.id}}/calendar.ics?apiToken={{_user.apiToken}}" rel=tooltip title="iCal"><i class=icon-calendar></i></a>
|
||||
<!-- <a href="https://www.google.com/calendar/render?cid={{encodeiCalLink(_user.id, _user.apiToken)}}" rel=tooltip title="Google Calendar"><i class=icon-calendar></i></a> -->
|
||||
</span>
|
||||
<h2 class="task-column_title">Todos</h2>
|
||||
<h2 class="task-column_title">{{t("Todos")}}</h2>
|
||||
<div id="todos-chart" style="display:none;"></div>
|
||||
|
||||
<!-- create new todo -->
|
||||
|
|
|
|||
Loading…
Reference in a new issue