Moved folders to website directory

This commit is contained in:
Blade Barringer
2015-02-03 14:10:55 -06:00
parent 576eec77f7
commit 8a8ce8d80d
92 changed files with 1 additions and 1 deletions
+149
View File
@@ -0,0 +1,149 @@
// Note here, we need this part of Habit to be a directive since we're going to be passing it variables from various
// parts of the app. The alternative would be to create new scopes for different containing sections, but that
// started to get unwieldy
script(id='templates/habitrpg-tasks.html', type="text/ng-template")
.tasks-lists.container-fluid
.row
.col-md-3.col-sm-6(bindonce='lists', ng-repeat='list in lists', ng-class='::{"rewards-module": list.type==="reward"}')
.task-column(class='{{list.type}}s')
// Todos export/graph options
span.option-box.pull-right(ng-if='::main && list.type=="todo"')
a.option-action(ng-show='obj.history.todos', ng-click='toggleChart("todos")', tooltip=env.t('progress'))
span.glyphicon.glyphicon-signal
//a.option-action(ng-href='/v1/users/{{user.id}}/calendar.ics?apiToken={{user.apiToken}}', tooltip='iCal')
a.option-action(ng-click='notPorted()', tooltip='iCal', ng-show='false')
span.glyphicon.glyphicon-calendar
// <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>
// Header
h2.task-column_title {{list.header}}
// Todo Chart
.todos-chart(ng-if='::list.type == "todo"', ng-show='charts.todos')
// Add New
form.task-add(name='new{{list.type}}form', ng-hide='obj._locked', ng-submit='addTask(obj[list.type+"s"],list)')
input(type='text', ng-model='list.newTask', placeholder='{{list.placeHolder}}', required)
button(type='submit', ng-disabled='new{{list.type}}form.$invalid')
span.glyphicon.glyphicon-plus
mixin taskColumnTabs(position)
// Habits Tabs
div(ng-if='::main && list.type=="habit"', class='tabbable tabs-below')
ul.task-filter
li(ng-class='{active: list.view == "all"}')
a(ng-click='list.view = "all"')=env.t('all')
li(ng-class='{active: list.view == "yellowred"}')
a(ng-click='list.view = "yellowred"')=env.t('yellowred')
li(ng-class='{active: list.view == "greenblue"}')
a(ng-click='list.view = "greenblue"')=env.t('greenblue')
// Daily Tabs
div(ng-if='::main && list.type=="daily"', class='tabbable tabs-below')
// remaining/completed tabs
ul.task-filter
li(ng-class='{active: list.view == "all"}')
a(ng-click='list.view = "all"')=env.t('all')
li(ng-class='{active: list.view == "remaining"}')
a(ng-click='list.view = "remaining"')=env.t('due')
li(ng-class='{active: list.view == "complete"}')
a(ng-click='list.view = "complete"')=env.t('grey')
// Todo Tabs
div(ng-if='::main && list.type=="todo"', ng-class='::{"tabbable tabs-below": list.type=="todo"}')
if position=="bottom"
div(ng-show='list.view == "complete"')
.alert
=env.t('lotOfToDos')
button.task-action-btn.tile.spacious.bright(ng-click='user.ops.clearCompleted({})',popover=env.t('deleteToDosExplanation'),popover-trigger='mouseenter')=env.t('clearCompleted')
p!=env.t('beeminderDeleteWarning')
// remaining/completed tabs
ul.task-filter
li(ng-class='{active: list.view == "remaining"}')
a(ng-click='list.view = "remaining"')=env.t('remaining')
li(ng-class='{active: list.view == "dated"}', tooltip=env.t('datedNotSorted'))
a(ng-click='list.view = "dated"')=env.t('dated')
li(ng-class='{active: list.view == "complete"}')
a(ng-click='list.view = "complete"')=env.t('complete')
// Rewards Tabs
div(ng-if='::main && list.type=="reward"', class='tabbable tabs-below')
ul.task-filter
li(ng-class='{active: list.view == "all"}')
a(ng-click='list.view = "all"')=env.t('all')
li(ng-class='{active: list.view == "ingamerewards"}')
a(ng-click='list.view = "ingamerewards"')=env.t('ingamerewards')
+taskColumnTabs('top')
// Actual List
ul(class='{{list.type}}s main-list', ng-show='obj[list.type + "s"].length > 0', hrpg-sort-tasks)
include ./task
// Static Rewards
ul.items.rewards(ng-if='main && list.type=="reward" && user.flags.itemsEnabled')
li.task.reward-item(ng-repeat='item in itemStore',popover-trigger='mouseenter', popover-placement='top', popover='{{item.notes()}}')
// right-hand side control buttons
.task-meta-controls
span.task-notes
span.glyphicon.glyphicon-comment
//left-hand size commands
.task-controls.task-primary
a.money.btn-buy.item-btn(ng-class='{highValue: item.value >= 1000}', ng-click='buy(item)')
span.shop_gold
span.reward-cost {{item.value}}
// main content
span(ng-class='::{"shop_{{item.key}} shop-sprite item-img": true}').reward-img
p.task-text {{item.text()}}
// Events
ul.items.rewards(ng-if='main && list.type=="reward" && (user.items.special.snowball>0 || user.stats.buffs.snowball || user.items.special.spookDust>0 || user.stats.buffs.spookDust)')
mixin specialSpell(k,canceler)
li.task.reward-item(ng-if='#{canceler ? "user.stats.buffs."+canceler : "user.items.special."+k+">0"}',popover-trigger='mouseenter', popover-placement='top', popover='{{Content.spells.special.#{k}.notes()}}')
.task-meta-controls
span.task-notes
span.glyphicon.glyphicon-comment
//left-hand size commands
.task-controls.task-primary
a.money.btn-buy.item-btn(ng-click='castStart(Content.spells.special.#{k})', ng-class='{active: Content.spells.special.#{k}.key == spell.key}')
if canceler
span.shop_gold
span.reward-cost {{Content.spells.special.#{k}.value}}
else
span.shop_spell(class='shop_#{k}')
span.reward-cost {{user.items.special.#{k}}}
// main content
p.task-text {{Content.spells.special.#{k}.text()}}
+specialSpell('snowball')
+specialSpell('spookDust')
+specialSpell('salt','snowball')
+specialSpell('opaquePotion','spookDust')
// Spells
ul.items(ng-if='main && list.type=="reward" && user.stats.class && !user.preferences.disableClasses')
li.task.reward-item(ng-repeat='(k,skill) in Content.spells[user.stats.class]', ng-if='user.stats.lvl >= skill.lvl',popover-trigger='mouseenter', popover-placement='top', popover='{{skill.notes()}}')
.task-meta-controls
span.task-notes
span.glyphicon.glyphicon-comment
//left-hand size commands
.task-controls.task-primary
a.money.btn-buy.item-btn(ng-click='castStart(skill)', ng-class='{active: skill.key == spell.key}')
span.reward-cost
strong {{skill.mana}}
=env.t('mp')
// main content
span(ng-class='{"shop_{{skill.key}} shop-sprite item-img": true}')
p.task-text {{skill.text()}}
br
// Ads
div(ng-if='::main && !user.purchased.ads && !user.purchased.plan.customerId && list.type!="reward"')
span.pull-right
a(ui-sref='options.settings.subscription', popover=env.t('removeAds'), popover-trigger='mouseenter')
span.glyphicon.glyphicon-remove
// Habit3
ins.adsbygoogle(ng-init='initAds()', style='display: inline-block; width: 234px; height: 60px;', data-ad-client='ca-pub-3242350243827794', data-ad-slot='9529624576')
+taskColumnTabs('bottom')
+238
View File
@@ -0,0 +1,238 @@
li(bindonce='list', bo-id='"task-"+task.id', ng-repeat='task in obj[list.type+"s"]', class='task {{Shared.taskClasses(task, user.filters, user.preferences.dayStart, user.lastCron, list.showCompleted, main)}}', ng-click='spell && (list.type != "reward") && castEnd(task, "task", $event)', ng-class='{"cast-target":spell && (list.type != "reward")}', popover-trigger='mouseenter', data-popover-html="{{task.notes | markdown}}", popover-placement="top", popover-append-to-body='true', ng-show='shouldShow(task, list, user.preferences)')
// right-hand side control buttons
.task-meta-controls
// Due Date
span(ng-if='task.type=="todo" && task.date')
span(ng-class='{"label label-danger":(moment(task.date).isBefore(_today, "days") && !task.completed)}') {{task.date | date:(user.preferences.dateFormat.indexOf('yyyy') == 0 ? user.preferences.dateFormat.substr(5) : user.preferences.dateFormat.substr(0,5))}}
// Streak
| &nbsp;
span(ng-show='task.streak') {{task.streak}}&nbsp;
span(tooltip=env.t('streakCounter'))
span.glyphicon.glyphicon-forward
| &nbsp;
// Icons only available if you own the tasks (aka, hidden from challenge stats)
span(ng-if='!obj._locked')
a(ng-click='pushTask(task,$index,"top")', tooltip=env.t('pushTaskToTop'))
span.glyphicon.glyphicon-open
// a(ng-click='pushTask(task,$index,"bottom")', tooltip=env.t('pushTaskToBottom'))
// span.glyphicon.glyphicon-import
// // glyphicon-import or glyphicon-save or glyphicon-sort-by-attributes
a.badge(ng-if='task.checklist[0]', ng-class='{"badge-success":checklistCompletion(task.checklist) == task.checklist.length}', ng-click='collapseChecklist(task)', tooltip=env.t('expandCollapse'))
|{{checklistCompletion(task.checklist)}}/{{task.checklist.length}}
span.glyphicon.glyphicon-tags(tooltip='{{Shared.appliedTags(user.tags, task.tags)}}', ng-hide='Shared.noTags(task.tags)')
// edit
a(ng-hide='task._editing', ng-click='editTask(task)', tooltip=env.t('edit'))
| &nbsp;
span.glyphicon.glyphicon-pencil(ng-hide='task._editing')
| &nbsp;
a(ng-hide='!task._editing', ng-click='editTask(task)', tooltip=env.t('cancel'))
span.glyphicon.glyphicon-remove(ng-hide='!task._editing')
| &nbsp;
// save
a(ng-hide='!task._editing', ng-click='editTask(task);saveTask(task)', tooltip=env.t('save'))
span.glyphicon.glyphicon-ok(ng-hide='!task._editing')
| &nbsp;
//challenges
span(ng-if='task.challenge.id')
span(ng-if='task.challenge.broken')
span.glyphicon.glyphicon-bullhorn(style='background-color:red;', ng-click='task._editing = true', tooltip=env.t('brokenChaLink') tooltip-placement='right')
| &nbsp;
span(ng-if='!task.challenge.broken')
span.glyphicon.glyphicon-bullhorn(tooltip=env.t('challenge'))
| &nbsp;
// delete
a(ng-if='!task.challenge.id', ng-click='removeTask(obj[list.type+"s"], $index)', tooltip=env.t('delete'))
span.glyphicon.glyphicon-trash
| &nbsp;
// chart
a(ng-show='task.history', ng-click='toggleChart(obj._id+task.id, task)', tooltip=env.t('progress'))
span.glyphicon.glyphicon-signal
| &nbsp;
// notes
span.task-notes(ng-show='task.notes && !task._editing')
span.glyphicon.glyphicon-comment
| &nbsp;
// left-hand side checkbox
.task-controls.task-primary(ng-if='!task._editing')
// Habits
.task-actions(ng-if='::task.type=="habit"')
// score() is overridden in challengesCtrl to do nothing
a(ng-if='task.up', ng-click='applyingAction || score(task,"up")')
span.glyphicon.glyphicon-plus
a(ng-if='task.down', ng-click='applyingAction || score(task,"down")')
span.glyphicon.glyphicon-minus
// Rewards
span(ng-show='task.type=="reward"')
a.money.btn-buy(ng-class='{highValue: task.value >= 1000}', ng-click='score(task, "down")')
span.shop_gold
span.reward-cost {{task.value}}
// Daily & Todos
span.task-checker.action-yesno(ng-if='::task.type=="daily" || task.type=="todo"')
input.visuallyhidden.focusable(ng-if='$state.includes("tasks")', id='box-{{obj._id}}_{{task.id}}', type='checkbox', ng-model='task.completed', ng-change='task.type=="todo" && pushTask(task,$index,"bottom"); changeCheck(task)')
input.visuallyhidden.focusable(ng-if='!$state.includes("tasks")', id='box-{{obj._id}}_{{task.id}}', type='checkbox')
label(for='box-{{obj._id}}_{{task.id}}')
// main content
div.task-text(ng-dblclick='task._editing ? saveTask(task) : editTask(task)')
markdown(text='task.text',target='_blank')
//-| {{task.text}}
div(ng-if='task.checklist && !$state.includes("options.social.challenges") && !task.collapseChecklist && !task._editing')
fieldset.option-group.task-checklist
label.checkbox(ng-repeat='item in task.checklist')
input(type='checkbox',ng-model='item.completed',ng-change='saveTask(task,true)')
markdown(text='item.text',target='_blank')
// edit/options dialog
div(ng-if='task._editing')
.task-options
// Broken Challenge
.well(ng-if='task.challenge.broken')
div(ng-if='task.challenge.broken=="TASK_DELETED"')
p=env.t('brokenTask')
p
a(ng-click='unlink(task, "keep")')=env.t('keepIt')
| &nbsp;&nbsp;
a(ng-click="removeTask(obj[list.type+'s'], $index)")=env.t('removeIt')
div(ng-if='task.challenge.broken=="CHALLENGE_DELETED"')
p
|&nbsp;
=env.t('brokenChallenge')
p
a(ng-click='unlink(task, "keep-all")')=env.t('keepThem')
| &nbsp;|&nbsp;
a(ng-click='unlink(task, "remove-all")')=env.t('removeThem')
div(ng-if='task.challenge.broken=="CHALLENGE_CLOSED"')
p
!=env.t('challengeCompleted', {user: "{{task.challenge.winner}}"})
p
a(ng-click='unlink(task, "keep-all")')=env.t('keepThem')
| &nbsp;|&nbsp;
a(ng-click='unlink(task, "remove-all")')=env.t('removeThem')
//div(ng-if='task.challenge.broken=="UNSUBSCRIBED"')
p=env.t('unsubChallenge')
p
a(ng-click="unlink(task, 'keep-all')")=env.t('keepThem')
| &nbsp;|&nbsp;
a(ng-click="unlink(task, 'remove-all')")=env.t('removeThem')
// Checklists
.task-checklist-edit(ng-if='!$state.includes("options.social.challenges")')
ul
li
button(type='button', ng-if='!task.checklist[0] && (task.type=="daily" || task.type=="todo")',ng-click='addChecklist(task)')
span.glyphicon.glyphicon-tasks
span=env.t('addChecklist')
form.checklist-form(ng-if='task.checklist')
fieldset.option-group(ng-if='!$state.includes("options.social.challenges")')
legend.option-title
span.hint(popover=env.t('checklistText'),popover-trigger='mouseenter',popover-placement='bottom')=env.t('checklist')
ul(hrpg-sort-checklist)
li(ng-repeat='item in task.checklist')
//input(type='checkbox',ng-model='item.completed',ng-change='saveTask(task,true)')
//-,ng-blur='saveTask(task,true)')
span.checklist-icon.glyphicon.glyphicon-resize-vertical()
input(type='text',ng-model='item.text',ui-keydown="{'8 46':'removeChecklistItem(task,$event,$index)'}",ui-keyup="{'13':'addChecklistItem(task,$event,$index)','38 40':'navigateChecklist(task,$index,$event)'}")
a(ng-click='removeChecklistItem(task,$event,$index,true)')
span.glyphicon.glyphicon-trash(tooltip=env.t('delete'))
form(ng-submit='saveTask(task,false,true)')
// text & notes
fieldset.option-group
label.option-title=env.t('text')
input.option-content(type='text', ng-model='task.text', required, ng-disabled='task.challenge.id')
label.option-title=env.t('extraNotes')
textarea.option-content(rows='3', ng-model='task.notes', ng-model-options="{debounce: 1000}")
// if Habit, plus/minus command options
fieldset.option-group.plusminus(ng-if='task.type=="habit" && !task.challenge.id')
legend.option-title=env.t('direction/Actions')
span.task-checker
input.visuallyhidden.focusable(id='{{obj._id}}_{{task.id}}-option-plus', type='checkbox', ng-model='task.up')
label(for='{{obj._id}}_{{task.id}}-option-plus')
span.task-checker
input.visuallyhidden.focusable(id='{{obj._id}}_{{task.id}}-option-minus', type='checkbox', ng-model='task.down')
label(for='{{obj._id}}_{{task.id}}-option-minus')
// if Daily, calendar
fieldset(ng-if='::task.type=="daily"', class="option-group")
legend.option-title=env.t('repeat')
ul.repeat-days(bindonce)
// note, does not use data-toggle="buttons-checkbox" - it would interfere with our own click binding
li
button(ng-class='{active: task.repeat.su}', type='button', ng-click='task.challenge.id || (task.repeat.su = !task.repeat.su)') {{::moment.weekdaysMin(0)}}
li
button(ng-class='{active: task.repeat.m}', type='button', ng-click='task.challenge.id || (task.repeat.m = !task.repeat.m)') {{::moment.weekdaysMin(1)}}
li
button(ng-class='{active: task.repeat.t}', type='button', ng-click='task.challenge.id || (task.repeat.t = !task.repeat.t)') {{::moment.weekdaysMin(2)}}
li
button(ng-class='{active: task.repeat.w}', type='button', ng-click='task.challenge.id || (task.repeat.w = !task.repeat.w)') {{::moment.weekdaysMin(3)}}
li
button(ng-class='{active: task.repeat.th}', type='button', ng-click='task.challenge.id || (task.repeat.th = !task.repeat.th)') {{::moment.weekdaysMin(4)}}
li
button(ng-class='{active: task.repeat.f}', type='button', ng-click='task.challenge.id || (task.repeat.f= !task.repeat.f)') {{::moment.weekdaysMin(5)}}
li
button(ng-class='{active: task.repeat.s}', type='button', ng-click='task.challenge.id || (task.repeat.s = !task.repeat.s)') {{::moment.weekdaysMin(6)}}
// if Reward, pricing
fieldset.option-group.option-short(ng-if='task.type=="reward" && !task.challenge.id')
legend.option-title=env.t('price')
input.option-content(type='number', size='16', min='0', step="any", ng-model='task.value')
.money.input-suffix
span.shop_gold
// if Todos, the due date
fieldset.option-group(ng-if='task.type=="todo" && !task.challenge.id')
legend.option-title=env.t('dueDate')
input.option-content.datepicker(type='text', datepicker-popup='{{user.preferences.dateFormat}}', ng-model='task.date', is-open='datepickerOpened', ng-click='datepickerOpened = true')
// Tags
fieldset.option-group(ng-if='!$state.includes("options.social.challenges")')
p.option-title.mega(ng-click='task._tags = !task._tags', tooltip=env.t('expandCollapse'))=env.t('tags')
label.checkbox(ng-repeat='tag in user.tags', ng-class="{visuallyhidden: task._tags}")
input(type='checkbox', ng-model='task.tags[tag.id]')
markdown(text='tag.name')
// Advanced Options
span(ng-if='::task.type!="reward"')
p.option-title.mega(ng-click='task._advanced = !task._advanced', tooltip=env.t('expandCollapse'))=env.t('advancedOptions')
fieldset.option-group.advanced-option(ng-class="{visuallyhidden: task._advanced}")
legend.option-title
a.hint.priority-multiplier-help(href='https://trello.com/card/priority-multiplier/50e5d3684fe3a7266b0036d6/17', target='_blank', popover-title=env.t('difficultyHelpTitle'), popover-trigger='mouseenter', popover=env.t('difficultyHelpContent'))=env.t('difficulty')
ul.priority-multiplier
li
button(type='button', ng-class='{active: task.priority==1 || !task.priority}', ng-click='task.challenge.id || (task.priority=1)')=env.t('easy')
li
button(type='button', ng-class='{active: task.priority==1.5}', ng-click='task.challenge.id || (task.priority=1.5)')=env.t('medium')
li
button(type='button', ng-class='{active: task.priority==2}', ng-click='task.challenge.id || (task.priority=2)')=env.t('hard')
//span(ng-if='task.type=="daily" && !task.challenge.id')
span(ng-if='task.type=="daily"')
legend.option-title.pull-left=env.t('restoreStreak')
input.option-content(type='number', ng-model='task.streak')
div(ng-if='(user.preferences.allocationMode == "taskbased" && user.preferences.automaticAllocation) || $state.is("options.social.challenges")')
legend.option-title.pull-left=env.t('attributes')
ul.task-attributes
li
button(type='button', ng-class='{active: task.attribute=="str"}', ng-click='task.attribute="str"')=env.t('physical')
li
button(type='button', ng-class='{active: task.attribute=="int"}', ng-click='task.attribute="int"')=env.t('mental')
li
button(type='button', ng-class='{active: task.attribute=="con"}', ng-click='task.attribute="con"')=env.t('social')
li
button(type='button', ng-class='{active: task.attribute=="per"}', ng-click='task.attribute="per"', popover=env.t('otherExamples'), popover-trigger='mouseenter', popover-placement='top')=env.t('other')
.save-close
button(type='submit')=env.t('saveAndClose')
div(class='{{obj._id}}{{task.id}}-chart', ng-show='charts[obj._id+task.id]')