annotate app/main/admin/cancel_issue.lua @ 1020:93fc1a338311
Added better view title for admin cancel issue
 | author | 
 bsw | 
 | date | 
 Sun Aug 11 22:13:32 2013 +0200 (2013-08-11) | 
 | parents | 
 13a48d8c72f0  | 
 | children | 
 dd8b14c4b4c0  | 
 
 | rev | 
   line source | 
| 
bsw@1007
 | 
     1 
 | 
| 
bsw@1007
 | 
     2 local id = param.get("id")
 | 
| 
bsw@1007
 | 
     3 
 | 
| 
bsw@1007
 | 
     4 if not id then
 | 
| 
bsw@1020
 | 
     5   ui.title("Cancel issue #{id}")
 | 
| 
bsw@1020
 | 
     6   ui.actions()
 | 
| 
bsw@1007
 | 
     7   ui.form{
 | 
| 
bsw@1007
 | 
     8     module = "admin",
 | 
| 
bsw@1009
 | 
     9     view = "cancel_issue",
 | 
| 
bsw@1007
 | 
    10     content = function()
 | 
| 
bsw@1008
 | 
    11       ui.field.text{ label = _"Issue ID", name = "id" }
 | 
| 
bsw@1007
 | 
    12       ui.submit{ text = _"Cancel issue" }
 | 
| 
bsw@1007
 | 
    13     end
 | 
| 
bsw@1007
 | 
    14   }
 | 
| 
bsw@1007
 | 
    15 else
 | 
| 
bsw@1007
 | 
    16 
 | 
| 
bsw@1020
 | 
    17   ui.title(_("Cancel issue #{id}", { id = issue.id })
 | 
| 
bsw@1020
 | 
    18   ui.actions()
 | 
| 
bsw@1020
 | 
    19 
 | 
| 
bsw@1010
 | 
    20   local issue = Issue:by_id(id)
 | 
| 
bsw@1007
 | 
    21     
 | 
| 
bsw@1007
 | 
    22   execute.view{ module = "initiative", view = "_list", params = {
 | 
| 
bsw@1017
 | 
    23     initiatives_selector = issue:get_reference_selector("initiatives")
 | 
| 
bsw@1007
 | 
    24   } }
 | 
| 
bsw@1007
 | 
    25 
 | 
| 
bsw@1007
 | 
    26   ui.form{
 | 
| 
bsw@1007
 | 
    27     module = "admin",
 | 
| 
bsw@1009
 | 
    28     action = "cancel_issue",
 | 
| 
bsw@1007
 | 
    29     id = id,
 | 
| 
bsw@1019
 | 
    30     attr = { class = "vertical" },
 | 
| 
bsw@1007
 | 
    31     content = function()
 | 
| 
bsw@1018
 | 
    32       ui.field.text{ label = _"Administrative notice", name = "id", multiline = true }
 | 
| 
bsw@1007
 | 
    33       ui.submit{ text = _"Cancel issue now" }
 | 
| 
bsw@1007
 | 
    34     end
 | 
| 
bsw@1007
 | 
    35   }
 | 
| 
bsw@1007
 | 
    36 
 | 
| 
bsw@1007
 | 
    37 end
 |