| rev | 
   line source | 
| 
bsw@441
 | 
     1 execute.view{ module = "index", view = "_lang_chooser" }
 | 
| 
bsw/jbe@0
 | 
     2 
 | 
| 
bsw/jbe@0
 | 
     3 slot.put_into("title", encode.html(config.app_title))
 | 
| 
bsw/jbe@0
 | 
     4 
 | 
| 
bsw@276
 | 
     5 if app.session.member_id then
 | 
| 
bsw@276
 | 
     6   util.help("index.index", _"Home")
 | 
| 
bsw@276
 | 
     7 
 | 
| 
bsw@276
 | 
     8   execute.view{
 | 
| 
bsw@276
 | 
     9     module = "member",
 | 
| 
bsw@276
 | 
    10     view = "_show",
 | 
| 
bsw@276
 | 
    11     params = {
 | 
| 
bsw@276
 | 
    12       member = app.session.member,
 | 
| 
bsw@276
 | 
    13       show_as_homepage = true
 | 
| 
bsw@276
 | 
    14     }
 | 
| 
bsw@276
 | 
    15   }
 | 
| 
bsw@276
 | 
    16 
 | 
| 
bsw@276
 | 
    17 elseif config.public_access then
 | 
| 
bsw@276
 | 
    18   if config.motd_public then
 | 
| 
bsw@276
 | 
    19     local help_text = config.motd_public
 | 
| 
bsw@276
 | 
    20     ui.container{
 | 
| 
bsw@276
 | 
    21       attr = { class = "wiki motd" },
 | 
| 
bsw@276
 | 
    22       content = function()
 | 
| 
bsw@276
 | 
    23         slot.put(format.wiki_text(help_text))
 | 
| 
bsw@276
 | 
    24       end
 | 
| 
bsw@276
 | 
    25     }
 | 
| 
bsw@276
 | 
    26   end
 | 
| 
bsw@276
 | 
    27   
 | 
| 
bsw@462
 | 
    28   local open_issues_selector = Issue:new_selector()
 | 
| 
bsw@462
 | 
    29     :add_where("issue.closed ISNULL")
 | 
| 
bsw@462
 | 
    30     :add_order_by("coalesce(issue.fully_frozen + issue.voting_time, issue.half_frozen + issue.verification_time, issue.accepted + issue.discussion_time, issue.created + issue.admission_time) - now()")
 | 
| 
bsw@462
 | 
    31 
 | 
| 
bsw@462
 | 
    32   local closed_issues_selector = Issue:new_selector()
 | 
| 
bsw@462
 | 
    33     :add_where("issue.closed NOTNULL")
 | 
| 
bsw@462
 | 
    34     :add_order_by("issue.closed DESC")
 | 
| 
bsw@462
 | 
    35 
 | 
| 
bsw@462
 | 
    36   
 | 
| 
bsw@462
 | 
    37   local tabs = {
 | 
| 
bsw@462
 | 
    38     module = "index",
 | 
| 
bsw@462
 | 
    39     view = "index"
 | 
| 
bsw@462
 | 
    40   }
 | 
| 
bsw@462
 | 
    41 
 | 
| 
bsw@462
 | 
    42   tabs[#tabs+1] = {
 | 
| 
bsw@462
 | 
    43     name = "units",
 | 
| 
bsw@462
 | 
    44     label = _"Units",
 | 
| 
bsw@462
 | 
    45     module = "unit",
 | 
| 
bsw@462
 | 
    46     view = "_list"
 | 
| 
bsw@462
 | 
    47   }
 | 
| 
bsw@462
 | 
    48 
 | 
| 
bsw@462
 | 
    49   tabs[#tabs+1] = {
 | 
| 
bsw@462
 | 
    50     name = "timeline",
 | 
| 
bsw@462
 | 
    51     label = _"Events",
 | 
| 
bsw@462
 | 
    52     module = "event",
 | 
| 
bsw@462
 | 
    53     view = "_list",
 | 
| 
bsw@462
 | 
    54     params = { global = true }
 | 
| 
bsw@462
 | 
    55   }
 | 
| 
bsw@462
 | 
    56 
 | 
| 
bsw@462
 | 
    57   tabs[#tabs+1] = {
 | 
| 
bsw@462
 | 
    58     name = "open",
 | 
| 
bsw@462
 | 
    59     label = _"Open issues",
 | 
| 
bsw@462
 | 
    60     module = "issue",
 | 
| 
bsw@462
 | 
    61     view = "_list",
 | 
| 
bsw@462
 | 
    62     params = {
 | 
| 
bsw@462
 | 
    63       for_state = "open",
 | 
| 
bsw@462
 | 
    64       issues_selector = open_issues_selector
 | 
| 
bsw@462
 | 
    65     }
 | 
| 
bsw@462
 | 
    66   }
 | 
