Beispiel #1
0
class OrderStateDropdown(OrderDropdown):
    name = 'state'
    css = 'dropdown change_order_state_dropdown'
    action = 'orderstatetransition'
    vocab = vocabs.state_vocab()
    transitions = vocabs.state_transitions_vocab()

    @property
    def value(self):
        return self.order_data.state

    @property
    def items(self):
        transitions = transitions_of_main_state(self.value)
        return self.create_items(transitions)
Beispiel #2
0
class BookingStateDropdown(BookingsDropdown):
    name = 'state'
    css = 'dropdown change_booking_state_dropdown'
    action = 'bookingstatetransition'
    vocab = vocabs.state_vocab()
    transitions = vocabs.state_transitions_vocab()

    @property
    def value(self):
        return self.booking_data.state

    @property
    def items(self):
        transitions = transitions_of_main_state(self.value)
        return self.create_items(transitions)
Beispiel #3
0
class RedeemStateDropdown(RedeemDropdown):
    name = 'state'
    css = 'dropdown change_order_state_dropdown'
    action = 'redeemtransition'
    vocab = vocabs.state_vocab()
    transitions = vocabs.state_transitions_vocab()

    @property
    def value(self):
        return self.redeem_state

    @property
    def items(self):
        state = self.redeem_state
        transitions = list()
        if state in [ifaces.STATE_NEW, ifaces.STATE_RESERVED]:
            transitions = [ifaces.STATE_TRANSITION_REDEEM]
        else:
            transitions = [ifaces.STATE_TRANSITION_RENEW]
        return self.create_items(transitions)