liquid_feedback_frontend
changeset 1489:3ab878ba277e
Accessibility improvements part 1
author | bsw |
---|---|
date | Mon Feb 18 19:46:36 2019 +0100 (2019-02-18) |
parents | ce812dccaac2 |
children | 63ce1a5c05c1 |
files | app/main/_filter_view/30_navigation.lua app/main/_layout/default.html app/main/delegation/_info.lua app/main/draft/diff.lua app/main/index/_head.lua app/main/initiative/history.lua app/main/issue/_filters.lua app/main/issue/_list.lua app/main/member/edit.lua env/ui/filters.lua |
line diff
1.1 --- a/app/main/_filter_view/30_navigation.lua Mon Jan 07 19:16:30 2019 +0100 1.2 +++ b/app/main/_filter_view/30_navigation.lua Mon Feb 18 19:46:36 2019 +0100 1.3 @@ -67,7 +67,7 @@ 1.4 ui.tag{ tag = "nav", attr = { class = "mdl-navigation" }, content = function() 1.5 local link = { 1.6 content = function() 1.7 - ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "exit_to_app" } 1.8 + ui.tag{ tag = "i", attr = { class = "material-icons", ["aria-hidden"] = "true", role="presentation" }, content = "exit_to_app" } 1.9 slot.put(" ") 1.10 ui.tag{ attr = { class = "mdl-layout--large-screen-only" }, content = function() 1.11 ui.tag{ content = _"Login" }
2.1 --- a/app/main/_layout/default.html Mon Jan 07 19:16:30 2019 +0100 2.2 +++ b/app/main/_layout/default.html Mon Feb 18 19:46:36 2019 +0100 2.3 @@ -605,6 +605,10 @@ 2.4 margin-bottom: 2ex; 2.5 } 2.6 2.7 + .contextlinks { 2.8 + font-size: 14px; 2.9 + margin-bottom: 5px; 2.10 + } 2.11 2.12 /************************************************************************* 2.13 * Voting
3.1 --- a/app/main/delegation/_info.lua Mon Jan 07 19:16:30 2019 +0100 3.2 +++ b/app/main/delegation/_info.lua Mon Feb 18 19:46:36 2019 +0100 3.3 @@ -188,9 +188,10 @@ 3.4 slot.put(" ") 3.5 ui.tag{ content = _"you are interested" } 3.6 if not issue.closed and info.own_participation and info.weight and info.weight > 1 then 3.7 + slot.put(" ") 3.8 ui.link { 3.9 attr = { class = "right" }, content = "+" .. (info.weight - 1), 3.10 - module = "delegation", view = "show_incoming", params = { 3.11 + module = "interest", view = "show_incoming", params = { 3.12 issue_id = issue.id, member_id = member.id 3.13 } 3.14 }
4.1 --- a/app/main/draft/diff.lua Mon Jan 07 19:16:30 2019 +0100 4.2 +++ b/app/main/draft/diff.lua Mon Feb 18 19:46:36 2019 +0100 4.3 @@ -11,9 +11,7 @@ 4.4 ui.tag{ content = _"Please choose two different versions of the draft to compare" } 4.5 end ) 4.6 request.redirect{ 4.7 - module = "draft", view = "list", params = { 4.8 - initiative_id = initiative_id 4.9 - } 4.10 + module = "initiative", view = "history", id = initiative_id 4.11 } 4.12 return 4.13 end
5.1 --- a/app/main/index/_head.lua Mon Jan 07 19:16:30 2019 +0100 5.2 +++ b/app/main/index/_head.lua Mon Feb 18 19:46:36 2019 +0100 5.3 @@ -138,5 +138,12 @@ 5.4 --ui.container{ attr = { class = "mdl-card__actions mdl-card--border" }, content = function() 5.5 --end } 5.6 end } 5.7 +else 5.8 + ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function() 5.9 + ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() 5.10 + ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"All issues" } 5.11 + end } 5.12 + ui.container{ attr = { class = "mdl-card__supporting-text mdl-card--border" }, content = _"All issues in your units. Use filters above to limit results." } 5.13 + end } 5.14 end 5.15
6.1 --- a/app/main/initiative/history.lua Mon Jan 07 19:16:30 2019 +0100 6.2 +++ b/app/main/initiative/history.lua Mon Feb 18 19:46:36 2019 +0100 6.3 @@ -37,27 +37,29 @@ 6.4 6.5 local columns = { 6.6 { 6.7 - label = _"draft ID", 6.8 content = function(record) 6.9 - ui.tag { content = record.id } 6.10 - end 6.11 - }, 6.12 - { 6.13 - label = _"published at", 6.14 - content = function(record) 6.15 + slot.put('<label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="old_draft_id_' .. record.id .. '"><input type="radio" class="mdl-radio__button" id="old_draft_id_' .. record.id .. '" name="old_draft_id" value="' .. tostring(record.id) .. '">') 6.16 + ui.tag { content = "compare" } 6.17 + slot.put(" ") 6.18 ui.link{ 6.19 attr = { class = "action" }, 6.20 module = "draft", view = "show", id = record.id, 6.21 text = format.timestamp(record.created) 6.22 } 6.23 + slot.put("</label>") 6.24 end 6.25 }, 6.26 { 6.27 - label = _"compare", 6.28 content = function(record) 6.29 - slot.put('<label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="old_draft_id_' .. record.id .. '"><input type="radio" class="mdl-radio__button" id="old_draft_id_' .. record.id .. '" name="old_draft_id" value="' .. tostring(record.id) .. '"></label>') 6.30 - slot.put('<label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="new_draft_id_' .. record.id .. '"><input type="radio" class="mdl-radio__button" id="new_draft_id_' .. record.id .. '" name="new_draft_id" value="' .. tostring(record.id) .. '"></label>') 6.31 - --lot.put('<input type="radio" name="new_draft_id" value="' .. tostring(record.id) .. '">') 6.32 + slot.put('<label class="mdl-radio mdl-js-radio mdl-js-ripple-effect" for="new_draft_id_' .. record.id .. '"><input type="radio" class="mdl-radio__button" id="new_draft_id_' .. record.id .. '" name="new_draft_id" value="' .. tostring(record.id) .. '">') 6.33 + ui.tag { content = _"with" } 6.34 + slot.put(" ") 6.35 + ui.link{ 6.36 + attr = { class = "action" }, 6.37 + module = "draft", view = "show", id = record.id, 6.38 + text = format.timestamp(record.created) 6.39 + } 6.40 + slot.put("</label>") 6.41 end 6.42 } 6.43 }
7.1 --- a/app/main/issue/_filters.lua Mon Jan 07 19:16:30 2019 +0100 7.2 +++ b/app/main/issue/_filters.lua Mon Feb 18 19:46:36 2019 +0100 7.3 @@ -114,7 +114,24 @@ 7.4 end 7.5 7.6 filters[#filters+1] = filter 7.7 - 7.8 + 7.9 +--[[ 7.10 + else 7.11 + 7.12 + local filter = { class = "filter_unit", name = "area", label = _"area" } 7.13 + 7.14 + filter[#filter+1] = { 7.15 + name = "all", 7.16 + label = _"all subject areas", 7.17 + selector_modifier = function() end 7.18 + } 7.19 + filter[#filter+1] = { 7.20 + name = "_dummy", 7.21 + label = _"Select unit first", 7.22 + selector_modifier = function(selector) end 7.23 + } 7.24 + filters[#filters+1] = filter 7.25 +--]] 7.26 end 7.27 7.28 if app.session.member_id then
8.1 --- a/app/main/issue/_list.lua Mon Jan 07 19:16:30 2019 +0100 8.2 +++ b/app/main/issue/_list.lua Mon Feb 18 19:46:36 2019 +0100 8.3 @@ -196,48 +196,33 @@ 8.4 8.5 if not for_issue and not for_initiative then 8.6 ui.container{ attr = { class = "mdl-card__title mdl-card--has-fab mdl-card--border" }, content = function() 8.7 - if not (config.single_unit_id and config.single_area_id) then 8.8 - if not config.single_unit_id then 8.9 - slot.put ( " " ) 8.10 - ui.link{ 8.11 - module = "index", view = "index", params = { unit = issue.area.unit_id }, 8.12 - attr = { class = "mdl-chip unit" }, content = function() 8.13 - ui.tag{ attr = { class = "mdl-chip__text" }, content = function() 8.14 - ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "flag" } 8.15 - slot.put(" ") 8.16 - ui.tag{ content = issue.area.unit.name } 8.17 - end } 8.18 - end 8.19 - } 8.20 + ui.container{ attr = { class = "contextlinks" }, content = function() 8.21 + if not (config.single_unit_id and config.single_area_id) then 8.22 + if not config.single_unit_id then 8.23 + slot.put ( " " ) 8.24 + ui.link{ 8.25 + module = "index", view = "index", params = { unit = issue.area.unit_id }, 8.26 + attr = { class = "unit" }, content = issue.area.unit.name 8.27 + } 8.28 + end 8.29 + if not config.single_area_id then 8.30 + slot.put(" » ") 8.31 + ui.link{ 8.32 + module = "index", view = "index", params = { unit = issue.area.unit_id, area = issue.area_id }, 8.33 + attr = { class = "area" }, content = issue.area.name 8.34 + } 8.35 + end 8.36 end 8.37 - if not config.single_area_id then 8.38 - slot.put(" ") 8.39 - ui.link{ 8.40 - module = "index", view = "index", params = { unit = issue.area.unit_id, area = issue.area_id }, 8.41 - attr = { class = "mdl-chip area" }, content = function() 8.42 - ui.tag{ attr = { class = "mdl-chip__text" }, content = function() 8.43 - ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "folder" } 8.44 - slot.put(" ") 8.45 - ui.tag{ content = issue.area.name } 8.46 - end} 8.47 - end 8.48 - } 8.49 - end 8.50 - end 8.51 - --ui.heading{ level = 2, attr = { class = "mdl-card__title-text", style = "display: block;" }, content = function() 8.52 - slot.put(" ") 8.53 + slot.put(" » ") 8.54 ui.link{ 8.55 module = "issue", view = "show", id = issue.id, 8.56 - attr = { class = "mdl-chip issue" }, content = function() 8.57 - ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "label" } 8.58 - slot.put(" ") 8.59 - ui.tag{ attr = { class = "mdl-chip__text" }, content = issue.name } 8.60 - end } 8.61 - --end } 8.62 + attr = { class = "issue" }, content = issue.name 8.63 + } 8.64 + end } 8.65 ui.container{ attr = { class = "mdl-card__subtitle-text .mdl-cell--hide-phone" }, content = function() 8.66 ui.container{ attr = { class = class }, content = function () 8.67 if event_icon then 8.68 - ui.tag{ tag = "i", attr = { class = "material-icons" }, content = event_icon } 8.69 + ui.tag{ tag = "i", attr = { class = "material-icons", ["aria-hidden"] = "true" }, content = event_icon } 8.70 end 8.71 slot.put(" ") 8.72 ui.tag { content = event_name } 8.73 @@ -419,6 +404,8 @@ 8.74 8.75 filters.class = "mdl-special-card mdl-card__fullwidth mdl-shadow--2dp" 8.76 8.77 +filters.legend = _"Filter issues:" 8.78 + 8.79 ui.filters(filters) 8.80 8.81
9.1 --- a/app/main/member/edit.lua Mon Jan 07 19:16:30 2019 +0100 9.2 +++ b/app/main/member/edit.lua Mon Feb 18 19:46:36 2019 +0100 9.3 @@ -25,7 +25,7 @@ 9.4 }, 9.5 content = function() 9.6 9.7 - ui.container{ content = _"All fields are optional. Please enter only data which should be published." } 9.8 +-- ui.container{ content = _"All fields are optional. Please enter only data which should be published." } 9.9 9.10 if config.member_profile_fields then 9.11 for i, field in ipairs(config.member_profile_fields) do
10.1 --- a/env/ui/filters.lua Mon Jan 07 19:16:30 2019 +0100 10.2 +++ b/env/ui/filters.lua Mon Feb 18 19:46:36 2019 +0100 10.3 @@ -5,9 +5,14 @@ 10.4 if args.class then 10.5 class = class .. " " .. args.class 10.6 end 10.7 - ui.container{ 10.8 + ui.tag{ 10.9 + tag = "fieldset", 10.10 attr = { class = { class } }, 10.11 content = function() 10.12 + local legend = args.legend 10.13 + if legend then 10.14 + ui.tag{ tag = "legend", attr = { style = "display: none;" }, content = legend } 10.15 + end 10.16 for idx, filter in ipairs(args) do 10.17 local filter_name = filter.name or "filter" 10.18 local current_option_name = atom.string:load(request.get_param{ name = filter_name }) 10.19 @@ -26,7 +31,7 @@ 10.20 ui.tag{ tag = "button", attr = { id = "filter-" .. filter_name .. "-menu", class = "mdl-button mdl-js-button" }, content = function() 10.21 ui.tag{ content = current_option.label } 10.22 slot.put(" ") 10.23 - ui.tag{ tag = "i", attr = { class = "material-icons" }, content = "arrow_drop_down" } 10.24 + ui.tag{ tag = "i", attr = { class = "material-icons", ["aria-hidden"] = "true" }, content = "arrow_drop_down" } 10.25 end } 10.26 local id = request.get_id_string() 10.27 local params = request.get_param_strings()