Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -145,7 +145,7 @@ fields: List[Field] = [
|
|
145 |
Field(name="image_name", type="input_col", title=""),# "**Visualization of high contributing properties:**"),
|
146 |
|
147 |
Field(type="container", title="**Need for Moderation**", children=[
|
148 |
-
Field(name="to_moderate", type="
|
149 |
title="Do feel this comment/discussion would benefit from moderator intervention?", mandatory=True),
|
150 |
Field(name="actions_clear", type="select_slider",
|
151 |
title="With what level of **priority** would you need to interact with this comment?", other_params={'labels': priority_labels},
|
@@ -167,7 +167,7 @@ fields: List[Field] = [
|
|
167 |
]),
|
168 |
|
169 |
Field(type="container", title="**Moderator Assistance**", children=[
|
170 |
-
Field(name="helpful", type="
|
171 |
title="If this comment/discussion was flagged to you, would it be helpful in your task of moderation?", mandatory=True),
|
172 |
Field(name="mod_assistance", type="multiselect",
|
173 |
title="If yes, please motivate the benefit it would contribute to the task. *(Multiple selection possible)*",
|
@@ -185,9 +185,9 @@ INPUT_FIELD_DEFAULT_VALUES = {'slider': 0,
|
|
185 |
'checkbox': False,
|
186 |
'radio': None,
|
187 |
'select_slider': 0,
|
188 |
-
'multiselect':
|
189 |
-
'likert_radio': None
|
190 |
-
|
191 |
SHOW_HELP_ICON = False
|
192 |
SHOW_VALIDATION_ERROR_MESSAGE = True
|
193 |
|
@@ -339,13 +339,13 @@ def show_field(f: Field, index: int, data_collected):
|
|
339 |
format_func=lambda x: labels[x],
|
340 |
key=key,
|
341 |
index=value, help=f.help, horizontal=True)
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
case 'text':
|
350 |
st.text_input(f.title, key=key, value=value)
|
351 |
case 'textarea':
|
|
|
145 |
Field(name="image_name", type="input_col", title=""),# "**Visualization of high contributing properties:**"),
|
146 |
|
147 |
Field(type="container", title="**Need for Moderation**", children=[
|
148 |
+
Field(name="to_moderate", type="y_n_radio",
|
149 |
title="Do feel this comment/discussion would benefit from moderator intervention?", mandatory=True),
|
150 |
Field(name="actions_clear", type="select_slider",
|
151 |
title="With what level of **priority** would you need to interact with this comment?", other_params={'labels': priority_labels},
|
|
|
167 |
]),
|
168 |
|
169 |
Field(type="container", title="**Moderator Assistance**", children=[
|
170 |
+
Field(name="helpful", type="y_n_radio",
|
171 |
title="If this comment/discussion was flagged to you, would it be helpful in your task of moderation?", mandatory=True),
|
172 |
Field(name="mod_assistance", type="multiselect",
|
173 |
title="If yes, please motivate the benefit it would contribute to the task. *(Multiple selection possible)*",
|
|
|
185 |
'checkbox': False,
|
186 |
'radio': None,
|
187 |
'select_slider': 0,
|
188 |
+
'multiselect': None,
|
189 |
+
'likert_radio': None,
|
190 |
+
'y_n_radio': None}
|
191 |
SHOW_HELP_ICON = False
|
192 |
SHOW_VALIDATION_ERROR_MESSAGE = True
|
193 |
|
|
|
339 |
format_func=lambda x: labels[x],
|
340 |
key=key,
|
341 |
index=value, help=f.help, horizontal=True)
|
342 |
+
case 'y_n_radio':
|
343 |
+
labels = yes_no_labels if not f.other_params.get('labels') else f.other_params.get('labels')
|
344 |
+
st.radio(f.title,
|
345 |
+
options=[0, 1, 2],
|
346 |
+
format_func=lambda x: labels[x],
|
347 |
+
key=key,
|
348 |
+
index=value, help=f.help, horizontal=True)
|
349 |
case 'text':
|
350 |
st.text_input(f.title, key=key, value=value)
|
351 |
case 'textarea':
|