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