add priority-multiplier to html & tasks.coffee (note, requires merge

of @IvanGaravito /derby#hotfix-model_at_for_each_blocks
This commit is contained in:
Tyler Renelle 2013-03-03 17:54:14 -05:00
parent 6189fee74e
commit 1a335cc68a
2 changed files with 23 additions and 0 deletions

View file

@ -177,3 +177,12 @@ module.exports.app = (appExports, model) ->
# When they update their notes, re-establish tooltip & popover
$('[rel=tooltip]').tooltip()
$('[rel=popover]').popover()
appExports.tasksToggleAdvanced = (e, el) ->
$(el).next('.advanced').toggle()
appExports.tasksSetMultiplier = (e, el) ->
dataId = $(el).parent('[data-id]').attr('data-id')
#"_user.tasks.#{dataId}"
model.at(e.target).set 'multiplier', parseInt($(el).attr('data-multiplier'))
debugger

View file

@ -207,6 +207,20 @@
<div><small>Enter as date, eg 02/19/2013 or 02-19-2013</small></div>
</div>
{/}
{#unless equal(:task.type, 'reward')}
<div>
<div>
<a x-bind="click:tasksToggleAdvanced">Advanced</a>
<div class="control-group btn-group priority-multiplier hide advanced" data-id="{{:task.id}}">
<label>Multiplier <a href="https://trello.com/card/priority-multiplier/50e5d3684fe3a7266b0036d6/17" target="_blank"><i class='icon-question-sign'></i></a></label>
<button type="button" class="btn btn-info {#if equal(:task.multiplier,1)}active{/}" data-multiplier='1' x-bind=click:tasksSetMultiplier>1</button>
<button type="button" class="btn btn-info {#if equal(:task.multiplier,2)}active{/}" data-multiplier='2' x-bind=click:tasksSetMultiplier>2</button>
<button type="button" class="btn btn-info {#if equal(:task.multiplier,3)}active{/}" data-multiplier='3' x-bind=click:tasksSetMultiplier>3</button>
</div>
</div>
</div>
{/}
<button type=submit class="btn" x-bind="click:tasksSaveAndClose">Save & Close</button>
</form>
</div>