Various task ui improvements

* Use bootstrap form-control class for text and notes
* Can't edit start date or days of the week in challenge dailies from website
* Refactor dailies
This commit is contained in:
Blade Barringer 2015-06-13 22:29:06 -05:00
parent 3457068351
commit 0eb8caec23
4 changed files with 18 additions and 20 deletions

View file

@ -215,7 +215,6 @@ for $stage in $stages
border: 1px solid #aaa
border-radius: 0.382em
padding-left: 0.618em
background-color: #fff !important
-webkit-appearance: none
-moz-appearance: none
appearance: none

View file

@ -12,13 +12,13 @@ div(ng-if='::task.type!="reward"')
input.form-control(type='text', ng-model='task.startDate',
datepicker-popup='{{::user.preferences.dateFormat}}', is-open='datepickerOpened',
ng-click='datepickerOpened = true')
ng-click='datepickerOpened = true', ng-disabled='task.challenge.id')
hr
.form-group
legend.option-title=env.t('repeat')
select.form-control(ng-model='task.frequency')
select.form-control(ng-model='task.frequency', ng-disabled='task.challenge.id')
option(value='weekly')=env.t('repeatWeek')
option(value='daily')=env.t('repeatDays')

View file

@ -3,24 +3,23 @@ legend.option-title=env.t('repeatEvery')
// If frequency is daily
ng-form.form-group(name='everyX' ng-if='task.frequency=="daily"')
.input-group
input.form-control(type='number', ng-model='task.everyX', min='0', required)
input.form-control(type='number', ng-model='task.everyX', ng-disabled='task.challenge.id', min='0', required)
span.input-group-addon {{task.everyX == 1 ? env.t('day') : env.t('days')}}
// If frequency is weekly
.form-group(ng-if='task.frequency=="weekly"')
ul.repeat-days
// 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)}}
mixin dayOfWeek(day, num)
li
button(type='button', ng-class='{active: task.repeat.#{day}}',
ng-disabled='task.challenge.id', ng-click='task.repeat.#{day} = !task.repeat.#{day}')
| {{::moment.weekdaysMin(#{num})}}
+dayOfWeek('su', 0)
+dayOfWeek('m', 1)
+dayOfWeek('t', 2)
+dayOfWeek('w', 3)
+dayOfWeek('th', 4)
+dayOfWeek('f', 5)
+dayOfWeek('s', 6)

View file

@ -1,6 +1,6 @@
fieldset.option-group
label.option-title=env.t('text')
input.option-content(type='text', ng-model='task.text', required, ng-disabled='task.challenge.id')
input.form-control(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}")
textarea.form-control(rows='3', ng-model='task.notes', ng-model-options="{debounce: 1000}")