bsw/jbe@19: local issue = param.get("issue", "table") bsw/jbe@19: bsw/jbe@19: local policy = issue.policy bsw/jbe@19: ui.form{ bsw/jbe@19: record = issue, bsw/jbe@19: readonly = true, bsw/jbe@19: attr = { class = "vertical" }, bsw/jbe@19: content = function() bsw@25: ui.field.text{ label = _"Population", name = "population" } bsw@25: ui.field.timestamp{ label = _"Created at", name = "created" } bsw@899: if policy.polling then bsw@907: ui.field.text{ label = _"Admission time", value = _"Implicitly admitted" } bsw@899: else bsw@937: ui.field.text{ label = _"Admission time", value = format.interval_text(issue.admission_time_text) } bsw@255: ui.field.text{ bsw@899: label = _"Issue quorum", bsw@899: value = format.percentage(policy.issue_quorum_num / policy.issue_quorum_den) bsw@255: } bsw@899: if issue.population then bsw@899: ui.field.text{ bsw@899: label = _"Currently required", bsw@899: value = math.ceil(issue.population * policy.issue_quorum_num / policy.issue_quorum_den) bsw@899: } bsw@899: end bsw@255: end bsw@718: if issue.accepted then bsw@718: ui.field.timestamp{ label = _"Accepted at", name = "accepted" } bsw@718: end bsw@937: ui.field.text{ label = _"Discussion time", value = format.interval_text(issue.discussion_time_text) } bsw@718: if issue.half_frozen then bsw@718: ui.field.timestamp{ label = _"Half frozen at", name = "half_frozen" } bsw@718: end bsw@937: ui.field.text{ label = _"Verification time", value = format.interval_text(issue.verification_time_text) } bsw/jbe@19: ui.field.text{ bsw/jbe@19: label = _"Initiative quorum", bsw/jbe@19: value = format.percentage(policy.initiative_quorum_num / policy.initiative_quorum_den) bsw/jbe@19: } bsw@255: if issue.population then bsw@255: ui.field.text{ bsw@255: label = _"Currently required", bsw@255: value = math.ceil(issue.population * (issue.policy.initiative_quorum_num / issue.policy.initiative_quorum_den)), bsw@255: } bsw@255: end bsw@718: if issue.fully_frozen then bsw@718: ui.field.timestamp{ label = _"Fully frozen at", name = "fully_frozen" } bsw@718: end bsw@937: ui.field.text{ label = _"Voting time", value = format.interval_text(issue.voting_time_text) } bsw@718: if issue.closed then bsw@718: ui.field.timestamp{ label = _"Closed", name = "closed" } bsw@718: end bsw/jbe@19: end bsw/jbe@19: } bsw/jbe@19: ui.form{ bsw/jbe@19: record = issue.policy, bsw/jbe@19: readonly = true, bsw/jbe@19: content = function() bsw/jbe@19: end bsw/jbe@19: }