| 
bsw@462
 | 
    67   tabs[#tabs+1] = {
 | 
| 
bsw@462
 | 
    68     name = "closed",
 | 
| 
bsw@462
 | 
    69     label = _"Closed issues",
 | 
| 
bsw@462
 | 
    70     module = "issue",
 | 
| 
bsw@462
 | 
    71     view = "_list",
 | 
| 
bsw@462
 | 
    72     params = {
 | 
| 
bsw@462
 | 
    73       for_state = "closed",
 | 
| 
bsw@462
 | 
    74       issues_selector = closed_issues_selector
 | 
| 
bsw@462
 | 
    75     }
 | 
| 
bsw@462
 | 
    76   }
 | 
| 
bsw@462
 | 
    77 
 | 
| 
bsw@462
 | 
    78   ui.tabs(tabs)
 | 
| 
bsw@276
 | 
    79   
 | 
| 
bsw@276
 | 
    80 else
 | 
| 
bsw@276
 | 
    81 
 | 
| 
bsw@386
 | 
    82   if config.motd_public then
 | 
| 
bsw@386
 | 
    83     local help_text = config.motd_public
 | 
| 
bsw@386
 | 
    84     ui.container{
 | 
| 
bsw@386
 | 
    85       attr = { class = "wiki motd" },
 | 
| 
bsw@386
 | 
    86       content = function()
 | 
| 
bsw@386
 | 
    87         slot.put(format.wiki_text(help_text))
 | 
| 
bsw@386
 | 
    88       end
 | 
| 
bsw@386
 | 
    89     }
 | 
| 
bsw@386
 | 
    90   end
 | 
| 
bsw@386
 | 
    91 
 | 
| 
bsw@367
 | 
    92   ui.tag{ tag = "p", content = _"Closed user group, please login to participate." }
 | 
| 
bsw@276
 | 
    93 
 | 
| 
bsw@369
 | 
    94   ui.form{
 | 
| 
bsw@369
 | 
    95   attr = { class = "login" },
 | 
| 
bsw@369
 | 
    96   module = 'index',
 | 
| 
bsw@369
 | 
    97   action = 'login',
 | 
| 
bsw@369
 | 
    98   routing = {
 | 
| 
bsw@369
 | 
    99     ok = {
 | 
| 
bsw@369
 | 
   100       mode   = 'redirect',
 | 
| 
bsw@369
 | 
   101       module = param.get("redirect_module") or "index",
 | 
| 
bsw@369
 | 
   102       view = param.get("redirect_view") or "index",
 | 
| 
bsw@369
 | 
   103       id = param.get("redirect_id"),
 | 
| 
bsw@369
 | 
   104     },
 | 
| 
bsw@369
 | 
   105     error = {
 | 
| 
bsw@369
 | 
   106       mode   = 'forward',
 | 
| 
bsw@369
 | 
   107       module = 'index',
 | 
| 
bsw@369
 | 
   108       view   = 'login',
 | 
| 
bsw@369
 | 
   109     }
 | 
| 
bsw@369
 | 
   110   },
 | 
| 
bsw@369
 | 
   111   content = function()
 | 
| 
bsw@369
 | 
   112     ui.field.text{
 | 
| 
bsw@369
 | 
   113       attr = { id = "username_field" },
 | 
| 
bsw@369
 | 
   114       label     = _'login name',
 | 
| 
bsw@369
 | 
   115       html_name = 'login',
 | 
| 
bsw@369
 | 
   116       value     = ''
 | 
| 
bsw@369
 | 
   117     }
 | 
| 
bsw@369
 | 
   118     ui.script{ script = 'document.getElementById("username_field").focus();' }
 | 
| 
bsw@369
 | 
   119     ui.field.password{
 | 
| 
bsw@369
 | 
   120       label     = _'Password',
 | 
| 
bsw@369
 | 
   121       html_name = 'password',
 | 
| 
bsw@369
 | 
   122       value     = ''
 | 
| 
bsw@369
 | 
   123     }
 | 
| 
bsw@369
 | 
   124     ui.submit{
 | 
| 
bsw@369
 | 
   125       text = _'Login'
 | 
| 
bsw@369
 | 
   126     }
 | 
| 
bsw@369
 | 
   127   end
 | 
| 
bsw@369
 | 
   128 }
 | 
| 
bsw@369
 | 
   129 
 | 
| 
jorges@103
 | 
   130 end
 | 
| 
jorges@103
 | 
   131 
 |