bsw/jbe@19: local search_for = param.get("search_for", atom.string) or "global" bsw@1045: local search_string = param.get("q", atom.string) bsw/jbe@0: bsw@480: if search_string then bsw@1045: ui.title ( _("Search results for: '#{search}'", { search = search_string } ) ) bsw@480: else bsw@1045: ui.title ( _"Search" ) bsw/jbe@0: end bsw/jbe@0: bsw@1493: ui.grid{ content = function() bsw@1493: ui.cell_main{ content = function() bsw@1493: bsw@1493: if not search_string then bsw@1493: return bsw@1493: end bsw@1493: bsw@1493: local issues_selector = Issue:get_search_selector(search_string) bsw@1493: local count = issues_selector:count() bsw@1493: local text bsw@1493: if count == 0 then bsw@1493: text = _"No matching issues found" bsw@1493: elseif count == 1 then bsw@1493: text = _"1 matching issue found" bsw@1493: else bsw@1493: text = _"#{count} matching issues found" bsw@1493: end bsw@1493: bsw@1493: ui.section( function() bsw@1493: ui.sectionHead( function() bsw@1493: ui.heading { level = 1, content = _(text, { count = count }) } bsw@1493: end ) bsw@1493: if count > 0 then bsw@1493: execute.view{ bsw@1493: module = "issue", bsw@1493: view = "_list", bsw@1493: params = { bsw@1493: search = search_string, bsw@1493: no_filter = true bsw@1493: }, bsw@1493: } bsw@1493: end bsw@1045: end) bsw@1493: bsw@1493: slot.put("
") bsw@480: bsw@1493: local members_selector = Member:get_search_selector(search_string) bsw@1493: local count = members_selector:count() bsw@1493: local text bsw@1493: if count == 0 then bsw@1493: text = _"No matching members found" bsw@1493: elseif count == 1 then bsw@1493: text = _"1 matching member found" bsw@1493: else bsw@1493: text = _"#{count} matching members found" bsw@1493: end bsw@1493: if app.session:has_access("everything") then bsw@1493: ui.section( function() bsw@1493: ui.sectionHead( function() bsw@1493: ui.heading { level = 1, content = _(text, { count = count }) } bsw@1493: end ) bsw@1493: if count > 0 then bsw@1493: execute.view{ bsw@1493: module = "member", bsw@1493: view = "_list", bsw@1493: params = { bsw@1493: members_selector = members_selector, bsw@1493: no_filter = true bsw@1493: }, bsw@1493: } bsw@1493: end bsw@1493: end ) bsw@1493: end bsw@1045: bsw/jbe@19: bsw@1493: end } bsw@1493: end }