Add a description of the reason a board is being taken offline

Registered by Paul Larson

Currently, when a board is marked offline, it's hard to tell who did it or why. We should ask the person marking the board offline for a reason, and note that reason in the device description as long as the board is offline.

Blueprint information

Status:
Complete
Approver:
Paul Larson
Priority:
Medium
Drafter:
None
Direction:
Approved
Assignee:
Michael Hudson-Doyle
Definition:
Approved
Series goal:
Accepted for trunk
Implementation:
Implemented
Milestone target:
milestone icon 2012.02
Started by
Michael Hudson-Doyle
Completed by
Michael Hudson-Doyle

Sprints

Whiteboard

zk: let's add a model that tracks state changes invoked by the administrator and the system alike. I'd propose the following fields:

class DeviceStateTransition(models.Model):
    created_on = DateTimeField(auto_add_now=True)
    created_by = models.ForeingKey(User)
    device = models.ForeignKey(Device)
    new_state = ...
    old_state = ...
    message = TextField()

I'd like to suggest using django built-in comment system where we could comment on each history event (so if I put a board offline, write down a few words other users can comment, and track this) (comments and all the views are mostly free thanks to that app.

mwh: basically makes sense.

Meta:
Headline: Offline boards will now have a reason associated with it so that other users can see why the board is offline
Acceptance: When a board is marked offline, you should be prompted for a reason. The reason will be visible from the device detail page.
Roadmap id: LAVA2012-LAVA-HEALTH-MANAGEMENT

(?)

Work Items

Work items:
Add a model that tracks state changes on boards: DONE
Provide a mechanism for adding a reason for the state change in the UI: DONE

This blueprint contains Public information 
Everyone can see this information.