-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separating update into wizard and non wizard methods (#1713)
This continues work in preparation for #1684. Another step to moving the wizard into it's own controller
- Loading branch information
1 parent
8d22321
commit 767aa88
Showing
9 changed files
with
111 additions
and
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!-- This div holds the actual tabs content (displayed on the right) --> | ||
<div class="tab-content" id="v-pills-tabContent"> | ||
|
||
<!-- tab: required fields --> | ||
<div class="tab-pane fade show active" id="v-pills-required" role="tabpanel" aria-labelledby="v-pills-required-tab"> | ||
<%= form.hidden_field :work_id %> | ||
<%= render 'required_form' %> | ||
</div> | ||
|
||
<!-- tab: additional fields --> | ||
<div class="tab-pane fade" id="v-pills-additional" role="tabpanel" aria-labelledby="v-pills-additional-tab"> | ||
<%= render 'additional_form' %> | ||
</div> | ||
|
||
<!-- tab: curator controlled fields --> | ||
<div class="tab-pane fade" id="v-pills-curator-controlled" role="tabpanel" aria-labelledby="v-pills-curator-controlled-tab"> | ||
<%= render 'curator_controlled_form', is_group_admin: current_user.has_role?(:group_admin, @work.group) %> | ||
</div> | ||
|
||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<!-- This div holds the "tabs menu" section that we display on the left --> | ||
<div class="nav flex-column nav-pills me-3" id="v-pills-tab" role="tablist" aria-orientation="vertical"> | ||
<button class="nav-link active" id="v-pills-required-tab" data-bs-toggle="pill" data-bs-target="#v-pills-required" type="button" role="tab" aria-controls="v-pills-required" aria-selected="true">Required Metadata</button> | ||
<button class="nav-link btn btn-light" id="v-pills-additional-tab" data-bs-toggle="pill" data-bs-target="#v-pills-additional" type="button" role="tab" aria-controls="v-pills-additional" aria-selected="false">Additional Metadata</button> | ||
<button class="nav-link" id="v-pills-curator-controlled-tab" data-bs-toggle="pill" data-bs-target="#v-pills-curator-controlled" type="button" role="tab" aria-controls="v-pills-curator-controlled" aria-selected="false"><%= t('works.form.curator_controlled') %></button> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<%= render 'form_errors' %> | ||
|
||
<!-- | ||
Information about Bootstrap tabs | ||
https://getbootstrap.com/docs/5.0/components/navs-tabs/ | ||
https://getbootstrap.com/docs/5.0/components/navs-tabs/#javascript-behavior | ||
--> | ||
<div class="d-flex align-items-start"> | ||
|
||
<%= render 'form_nav' %> | ||
|
||
<div> | ||
<%= form_with(model: @work, url: update_work_wizard_path(@work), class: ["work-form"], data: { work: @work.form_attributes }) do |form| %> | ||
<%= render partial: 'form_metadata', locals: { form: form } %> | ||
|
||
<hr /> | ||
<div class="actions"> | ||
<%= link_to 'Cancel', @work, class: "btn btn-secondary" %> | ||
<% if @work.persisted? %> | ||
<%= form.submit "Save Work", class: "btn btn-primary wizard-next-button", id: "btn-submit" %> | ||
<% else %> | ||
<%= form.submit "Create", class: "btn btn-primary wizard-next-button", id: "btn-submit", name: "submit" %> | ||
<% end %> | ||
</div> | ||
|
||
<%= render 'form_hidden_fields' %> | ||
<% end %> | ||
</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<div class="wizard-area"> | ||
<h1>New Submission</h1> | ||
<%= render "wizard_progress", wizard_step: 1 %> | ||
<%= render 'form' %> | ||
<%= render 'form_wizard' %> | ||
</div> | ||
|
||
<%= javascript_include_tag 'edit_work_utils' %> |
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