bsw/jbe@1309: if not app.session:has_access("anonymous") then bsw/jbe@1309: slot.put("
      Closed user group, please login.














") bsw/jbe@1309: return bsw/jbe@1309: end bsw/jbe@1309: bsw/jbe@1309: local unit_id = request.get_param{ name = "unit" } bsw/jbe@1309: local area_id = request.get_param{ name = "area" } bsw/jbe@1309: bsw/jbe@1309: if unit_id == "all" then bsw/jbe@1309: unit_id = nil bsw/jbe@1309: end bsw/jbe@1309: bsw/jbe@1309: if area_id == "all" then bsw/jbe@1309: area_id = nil bsw/jbe@1309: end bsw/jbe@1309: bsw/jbe@1309: local unit bsw/jbe@1309: local area bsw/jbe@1309: bsw/jbe@1309: if unit_id then bsw/jbe@1309: unit = Unit:by_id(unit_id) bsw/jbe@1309: end bsw/jbe@1309: bsw/jbe@1309: if area_id then bsw/jbe@1309: area = Area:by_id(area_id) bsw@1045: end bsw@276: bsw/jbe@1309: ui.grid{ content = function() bsw/jbe@1309: ui.cell_main{ content = function() bsw@276: bsw/jbe@1309: execute.view{ module = "index", view = "_sidebar_motd_public" } bsw/jbe@1309: bsw/jbe@1309: execute.view{ module = "issue", view = "_list" } bsw/jbe@1309: end } bsw@462: bsw/jbe@1309: ui.cell_sidebar{ content = function() bsw/jbe@1309: execute.view{ module = "index", view = "_sidebar_motd" } bsw/jbe@1309: if app.session.member then bsw/jbe@1309: execute.view{ module = "index", view = "_sidebar_notifications" } bsw/jbe@1309: end bsw/jbe@1309: if config.firstlife then bsw/jbe@1309: ui.container{ attr = { class = "map mdl-special-card mdl-shadow--2dp pos-before-main" }, content = function() bsw/jbe@1309: ui.tag{ tag = "iframe", attr = { src = config.firstlife.areaviewer_url .. "?" .. config.firstlife.coordinates .. "&domain=" .. request.get_absolute_baseurl(), class = "map" }, content = "" } bsw/jbe@1309: end } bsw/jbe@1309: end bsw/jbe@1309: if config.map then bsw/jbe@1309: local initiatives = Initiative:new_selector():exec() bsw/jbe@1309: local geo_objects = {} bsw/jbe@1309: for i, initiative in ipairs(initiatives) do bsw/jbe@1309: if initiative.location and initiative.location.coordinates then bsw/jbe@1309: local geo_object = { bsw/jbe@1309: lon = initiative.location.coordinates[1], bsw/jbe@1309: lat = initiative.location.coordinates[2], bsw/jbe@1309: label = "i" .. initiative.id, bsw/jbe@1309: description = slot.use_temporary(function() bsw/jbe@1309: ui.link{ module = "initiative", view = "show", id = initiative.id, text = initiative.display_name } bsw/jbe@1309: end), bsw/jbe@1309: type = "initiative" bsw/jbe@1309: } bsw/jbe@1309: table.insert(geo_objects, geo_object) bsw/jbe@1309: end bsw/jbe@1309: end bsw/jbe@1309: if ontomap_get_instances then bsw/jbe@1309: local instances = ontomap_get_instances() bsw/jbe@1309: for i, instance in ipairs(instances) do bsw/jbe@1309: table.insert(geo_objects, instance) bsw/jbe@1309: end bsw/jbe@1309: end bsw/jbe@1309: ui.container{ attr = { class = "map mdl-special-card mdl-shadow--2dp pos-before-main" }, content = function() bsw/jbe@1309: ui.map(geo_objects) bsw/jbe@1309: end } bsw/jbe@1309: end bsw/jbe@1309: if config.logo then bsw/jbe@1309: config.logo() bsw/jbe@1309: end bsw/jbe@1309: if area then bsw/jbe@1309: execute.view{ module = "area", view = "_sidebar_whatcanido", params = { area = area } } bsw/jbe@1309: elseif unit then bsw/jbe@1309: execute.view{ module = "unit", view = "_sidebar_whatcanido", params = { unit = unit } } bsw/jbe@1309: else bsw/jbe@1309: execute.view{ module = "index", view = "_sidebar_whatcanido" } bsw/jbe@1309: end bsw/jbe@1309: bsw/jbe@1309: execute.view { module = "index", view = "_sidebar_members" } bsw/jbe@1309: bsw/jbe@1309: end } bsw/jbe@1309: end } bsw@1045: