Skip to content

Commit

Permalink
Add headings
Browse files Browse the repository at this point in the history
  • Loading branch information
carlobeltrame committed Jul 28, 2024
1 parent 6f0cd71 commit 0c2f46c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/Models/EvaluationGridRowTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
class EvaluationGridRowTemplate extends Model {

const CONTROL_TYPES = ['slider', 'radiobuttons', 'checkbox'];
const CONTROL_TYPES = ['slider', 'radiobuttons', 'checkbox', 'heading'];

/**
* The table associated with the model.
Expand Down
1 change: 1 addition & 0 deletions lang/de/t.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"checkbox" => "Checkbox",
"radiobuttons" => "➖ / ➕ / ✨",
"slider" => "Skala von 1 - 10",
"heading" => "Zwischentitel",
),
"criterion" => "Kriterium",
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<template>
<div>
<template v-for="(rowTemplate, index) in rowTemplates">
<h5 v-if="rowTemplate.type === 'heading'">{{ rowTemplate.criterion }}</h5>
<input-evaluation-grid-row
v-else
:name="`${name}[${index}]`"
:index="index"
:row-template="rowTemplate"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ function EvaluationGridRow({rowTemplate, rows, t}) {
if (!rowTemplate) return <View/>
const row = rows ? rows.find(row => row.evaluation_grid_row_template_id === rowTemplate.id) : null

if (rowTemplate.control_type === 'heading') {
return <View style={{ ...styles.evaluationGridRow, fontWeight: '700', padding: '2mm 1.5mm 1mm' }}><Text>{ fixNewlines(rowTemplate.criterion) }</Text></View>
}

return <View style={styles.evaluationGridRow} wrap={false}>
<View style={styles.evaluationGridRowCriterion}><Text>{fixNewlines(rowTemplate.criterion)}</Text></View>
<View style={styles.evaluationGridRowValue}>
Expand Down

0 comments on commit 0c2f46c

Please sign in to comment.