Skip to content

Commit

Permalink
Move create collaborator form from Admin::FormAnswers#edit to Admin::…
Browse files Browse the repository at this point in the history
…Users#edit
  • Loading branch information
phil-l-brockwell committed Nov 26, 2024
1 parent 03e62ef commit aaf94da
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
.form-group
.form-container
label.form-label User accounts

= render "admin/form_answers/collaborators/list"

- if policy(resource).can_add_collaborators_to_application?
= render "admin/form_answers/collaborators/form"
2 changes: 2 additions & 0 deletions app/views/admin/users/_fields_collaborators.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
br
p.p-empty This user has not added any collaborators.
br

= render "admin/form_answers/collaborators/form", resource: resource
10 changes: 0 additions & 10 deletions app/views/admin/users/_form.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@
.panel-body
= render "fields_contact_preferences", f: f

- unless action_name == "new"
.panel.panel-default[data-controller="element-focus"]
.panel-heading id="section-collaborators-header"
h2.panel-title
a.collapsed data-toggle="collapse" data-parent="#user-form-panel" href="#section-collaborators" aria-expanded="false" aria-controls="section-collaborators" data-element-focus-target="reveal"
' Collaborators
#section-collaborators.section-collaborators.panel-collapse.collapse[aria-labelledby="section-collaborators-header" data-element-scroll-target="accordion"]
.panel-body
= render "fields_collaborators", f: f, resource: resource

br
.clearfix
.pull-right
Expand Down
9 changes: 9 additions & 0 deletions app/views/admin/users/edit.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,12 @@
= "Edit #{controller_name == "users" ? "applicant" : controller_name.singularize}"

= render 'form', resource: @resource

.panel.panel-default[data-controller="element-focus"]
.panel-heading id="section-collaborators-header"
h2.panel-title
a.collapsed data-toggle="collapse" data-parent="#user-form-panel" href="#section-collaborators" aria-expanded="false" aria-controls="section-collaborators" data-element-focus-target="reveal"
' Collaborators
#section-collaborators.section-collaborators.panel-collapse.collapse[aria-labelledby="section-collaborators-header" data-element-scroll-target="accordion"]
.panel-body
= render "fields_collaborators", resource: @resource

0 comments on commit aaf94da

Please sign in to comment.