# HG changeset patch # User bsw # Date 1634563897 -7200 # Node ID 0f04f8c2a469730158f63e3889487b90e4403fc9 # Parent 048d6bae28551a2a313663e5f0bbdb6341446d74 Removed unused views diff -r 048d6bae2855 -r 0f04f8c2a469 app/main/area/_list_entry.lua --- a/app/main/area/_list_entry.lua Mon Oct 18 11:10:31 2021 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -local area = param.get("area", "table") -local member = param.get("member", "table") - -ui.container{ attr = { class = "area" }, content = function() - - execute.view{ module = "area", view = "_head", params = { area = area, hide_unit = true, show_content = true, member = member } } - - ui.container{ attr = { class = "content" }, content = function() - ui.tag{ content = _"Issues:" } - slot.put(" ") - ui.link{ - module = "area", view = "show", id = area.id, params = { tab = "open", filter = "new" }, - text = _("#{count} new", { count = area.issues_new_count }) - } - slot.put(" · ") - ui.link{ - module = "area", view = "show", id = area.id, params = { tab = "open", filter = "accepted" }, - text = _("#{count} in discussion", { count = area.issues_discussion_count }) - } - slot.put(" · ") - ui.link{ - module = "area", view = "show", id = area.id, params = { tab = "open", filter = "half_frozen" }, - text = _("#{count} in verification", { count = area.issues_frozen_count }) - } - slot.put(" · ") - ui.link{ - module = "area", view = "show", id = area.id, params = { tab = "open", filter = "frozen" }, - text = _("#{count} in voting", { count = area.issues_voting_count }) - } - slot.put(" · ") - ui.link{ - module = "area", view = "show", id = area.id, params = { tab = "closed", filter = "finished" }, - text = _("#{count} finished", { count = area.issues_finished_count }) - } - slot.put(" · ") - ui.link{ - module = "area", view = "show", id = area.id, params = { tab = "closed", filter = "canceled" }, - text = _("#{count} canceled", { count = area.issues_canceled_count }) - } - end } - -end } diff -r 048d6bae2855 -r 0f04f8c2a469 app/main/contact/list.lua --- a/app/main/contact/list.lua Mon Oct 18 11:10:31 2021 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -local contacts_selector = Contact:build_selector{ - member_id = app.session.member_id, - order = "name" -} - -ui.title(_"Contacts") - -ui.grid{ content = function() - ui.cell_main{ content = function() - - ui.container{ attr = { class = "mdl-card mdl-card__fullwidth mdl-shadow--2dp" }, content = function() - ui.container{ attr = { class = "mdl-card__title mdl-card--border" }, content = function() - ui.heading { attr = { class = "mdl-card__title-text" }, level = 2, content = _"Contacts" } - end } - ui.container{ attr = { class = "mdl-card__content mdl-card--border" }, content = function() - - - ui.paginate{ - selector = contacts_selector, - content = function() - local contacts = contacts_selector:exec() - if #contacts == 0 then - ui.field.text{ value = _"You didn't save any member as contact yet." } - else - ui.list{ - attr = { class = "mdl-data-table mdl-js-data-table mdl-shadow--2dp" }, - records = contacts, - columns = { - { - label = _"Name", - content = function(record) - ui.link{ - text = record.other_member.name, - module = "member", - view = "show", - id = record.other_member_id - } - end - }, - { - label = _"Published", - content = function(record) - ui.field.boolean{ value = record.public } - end - }, - { - content = function(record) - if record.public then - ui.link{ - attr = { class = "action" }, - text = _"Hide", - module = "contact", - action = "add_member", - id = record.other_member_id, - params = { public = false }, - routing = { - default = { - mode = "redirect", - module = request.get_module(), - view = request.get_view(), - id = request.get_id_string(), - params = request.get_param_strings() - } - } - } - else - ui.link{ - attr = { class = "action" }, - text = _"Publish", - module = "contact", - action = "add_member", - id = record.other_member_id, - params = { public = true }, - routing = { - default = { - mode = "redirect", - module = request.get_module(), - view = request.get_view(), - id = request.get_id_string(), - params = request.get_param_strings() - } - } - } - end - end - }, - { - content = function(record) - ui.link{ - attr = { class = "action" }, - text = _"Remove", - module = "contact", - action = "remove_member", - id = record.other_member_id, - routing = { - default = { - mode = "redirect", - module = request.get_module(), - view = request.get_view(), - id = request.get_id_string(), - params = request.get_param_strings() - } - } - } - end - }, - } - } - end - end - } - - end } - end } - end } -end } diff -r 048d6bae2855 -r 0f04f8c2a469 app/main/index/_not_voted_issues.lua --- a/app/main/index/_not_voted_issues.lua Mon Oct 18 11:10:31 2021 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -local areas = param.get("areas", "table") - -if #areas > 0 then - ui.container{ - attr = { style = "font-weight: bold;" }, - content = _"Current votings in areas you are member of and issues you are interested in:" - } - - ui.list{ - records = areas, - columns = { - { - name = "name" - }, - { - content = function(record) - if record.is_member and record.issues_to_vote_count > 0 then - ui.link{ - content = function() - if record.issues_to_vote_count > 1 then - slot.put(_("#{issues_to_vote_count} issue(s)", { issues_to_vote_count = record.issues_to_vote_count })) - else - slot.put(_("One issue")) - end - end, - module = "area", - view = "show", - id = record.id, - params = { - tab = "open", - filter = "frozen", - filter_interest = "any", - filter_voting = "not_voted" - } - } - else - slot.put(_"Not a member") - end - end - }, - { - content = function(record) - if record.interested_issues_to_vote_count > 0 then - ui.link{ - content = function() - if record.interested_issues_to_vote_count > 1 then - slot.put(_("#{interested_issues_to_vote_count} issue(s) you are interested in", { interested_issues_to_vote_count = record.interested_issues_to_vote_count })) - else - slot.put(_"One issue you are interested in") - end - end, - module = "area", - view = "show", - id = record.id, - params = { - tab = "open", - filter = "frozen", - filter_interest = "issue", - filter_voting = "not_voted" - } - } - end - end - }, - } - } -end diff -r 048d6bae2855 -r 0f04f8c2a469 app/main/initiative/_sidebar_wikisyntax.lua --- a/app/main/initiative/_sidebar_wikisyntax.lua Mon Oct 18 11:10:31 2021 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -if config.enforce_formatting_engine ~= 'markdown2' then - return -end - -ui.sidebar( "tab-whatcanido", function() - ui.sidebarHead( function() - ui.heading { level = 2, content = _"Formatting help" } - end ) - ui.sidebarSection( function () - ui.heading { level = 3, content = _"Paragraphs" } - ui.tag { tag = "ul", attr = { class = "ul" }, content = function () - ui.tag { tag = "li", content = function () - ui.tag { content = _"Separate each paragraph with at least one blank line" } - end } - end } - - ui.heading { level = 3, content = _"Headlines" } - ui.tag { tag = "ul", attr = { class = "ul" }, content = function () - ui.tag { tag = "li", content = function () - ui.tag { content = _"Underline main headlines with ===" } - end } - ui.tag { tag = "li", content = function () - ui.tag { content = _"Underline sub headlines with ---" } - end } - end } - - ui.heading { level = 3, content = _"Emphasis" } - ui.tag { tag = "ul", attr = { class = "ul" }, content = function () - ui.tag { tag = "li", content = function () - ui.tag { content = _"Put *asterisks* or around a phrase to make it italic" } - end } - ui.tag { tag = "li", content = function () - ui.tag { content = _"Put **double asterisks** around a phrase to make it bold" } - end } - end } - - ui.heading { level = 3, content = _"Lists" } - ui.tag { tag = "ul", attr = { class = "ul" }, content = function () - ui.tag { tag = "li", content = function () - ui.tag { content = _"Lists must be preceeded and followed by at least one blank line" } - end } - ui.tag { tag = "li", content = function () - ui.tag { content = _"Put a hypen (-) or asterisk (*) followed by a space in front of each item" } - end } - ui.tag { tag = "li", content = function () - ui.tag { content = _"For numbered items use a digit (e.g. 1) followed by a dot (.) and a space" } - end } - ui.tag { tag = "li", content = function () - ui.tag { content = _"Indent sub items with spaces" } - end } - end } - - ui.heading { level = 3, content = _"Links" } - ui.tag { tag = "ul", attr = { class = "ul" }, content = function () - ui.tag { tag = "li", content = function () - ui.tag { content = _"Use [Text](http://example.com/) for links" } - end } - end } - - end ) -end ) diff -r 048d6bae2855 -r 0f04f8c2a469 app/main/slideshow/_index.lua --- a/app/main/slideshow/_index.lua Mon Oct 18 11:10:31 2021 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -local unit = param.get( "unit", "table" ) -local area = param.get( "area", "table" ) - -local args = { - unit_id = unit and unit.id or nil, - area_id = area and area.id or nil -} - -local lastWinner = Initiative:getLastWinner( args ) -local lastLooser = Initiative:getLastLoser( args ) -local nextEndingVoting = Initiative:getNextEndingVoting( args ) -local nextEndingVerification = Initiative:getNextEndingVerification( args ) -local nextEndingDiscussion = Initiative:getNextEndingDiscussion( args ) -local bestInAdmission = Initiative:getBestInAdmission( args ) - -local slides = { } - -if lastWinner then - slides[#slides+1] = { - title = _"Latest approved issue", - initiative = lastWinner - } -end - -if lastLooser then - slides[#slides+1] = { - title = _"Latest disapproved issue", - initiative = lastLooser - } -end - -if nextEndingVoting then - slides[#slides+1] = { - title = _("Voting #{time_info}", { time_info = nextEndingVoting.issue.state_time_text }), - initiative = nextEndingVoting - } -end - -if nextEndingVerification then - slides[#slides+1] = { - title = _("Verification #{time_info}", { time_info = nextEndingVerification.issue.state_time_text }), - initiative = nextEndingVerification - } -end - -if nextEndingDiscussion then - slides[#slides+1] = { - title = _("Discussion #{time_info}", { time_info = nextEndingDiscussion.issue.state_time_text }), - initiative = nextEndingDiscussion - } -end - -if bestInAdmission then - slides[#slides+1] = { - title = _"Best not admitted initiative", - initiative = bestInAdmission - } -end - -execute.view { - module = "slideshow", view = "_slideshow", params = { - slides = slides - } -} diff -r 048d6bae2855 -r 0f04f8c2a469 app/main/slideshow/_slideshow.lua --- a/app/main/slideshow/_slideshow.lua Mon Oct 18 11:10:31 2021 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -local slides = param.get( "slides", "table" ) - -local show_slides = {} - -for i, slide in ipairs( slides ) do - - if slide.initiative then - show_slides[ #show_slides + 1 ] = slide - end - -end - -slot.select( "slideshow", function () - - ui.container { attr = { class = "slideshow" }, content = function () - - for i, slide in ipairs( show_slides ) do - - if slide.initiative.issue.closed then - view = "finished" - elseif slide.initiative.issue.fully_frozen then - view = "voting" - elseif slide.initiative.issue.half_frozen then - view = "verification" - elseif slide.initiative.issue.admitted then - view = "discussion" - else - view = "admission" - end - - ui.container { attr = { class = "slide slide-" .. i }, content = function () - - if slide.initiative.issue.closed then - util.initiative_pie(slide.initiative, 150) - end - - ui.container { - attr = { class = "slideshowTitle" }, - content = slide.title - } - - execute.view { - module = "initiative", view = "_list_element", params = { - initiative = slide.initiative - } - } - - end } - - end - - - end } - -end ) - -ui.script{ script = [[ - -var slideshowCurrent = 0; -var slideshowCount = ]] .. #show_slides .. [[ ; -function slideshowShowSlide(i) { - $(".slideshow .slide").slideUp(); - $(".slideshow .slide-" + i).slideDown(); - slideshowCurrent = i; -} - -function slideshowShowNext() { - var next = slideshowCurrent + 1; - if (next > slideshowCount) { - next = 1; - } - slideshowShowSlide(next); - window.setTimeout(slideshowShowNext, 7500); -} - -slideshowShowNext(); - - - ]]} \ No newline at end of file diff -r 048d6bae2855 -r 0f04f8c2a469 app/main/slideshow/index.lua --- a/app/main/slideshow/index.lua Mon Oct 18 11:10:31 2021 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -local unit = param.get( "unit", "table" ) -local area = param.get( "area", "table" ) - -local args = { - unit_id = unit and unit.id or nil, - area_id = area and area.id or nil -} - -local issues = Issue:new_selector():exec() - - -local slides = {} - -for i, issue in ipairs( issues ) do - slides[ #slides+1 ] = { - title = issue.state_name, - initiative = issue.initiatives[1] - } -end - - -execute.view { - module = "slideshow", view = "_slideshow", params = { - slides = slides - } -} \ No newline at end of file diff -r 048d6bae2855 -r 0f04f8c2a469 app/main/suggestion/_list.lua --- a/app/main/suggestion/_list.lua Mon Oct 18 11:10:31 2021 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ - -local initiative = param.get("initiative", "table") -local suggestions_selector = param.get("suggestions_selector", "table") - -suggestions_selector:add_order_by("proportional_order NULLS LAST, plus2_unfulfilled_count + plus1_unfulfilled_count DESC, id") - -local ui_filters = ui.filters -if true or not show_filter then - ui_filters = function(args) args.content() end -end - -ui.container{ attr = { class = "initiative_head" }, - content = function() - ui.tag{ tag = "a", attr = { class = "title", name = "suggestions" }, content = _"Suggestions" } - ui.container{ attr = { class = "content" }, content = function() - ui.paginate{ - selector = suggestions_selector, - anchor = "suggestions", - content = function() - local suggestions = suggestions_selector:exec() - if #suggestions < 1 then - if not initiative.issue.fully_frozen and not initiative.issue.closed then - ui.tag{ content = _"No suggestions yet" } - else - ui.tag{ content = _"No suggestions" } - end - else - ui.list{ - attr = { style = "table-layout: fixed;" }, - records = suggestions, - columns = { - { - label_attr = { style = "width: 101px;" }, - content = function(record) - if record.minus2_unfulfilled_count then - local max_value = record.initiative.supporter_count - ui.bargraph{ - max_value = max_value, - width = 100, - bars = { - { color = "#0a0", value = record.plus2_unfulfilled_count + record.plus2_fulfilled_count }, - { color = "#8f8", value = record.plus1_unfulfilled_count + record.plus1_fulfilled_count }, - { color = "#eee", value = max_value - record.minus2_unfulfilled_count - record.minus1_unfulfilled_count - record.minus2_fulfilled_count - record.minus1_fulfilled_count - record.plus1_unfulfilled_count - record.plus2_unfulfilled_count - record.plus1_fulfilled_count - record.plus2_fulfilled_count}, - { color = "#f88", value = record.minus1_unfulfilled_count + record.minus1_fulfilled_count }, - { color = "#a00", value = record.minus2_unfulfilled_count + record.minus2_fulfilled_count }, - } - } - end - end - }, - { - content = function(record) - ui.link{ - text = record.name, - module = "suggestion", - view = "show", - id = record.id - } - local degree - local opinion - if app.session.member_id then - opinion = Opinion:by_pk(app.session.member.id, record.id) - end - if opinion then - local degrees = { - ["-2"] = _"must not", - ["-1"] = _"should not", - ["0"] = _"neutral", - ["1"] = _"should", - ["2"] = _"must" - } - slot.put(" · ") - ui.tag{ content = degrees[tostring(opinion.degree)] } - slot.put(" · ") - if opinion.fulfilled then - ui.tag{ content = _"implemented" } - else - ui.tag{ content = _"not implemented" } - end - end - end - }, - } - } - end - end - } - end } - if app.session.member_id - and not initiative.issue.half_frozen - and not initiative.issue.closed - and not initiative.revoked - and app.session.member:has_voting_right_for_unit_id(initiative.issue.area.unit_id) - then - ui.container{ attr = { class = "content" }, content = function() - ui.link{ - module = "suggestion", view = "new", params = { initiative_id = initiative.id }, - text = _"New suggestion" - } - end } - end - end -}