-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nicer layout for nested links in forms
- Loading branch information
Showing
3 changed files
with
21 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<%= cocooned_item class: "row mb-3 input-group" do %> | ||
<%= f.label :url, class: "col-sm-2 col-form-label" %> | ||
<%= f.label :url, class: "col col-auto col-form-label" %> | ||
<%= f.url_field :url, class: "form-control col-auto", placeholder: "Any related web page" %> | ||
<%= cocooned_remove_item_button icon(:trash, "Delete"), f, class: "btn btn-outline-danger col-auto" %> | ||
<% end %> |
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,13 +1,20 @@ | ||
<%= cocooned_container id: "cocooned-links" do %> | ||
<%= form.fields_for :links do |f| %> | ||
<%= render "link_fields", f: f %> | ||
<% end %> | ||
<% end %> | ||
<div class="row mb-3"> | ||
<%= tag.div class: "col-auto offset-sm-2 ps-0" do %> | ||
<%= cocooned_add_item_button t(".add"), form, :links, | ||
class: "btn btn-secondary", | ||
insertion_node: "#cocooned-links", | ||
insertion_method: "append" %> | ||
<% end %> | ||
<div class="col col-sm-2 col-form-label"> | ||
<%= t(".links") %> | ||
</div> | ||
<div class="col col-sm-10 border p-3"> | ||
<%= cocooned_container id: "cocooned-links" do %> | ||
<%= form.fields_for :links do |f| %> | ||
<%= render "link_fields", f: f %> | ||
<% end %> | ||
<% end %> | ||
<div class="row mb-3"> | ||
<%= tag.div class: "col-auto offset-sm-2 ps-0" do %> | ||
<%= cocooned_add_item_button t(".add"), form, :links, | ||
class: "btn btn-secondary", | ||
insertion_node: "#cocooned-links", | ||
insertion_method: "append" %> | ||
<% end %> | ||
</div> | ||
</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