OpenSlides/openslides/assignments/config_variables.py
Sean Engelhardt 84a39ccb62 More voting UI improvements
For Motion poll:
- Overworked how motion poll chart displays the legend
- Added the vote counter to the motion detail
- Added a progress bar to the vote counter
- Fixed some perm errors with the chart
- Show a "Singe Votes" link as button for published named polls
- Replace the edit-button with a dot-menu
  - Having project, Edit, PDF and Delete

For Motion Poll detail:
- enhance search panel
- Remove the breadcrumbs
- Remove the vote counter
- Enhanced the single-vote grid, table and filter bar
- Enhance how the poll state enum was checkend

For the Motion Poll Create/Update Form:
- Remove the selection of poll-methode (whenever possible)
- only show "publish imediately" during creation
2020-03-17 07:24:40 +01:00

71 lines
2.1 KiB
Python

from openslides.assignments.models import AssignmentPoll
from openslides.core.config import ConfigVariable
def get_config_variables():
"""
Generator which yields all config variables of this app.
They are grouped in 'Ballot and ballot papers' and 'PDF'. The generator has
to be evaluated during app loading (see apps.py).
"""
# Voting
yield ConfigVariable(
name="assignment_poll_default_100_percent_base",
default_value="YNA",
input_type="choice",
label="The 100-%-base of an election result consists of",
choices=tuple(
{"value": base[0], "display_name": base[1]}
for base in AssignmentPoll.PERCENT_BASES
),
weight=400,
group="Voting",
subgroup="Elections",
)
yield ConfigVariable(
name="assignment_poll_default_majority_method",
default_value="simple",
input_type="choice",
choices=tuple(
{"value": method[0], "display_name": method[1]}
for method in AssignmentPoll.MAJORITY_METHODS
),
label="Required majority",
help_text="Default method to check whether a candidate has reached the required majority.",
weight=405,
hidden=True,
group="Voting",
subgroup="Elections",
)
yield ConfigVariable(
name="assignment_poll_add_candidates_to_list_of_speakers",
default_value=True,
input_type="boolean",
label="Put all candidates on the list of speakers",
weight=410,
group="Voting",
subgroup="Elections",
)
# PDF
yield ConfigVariable(
name="assignments_pdf_title",
default_value="Elections",
label="Title for PDF document (all elections)",
weight=460,
group="Elections",
subgroup="PDF export",
)
yield ConfigVariable(
name="assignments_pdf_preamble",
default_value="",
label="Preamble text for PDF document (all elections)",
weight=470,
group="Elections",
subgroup="PDF export",
)