-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from apostrophecms/feature/stepper
Feature/stepper
- Loading branch information
Showing
11 changed files
with
85 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
module.exports = { | ||
extend: '@apostrophecms/widget-type', | ||
options: { | ||
label: 'aposForm:group', | ||
className: 'apos-form-group', | ||
icon: 'file-multiple-outline-icon' | ||
}, | ||
icons: { | ||
'file-multiple-outline-icon': 'FileMultipleOutline' | ||
}, | ||
fields (self) { | ||
// Prevent nested groups | ||
const form = self.options.apos.modules['@apostrophecms/form']; | ||
const { | ||
'@apostrophecms/form-group': groupWidget, | ||
...formWidgets | ||
} = form.fields.contents.options.widgets; | ||
|
||
return { | ||
add: { | ||
groups: { | ||
label: 'aposForm:groupGroups', | ||
type: 'array', | ||
required: true, | ||
titleField: 'label', | ||
inline: true, | ||
fields: { | ||
add: { | ||
label: { | ||
label: 'aposForm:groupGroupsLabel', | ||
type: 'string', | ||
required: true | ||
}, | ||
contents: { | ||
label: 'aposForm:groupGroupsContents', | ||
help: 'aposForm:groupGroupsContentsHelp', | ||
type: 'area', | ||
contextual: false, | ||
options: { | ||
widgets: formWidgets | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
} | ||
}; |
13 changes: 13 additions & 0 deletions
13
modules/@apostrophecms/form-group-widget/views/widget.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{% set prependIfPrefix = apos.modules['@apostrophecms/form'].prependIfPrefix %} | ||
|
||
<div data-apos-form-groups class="apos-form-groups {{ prependIfPrefix('__groups') }}"> | ||
{% for group in data.widget.groups %} | ||
<fieldset | ||
class="apos-form-group {{ prependIfPrefix('__group') }}" | ||
data-index="{{ loop.index }}" | ||
> | ||
<legend>{{ group.label }}</legend> | ||
{% area group, 'contents' %} | ||
</fieldset> | ||
{% endfor %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters