mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Basic code for an object group select item thing.
This commit is contained in:
@@ -436,4 +436,33 @@ class ExpandedForm
|
|||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param null $value
|
||||||
|
* @param array|null $options
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function objectGroup($value = null, array $options = null): string
|
||||||
|
{
|
||||||
|
$name = 'object_group';
|
||||||
|
$label = $this->label($name, $options);
|
||||||
|
$options = $this->expandOptionArray($name, $label, $options);
|
||||||
|
$classes = $this->getHolderClasses($name);
|
||||||
|
$value = $this->fillFieldValue($name, $value);
|
||||||
|
$options['rows'] = 4;
|
||||||
|
|
||||||
|
if (null === $value) {
|
||||||
|
$value = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$html = view('form.object_group', compact('classes', 'name', 'label', 'value', 'options'))->render();
|
||||||
|
} catch (Throwable $e) {
|
||||||
|
Log::debug(sprintf('Could not render objectGroup(): %s', $e->getMessage()));
|
||||||
|
$html = 'Could not render objectGroup.';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $html;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -38,6 +38,7 @@ return [
|
|||||||
'match' => 'Matches on',
|
'match' => 'Matches on',
|
||||||
'strict' => 'Strict mode',
|
'strict' => 'Strict mode',
|
||||||
'repeat_freq' => 'Repeats',
|
'repeat_freq' => 'Repeats',
|
||||||
|
'object_group' => 'Group',
|
||||||
'location' => 'Location',
|
'location' => 'Location',
|
||||||
'update_channel' => 'Update channel',
|
'update_channel' => 'Update channel',
|
||||||
'currency_id' => 'Currency',
|
'currency_id' => 'Currency',
|
||||||
|
9
resources/views/v1/form/object_group.twig
Normal file
9
resources/views/v1/form/object_group.twig
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<div class="{{ classes }}" id="{{ name }}_holder">
|
||||||
|
<label for="{{ options.id }}" class="col-sm-4 control-label">{{ label }}</label>
|
||||||
|
|
||||||
|
<div class="col-sm-8">
|
||||||
|
{{ Form.input('text', name, value, options) }}
|
||||||
|
{% include 'form/help' %}
|
||||||
|
{% include 'form/feedback' %}
|
||||||
|
</div>
|
||||||
|
</div>
|
Reference in New Issue
Block a user