liquid_feedback_frontend
view app/main/report/index.lua @ 154:6b6c82f9ca9f
speedup member image loading when non set
we can add the location of the default file directy instead of going through another slow request
we can add the location of the default file directy instead of going through another slow request
| author | Daniel Poelzleithner <poelzi@poelzi.org> | 
|---|---|
| date | Fri Oct 08 15:25:10 2010 +0200 (2010-10-08) | 
| parents | a851cc1d9903 | 
| children | 
 line source
     1 function link_area(area)
     2   ui.link{
     3     external = "",
     4     attr = {
     5       onclick =
     6         "openEl('area_" .. tostring(area.id) .. "');" ..
     7         "return(false);"
     8     },
     9     content = function()
    10       ui.heading{
    11         content = area.name
    12       }
    13     end
    14   }
    15 end
    17 slot.set_layout("report")
    19 slot.put("<br />")
    21 ui.container{
    22   attr = {
    23     class = "nav",
    24     style = "text-align: center;"
    25   },
    26   content = function()
    29     ui.container{
    30       attr = { 
    31         class = "left",
    32       },
    33       content = function()
    34         ui.link{
    35           external = "",
    36           attr = {
    37             onclick = "undo(); return(false);"
    38           },
    39           content = function()
    40             ui.image{ static = "icons/16/cancel.png" }
    41             slot.put(" ")
    42             slot.put(_"Back")
    43           end
    44         }
    45       end
    46     }
    48     ui.form{
    49       attr = {
    50         style = "float: right;",
    51         onsubmit = "openElDirect(); return(false);"
    52       },
    53       content = function()
    54         slot.put("#")
    55         ui.tag{
    56           tag = "input",
    57           attr = {
    58             id = "input_issue",
    59             type = "text",
    60             style = "width: 4em;"
    61           }
    62         }
    63         slot.put(".")
    64         ui.tag{
    65           tag = "input",
    66           attr = {
    67             id = "input_initiative",
    68             type = "text",
    69             style = "width: 4em;"
    70           }
    71         }
    72         slot.put(" ")
    73         ui.tag{
    74           tag = "input",
    75           attr = {
    76             type = "submit",
    77             value = "OK",
    78           }
    79         }
    80       end
    81     }
    84     ui.link{
    85       external = "",
    86       attr = {
    87         onclick = "openPrevIssue(); return(false);"
    88       },
    89       content = function()
    90         ui.image{ static = "icons/16/resultset_previous_double.png" }
    91         slot.put(" ")
    92         slot.put(_"Previous issue")
    93       end
    94     }
    96     ui.link{
    97       external = "",
    98       attr = {
    99         onclick = "openPrevInitiative(); return(false);"
   100       },
   101       content = function()
   102         ui.image{ static = "icons/16/resultset_previous.png" }
   103         slot.put(" ")
   104         slot.put(_"Previous initiative")
   105       end
   106     }
   108     ui.link{
   109       external = "",
   110       attr = {
   111         onclick = "openParent(); return(false);"
   112       },
   113       content = function()
   114         ui.image{ static = "icons/16/go_up.png" }
   115         slot.put(" ")
   116         slot.put(_"Go up")
   117       end
   118     }
   120     ui.link{
   121       external = "",
   122       attr = {
   123         onclick = "openNextInitiative(); return(false);"
   124       },
   125       content = function()
   126         ui.image{ static = "icons/16/resultset_next.png" }
   127         slot.put(" ")
   128         slot.put(_"Next initiative")
   129       end
   130     }
   132     ui.link{
   133       external = "",
   134       attr = {
   135         onclick = "openNextIssue(); return(false);"
   136       },
   137       content = function()
   138         ui.image{ static = "icons/16/resultset_next_double.png" }
   139         slot.put(" ")
   140         slot.put(_"Next issue")
   141       end
   142     }
   143   end
   144 }
   146 slot.put("<br />")
   148 local areas = Area:new_selector():add_order_by("name"):exec()
   151 ui.container{
   152   attr = { id = "areas" },
   153   content = function()
   154     for i, area in ipairs(areas) do
   155       link_area(area)
   156     end
   157     slot.put("<br /><br />")
   158     slot.put(_"This report can be saved (use 'save complete website') and used offline.")  end
   159 }
   161 ui.script{ script = "openEl('areas')" }
   163 for i, area in ipairs(areas) do
   164   execute.view{
   165     module = "report",
   166     view = "area",
   167     params = { area = area }
   168   }
   169 end
