Skip to content

Commit

Permalink
Merge pull request #6 from feugy/2017-fixes
Browse files Browse the repository at this point in the history
2017 fixes
  • Loading branch information
feugy authored Sep 6, 2017
2 parents 51a0979 + 3760b03 commit 561effe
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 11 deletions.
6 changes: 3 additions & 3 deletions app/src/controller/card.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ module.exports = class CardController
# Add a new registration for the current season to the edited dancer, or edit an existing one
# Displays the registration dialog
#
# @param dancer [Dancer] doncer for whom a registration is added
# @param dancer [Dancer] dancer for whom a registration is added
addRegistration: (dancer) =>
# display dialog to choose registration season and dance classes
@dialog.modal(_.extend {
Expand Down Expand Up @@ -524,6 +524,7 @@ module.exports = class CardController
@_previous[dancer.id] = dancer.toJSON()
@_previous[address.id] = address.toJSON()
@_onChange()
console.log "reset card controller"

# **private**
# Effectively loads a card, and get all other dancers of this card.
Expand Down Expand Up @@ -644,5 +645,4 @@ module.exports = class CardController
@required[dancer.id] = [] for dancer in @dancers
@required[address.id] = [] for address in @addresses
@required.regClasses = ('' for registration in @card?.registrations or [])
for registration, i in @card?.registrations or []
@required.regs[i] = ([] for payment in registration.payments)
@required.regs = (([] for payment in registration.payments) for registration, i in @card?.registrations or [])
11 changes: 4 additions & 7 deletions app/src/directive/list.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ class ListDirective
# Displayed values, stored for sorting. Model id is used as key
_sortedValues: {}

# **private**
# Flag to avoid concurrent renderings
_inProgress: false

# Controller constructor: bind methods and attributes to current scope
#
# @param scope [Object] directive scope
Expand All @@ -71,8 +67,7 @@ class ListDirective
# **private**
# Entierly redraw the model's list
_onRedrawList: (event) =>
return unless @columns? and @list? and not @_inProgress
@_inProgress = true
return unless @columns? and @list?
@$el.empty().append @_renderHeader()
body = $('<tbody class="hideable">').appendTo @$el
@_waiting = 0
Expand Down Expand Up @@ -147,6 +142,8 @@ class ListDirective
# @param store [Boolean] store value for sort
# @return the rendered string
_renderCell: (model, attr, col, value, sorter, store) =>
# early quit if invoked on an outdated model
return unless @_sortedValues[model.id]?
html = ['<td data-col="', col, '" ']
# sortable value might be different from displayed value
unless @columns[col].selectable?
Expand Down Expand Up @@ -256,9 +253,9 @@ class ListDirective

# **private**
# Enable sort when waiting is finished
# Will early quit if rendering is still in progress
_allValuesRendered: =>
return unless @_waiting is 0
@_inProgress = false
# sorting
@_sortList @currentSort, @_isDesc
@_updateRowOrder()
Expand Down
52 changes: 52 additions & 0 deletions app/src/labels/common.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,58 @@ De même, les parents qui viennent chercher les enfants sont priés de bien voul
{name: 'Entainements dirigés & libres 10 dances (A, B, C)', price: 420, quantity: 1, label: '10 danses'}
{name: 'Entrainement seul', price: 12, quantity: 1, label: 'cours seul'}
]
'2017/2018': [
{category: 'Adultes, 1 an'}
{name: 'Forfait 1h adulte', price: 283, quantity: 1, label: '1h'}
{name: 'Forfait 1h adulte', price: 507, quantity: 2, label: '1h (couple)'}
{name: 'Forfait 1h étudiant', price: 260, quantity: 1, label: '1h (étudiant)'}
{name: 'Forfait 1h30 adulte', price: 382, quantity: 1, label: '1h30'}
{name: 'Forfait 1h30 étudiant', price: 353, quantity: 1, label: '1h30 (étudiant)'}
{name: 'Forfait 1h + 1h adulte', price: 481, quantity: 1, label: '1h + 1h'}
{name: 'Forfait 1h + 1h adulte', price: 862, quantity: 2, label: '1h + 1h (couple)'}
{name: 'Forfait 1h + 1h30 adulte', price: 565, quantity: 1, label: '1h + 1h30'}
{name: 'Forfait 1h30 + 1h30 adulte', price: 649, quantity: 1, label: '1h30 + 1h30'}
{name: 'Forfait Zumba 2 cours', price: 360, quantity: 1, '2 cours Zumba'}
{category: 'Adultes, 1 trimestre'}
{name: 'Forfait 1h adulte - trimestre', price: 105, quantity: 1, label: '1h'}
{name: 'Forfait 1h adulte - trimestre', price: 194, quantity: 2, label: '1h (couple)'}
{name: 'Forfait 1h étudiant - trimestre', price: 97, quantity: 1, label: '1h (étudiant)'}
{name: 'Forfait 1h30 adulte - trimestre', price: 143, quantity: 1, label: '1h30'}
{name: 'Forfait 1h30 étudiant - trimestre', price: 132, quantity: 1, label: '1h30 (étudiant)'}
{name: 'Forfait 1h + 1h adulte - trimestre', price: 178, quantity: 1, label: '1h + 1h'}
{name: 'Forfait 1h + 1h adulte - trimestre', price: 330, quantity: 2, label: '1h + 1h (couple)'}
{name: 'Forfait 1h + 1h30 adulte - trimestre', price: 211, quantity: 1, label: '1h + 1h30'}
{name: 'Forfait 1h30 + 1h30 adulte - trimestre', price: 243, quantity: 1, label: '1h30 + 1h30'}
{category: 'Cours'}
{name: 'Cours 1h adulte', price: 12, quantity: 1, label: '1h adulte'}
{name: 'Cours 1h30 adulte', price: 14, quantity: 1, label: '1h30 adulte'}
{name: 'Cours particulier 1 ou 2 personnes', price: 43, quantity: 1, label: 'CP 1/2 personnes'}
{name: 'Cours particulier 3 personnes', price: 52, quantity: 1, label: 'CP 3 personnes'}
{name: 'Cours particulier 4 personnes', price: 66, quantity: 1, label: 'CP 4 personnes'}
{category: 'Enfant/ados, 1 an'}
{name: 'Forfait 45 minutes enfants/ado', price: 191, quantity: 1, label: '45 minutes'}
{name: 'Forfait 1h enfants/ado', price: 254, quantity: 1, label: '1h'}
{name: 'Forfait 1h30 enfants/ado', price: 343, quantity: 1, label: '1h30'}
{name: 'Forfait 1h + 45 minutes enfants/ado', price: 379, quantity: 1, label: '1h + 45 minutes'}
{name: 'Forfait 1h + 1h enfants/ado', price: 432, quantity: 1, label: '1h + 1h'}
{name: 'Forfait 1h30 + 45 minutes enfants/ado', price: 454, quantity: 1, label: '1h30 + 45 minutes'}
{name: 'Forfait 1h + 1h30 enfants/ado', price: 508, quantity: 1, label: '1h + 1h30'}
{category: 'Enfant/ados, 1 trimestre'}
{name: 'Forfait 45 minutes enfants/ados - trimestre', price: 72, quantity: 1, label: '45 minutes'}
{name: 'Forfait 1h enfants/ados - trimestre', price: 95, quantity: 1, label: '1h'}
{name: 'Forfait 1h30 enfants/ados - trimestre', price: 128, quantity: 1, label: '1h30'}
{name: 'Forfait 1h + 45 minutes enfants/ados - trimestre', price: 142, quantity: 1, label: '1h + 45 minutes'}
{name: 'Forfait 1h + 1h enfants/ados - trimestre', price: 161, quantity: 1, label: '1h + 1h'}
{name: 'Forfait 1h30 + 45 minutes enfants/ados - trimestre', price: 170, quantity: 1, label: '1h30 + 45 minutes'}
{name: 'Forfait 1h + 1h30 enfants/ados - trimestre', price: 190, quantity: 1, label: '1h + 1h30'}
{category: 'Compétiteurs'}
{name: 'Entainements dirigés latine (D, E, F)', price: 320, quantity: 1, label: 'latine D,E,F'}
{name: 'Entainements dirigés & libres latine (A, B, C)', price: 360, quantity: 1, label: 'latine A,B,C'}
{name: 'Entainements dirigés standard (D, E, F)', price: 260, quantity: 1, label: 'standard D,E,F'}
{name: 'Entainements dirigés & libres standard (A, B, C)', price: 360, quantity: 1, label: 'standard A,B,C'}
{name: 'Entainements dirigés & libres 10 dances (A, B, C)', price: 420, quantity: 1, label: '10 danses'}
{name: 'Entrainement seul', price: 12, quantity: 1, label: 'cours seul'}
]

# different ways to learn the school existence
knownByMeanings:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dancerm",
"version": "4.0.3",
"version": "4.1.0",
"author": "Feugy <damien.feugas@gmail.com>",
"description": "DanceRM is a very simple Customer Relationship software specialized for dance schools",
"repository": {
Expand Down

0 comments on commit 561effe

Please sign in to comment.