liquid_feedback_frontend
annotate app/main/api/_issue.lua @ 1723:0b43b2485930
Added hook for logo only on start page
| author | bsw | 
|---|---|
| date | Tue Sep 28 09:16:01 2021 +0200 (2021-09-28) | 
| parents | 32cc544d5a5b | 
| children | 
| rev | line source | 
|---|---|
| bsw/jbe@1309 | 1 local issues = param.get("issues", "table") | 
| bsw/jbe@1309 | 2 | 
| bsw/jbe@1309 | 3 | 
| bsw/jbe@1309 | 4 local fields = { "id", "area_id", "policy_id", "admin_notice", "external_reference", "state", "phase_finished", "created", "accepted", "half_frozen", "fully_frozen", "closed", "cleaned", "min_admission_time", "max_admission_time", "discussion_time", "verification_time", "voting_time", "latest_snapshot_id", "admission_snapshot_id", "half_freeze_snapshot_id", "full_freeze_snapshot_id", "population", "voter_count", "status_quo_schulze_rank" } | 
| bsw/jbe@1309 | 5 | 
| bsw/jbe@1309 | 6 local r = json.array() | 
| bsw/jbe@1309 | 7 | 
| bsw/jbe@1309 | 8 for i, issue in ipairs(issues) do | 
| bsw/jbe@1309 | 9 local ir = json.object() | 
| bsw/jbe@1309 | 10 for j, field in ipairs(fields) do | 
| bsw/jbe@1309 | 11 local value = issue[field] | 
| bsw/jbe@1309 | 12 if value == nil then | 
| bsw/jbe@1309 | 13 value = json.null | 
| bsw/jbe@1309 | 14 else | 
| bsw/jbe@1309 | 15 value = tostring(value) | 
| bsw/jbe@1309 | 16 end | 
| bsw/jbe@1309 | 17 ir[field] = value | 
| bsw/jbe@1309 | 18 end | 
| bsw/jbe@1309 | 19 r[#r+1] = ir | 
| bsw/jbe@1309 | 20 end | 
| bsw/jbe@1309 | 21 | 
| bsw/jbe@1309 | 22 return r |